Spaces:
Sleeping
Sleeping
File size: 7,191 Bytes
0533780 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 | <!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8"/>
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
<title>GLM-OCR</title>
<link href="https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;700&family=DM+Serif+Display:ital@0;1&family=DM+Sans:wght@400;500&display=swap" rel="stylesheet"/>
<style>
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
:root {
--ink: #0f0e0d;
--paper: #f5f0e8;
--warm: #ede8dc;
--border: #d4cfc3;
--muted: #8f8880;
--accent: #c94a1f;
--green: #1a6b4a;
--mono: 'IBM Plex Mono', monospace;
--serif: 'DM Serif Display', serif;
--sans: 'DM Sans', sans-serif;
}
body {
width: 300px;
background: var(--paper);
color: var(--ink);
font-family: var(--sans);
}
body::before {
content: '';
position: fixed; inset: 0;
background-image: radial-gradient(circle, rgba(0,0,0,0.05) 1px, transparent 1px);
background-size: 16px 16px;
pointer-events: none;
}
.inner { position: relative; }
/* Header */
.header {
padding: 16px 18px 14px;
border-bottom: 2px solid var(--ink);
display: flex;
align-items: center;
justify-content: space-between;
}
.logo {
font-family: var(--serif);
font-size: 1.1rem;
letter-spacing: -0.01em;
}
.logo em { font-style: italic; color: var(--accent); }
.server-badge {
display: flex;
align-items: center;
gap: 5px;
font-family: var(--mono);
font-size: 0.58rem;
color: var(--muted);
letter-spacing: 0.06em;
}
.dot {
width: 6px; height: 6px;
border-radius: 50%;
background: var(--muted);
}
.dot.ok { background: var(--green); }
.dot.err { background: var(--accent); }
.dot.pulse { animation: blink 1.2s ease-in-out infinite; }
@keyframes blink { 0%,100%{opacity:1} 50%{opacity:0.3} }
/* Main CTA */
.cta-area {
padding: 20px 18px;
border-bottom: 1px solid var(--border);
}
.cta-label {
font-family: var(--mono);
font-size: 0.62rem;
color: var(--muted);
letter-spacing: 0.1em;
text-transform: uppercase;
margin-bottom: 10px;
}
.select-btn {
width: 100%;
padding: 14px;
background: var(--accent);
color: white;
border: none;
border-radius: 2px;
font-family: var(--serif);
font-size: 1rem;
cursor: pointer;
transition: background 0.15s;
display: flex;
align-items: center;
justify-content: center;
gap: 8px;
}
.select-btn:hover:not(:disabled) { background: #b53d15; }
.select-btn:disabled { opacity: 0.35; cursor: not-allowed; }
.select-btn .shortcut {
font-family: var(--mono);
font-size: 0.6rem;
opacity: 0.7;
margin-left: auto;
}
.offline-msg {
display: none;
margin-top: 10px;
font-family: var(--mono);
font-size: 0.65rem;
color: var(--accent);
line-height: 1.6;
}
.offline-msg.show { display: block; }
.offline-msg a {
color: var(--accent);
text-decoration: underline;
}
/* How it works */
.how {
padding: 16px 18px;
border-bottom: 1px solid var(--border);
}
.how-title {
font-family: var(--mono);
font-size: 0.6rem;
color: var(--muted);
letter-spacing: 0.1em;
text-transform: uppercase;
margin-bottom: 12px;
}
.step {
display: flex;
gap: 10px;
align-items: flex-start;
margin-bottom: 8px;
}
.step:last-child { margin-bottom: 0; }
.step-num {
font-family: var(--mono);
font-size: 0.6rem;
color: var(--accent);
font-weight: 700;
flex-shrink: 0;
margin-top: 2px;
}
.step-text {
font-size: 0.78rem;
line-height: 1.5;
color: var(--ink);
}
/* Settings */
.settings {
padding: 14px 18px;
}
.settings-title {
font-family: var(--mono);
font-size: 0.6rem;
color: var(--muted);
letter-spacing: 0.1em;
text-transform: uppercase;
margin-bottom: 10px;
}
.setting-row {
display: flex;
align-items: center;
justify-content: space-between;
margin-bottom: 8px;
}
.setting-label {
font-family: var(--mono);
font-size: 0.68rem;
color: var(--ink);
}
.mode-toggle {
display: flex;
gap: 4px;
}
.mode-opt {
font-family: var(--mono);
font-size: 0.58rem;
padding: 4px 8px;
border: 1px solid var(--border);
background: transparent;
color: var(--muted);
cursor: pointer;
border-radius: 2px;
transition: all 0.12s;
}
.mode-opt.active {
background: var(--ink);
border-color: var(--ink);
color: var(--paper);
}
/* Footer */
.footer {
padding: 10px 18px;
border-top: 1px solid var(--border);
font-family: var(--mono);
font-size: 0.58rem;
color: var(--muted);
display: flex;
justify-content: space-between;
}
</style>
</head>
<body>
<div class="inner">
<!-- Header -->
<div class="header">
<div class="logo">GLM-<em>OCR</em></div>
<div class="server-badge">
<div class="dot pulse" id="dot"></div>
<span id="server-label">checking…</span>
</div>
</div>
<!-- CTA -->
<div class="cta-area">
<div class="cta-label">Select region on screen</div>
<button class="select-btn" id="select-btn" disabled>
✂ Select & Extract Text
</button>
<div class="offline-msg" id="offline-msg">
⚠ GLM-OCR server not running.<br>
Start it with <code>python main.py</code> at <a href="http://localhost:8000" target="_blank">localhost:8000</a>.
</div>
</div>
<!-- How it works -->
<div class="how">
<div class="how-title">How it works</div>
<div class="step">
<div class="step-num">01</div>
<div class="step-text">Click the button above — page dims</div>
</div>
<div class="step">
<div class="step-num">02</div>
<div class="step-text">Drag a box around the text you want</div>
</div>
<div class="step">
<div class="step-num">03</div>
<div class="step-text">GLM-OCR extracts text into a sidebar</div>
</div>
<div class="step">
<div class="step-num">04</div>
<div class="step-text">Copy or download the result</div>
</div>
</div>
<!-- Settings -->
<div class="settings">
<div class="settings-title">Settings</div>
<div class="setting-row">
<span class="setting-label">OCR Mode</span>
<div class="mode-toggle">
<button class="mode-opt active" data-mode="recognize">recognize</button>
<button class="mode-opt" data-mode="parse">parse</button>
</div>
</div>
</div>
<div class="footer">
<span>zai-org/GLM-OCR · 0.9B</span>
<span>self-hosted</span>
</div>
</div>
<script src="popup.js"></script>
</body>
</html>
|