askrobots / dbbasic-web-native
Public
100+ copy-paste UI components in plain HTML and CSS: no dependencies, no build step.
danq9
Add canonical.html v1.0 - The single source of truth for usability standards
fb6e650
1 year ago
History
test-all-states-grid.html · 14.5 KB · 419 lines
| 1 | <!DOCTYPE html> |
| 2 | <html lang="en"> |
| 3 | <head> |
| 4 | <meta charset="UTF-8"> |
| 5 | <meta name="viewport" content="width=device-width, initial-scale=1.0"> |
| 6 | <title>All Interactive States - Grid Testing</title> |
| 7 | <style> |
| 8 | body { |
| 9 | background: #1c1c1e; |
| 10 | color: #fff; |
| 11 | font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; |
| 12 | padding: 40px; |
| 13 | margin: 0; |
| 14 | } |
| 15 | |
| 16 | h1 { |
| 17 | text-align: center; |
| 18 | margin-bottom: 10px; |
| 19 | } |
| 20 | |
| 21 | .section-title { |
| 22 | text-align: center; |
| 23 | color: #8e8e93; |
| 24 | margin-bottom: 30px; |
| 25 | font-size: 18px; |
| 26 | } |
| 27 | |
| 28 | .grid { |
| 29 | display: grid; |
| 30 | grid-template-columns: repeat(3, 1fr); |
| 31 | gap: 40px; |
| 32 | max-width: 1400px; |
| 33 | margin: 0 auto 80px; |
| 34 | } |
| 35 | |
| 36 | .test-box { |
| 37 | background: #2c2c2e; |
| 38 | border: 1px solid #38383a; |
| 39 | border-radius: 12px; |
| 40 | padding: 30px; |
| 41 | text-align: center; |
| 42 | } |
| 43 | |
| 44 | .test-label { |
| 45 | font-size: 14px; |
| 46 | color: #8e8e93; |
| 47 | margin-bottom: 20px; |
| 48 | font-weight: 600; |
| 49 | } |
| 50 | |
| 51 | .test-button { |
| 52 | background: #0066cc; |
| 53 | color: white; |
| 54 | border: none; |
| 55 | border-radius: 8px; |
| 56 | padding: 12px 24px; |
| 57 | font-size: 16px; |
| 58 | font-weight: 600; |
| 59 | cursor: pointer; |
| 60 | transition: all 0.2s; |
| 61 | min-height: 44px; |
| 62 | } |
| 63 | |
| 64 | .test-description { |
| 65 | font-size: 12px; |
| 66 | color: #8e8e93; |
| 67 | margin-top: 15px; |
| 68 | line-height: 1.4; |
| 69 | } |
| 70 | |
| 71 | /* ==================== HOVER STATE VARIATIONS ==================== */ |
| 72 | .hover-v1.force-hover { |
| 73 | transform: translateY(-4px) scale(1.05); |
| 74 | box-shadow: 0 12px 32px rgba(64, 156, 255, 0.8); |
| 75 | filter: brightness(1.4) saturate(1.3); |
| 76 | } |
| 77 | |
| 78 | .hover-v2.force-hover { |
| 79 | transform: translateY(-2px); |
| 80 | box-shadow: 0 4px 12px rgba(64, 156, 255, 0.4); |
| 81 | filter: brightness(1.1) saturate(1.1); |
| 82 | } |
| 83 | |
| 84 | .hover-v3.force-hover { |
| 85 | transform: translateY(-1px); |
| 86 | box-shadow: 0 2px 8px rgba(64, 156, 255, 0.3); |
| 87 | filter: brightness(1.05); |
| 88 | } |
| 89 | |
| 90 | .hover-v4.force-hover { |
| 91 | transform: translateY(-2px); |
| 92 | box-shadow: 0 6px 16px rgba(64, 156, 255, 0.5); |
| 93 | filter: brightness(1.15) saturate(1.15); |
| 94 | } |
| 95 | |
| 96 | .hover-v5.force-hover { |
| 97 | transform: translateY(-2px); |
| 98 | box-shadow: 0 3px 8px rgba(64, 156, 255, 0.6); |
| 99 | filter: brightness(1.2); |
| 100 | } |
| 101 | |
| 102 | .hover-v6.force-hover { |
| 103 | transform: translateY(-2px); |
| 104 | box-shadow: 0 8px 20px rgba(64, 156, 255, 0.3); |
| 105 | filter: brightness(1.1); |
| 106 | } |
| 107 | |
| 108 | .hover-v7.force-hover { |
| 109 | transform: translateY(-3px); |
| 110 | box-shadow: 0 6px 12px rgba(0, 0, 0, 0.3); |
| 111 | filter: brightness(1.15); |
| 112 | } |
| 113 | |
| 114 | .hover-v8.force-hover { |
| 115 | box-shadow: 0 2px 6px rgba(64, 156, 255, 0.4); |
| 116 | filter: brightness(1.08); |
| 117 | } |
| 118 | |
| 119 | .hover-v9.force-hover { |
| 120 | transform: translateY(-2px); |
| 121 | box-shadow: 0 4px 10px rgba(64, 156, 255, 0.7); |
| 122 | filter: brightness(1.12) saturate(1.1); |
| 123 | } |
| 124 | |
| 125 | /* ==================== ACTIVE STATE VARIATIONS ==================== */ |
| 126 | .active-v1.force-active { |
| 127 | transform: scale(0.96); |
| 128 | filter: brightness(0.85); |
| 129 | } |
| 130 | |
| 131 | .active-v2.force-active { |
| 132 | transform: scale(0.98); |
| 133 | filter: brightness(0.9); |
| 134 | } |
| 135 | |
| 136 | .active-v3.force-active { |
| 137 | transform: scale(0.94); |
| 138 | filter: brightness(0.8); |
| 139 | box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.4); |
| 140 | } |
| 141 | |
| 142 | .active-v4.force-active { |
| 143 | transform: translateY(2px); |
| 144 | filter: brightness(0.85); |
| 145 | } |
| 146 | |
| 147 | .active-v5.force-active { |
| 148 | transform: scale(0.96) translateY(1px); |
| 149 | filter: brightness(0.85); |
| 150 | box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.3); |
| 151 | } |
| 152 | |
| 153 | .active-v6.force-active { |
| 154 | transform: scale(0.92); |
| 155 | filter: brightness(0.9) saturate(1.2); |
| 156 | } |
| 157 | |
| 158 | .active-v7.force-active { |
| 159 | box-shadow: inset 0 4px 12px rgba(0, 0, 0, 0.5); |
| 160 | filter: brightness(0.85) saturate(1.3); |
| 161 | } |
| 162 | |
| 163 | .active-v8.force-active { |
| 164 | transform: scale(0.98) translateY(1px); |
| 165 | filter: brightness(0.9); |
| 166 | } |
| 167 | |
| 168 | .active-v9.force-active { |
| 169 | transform: scale(0.95); |
| 170 | filter: brightness(0.88); |
| 171 | box-shadow: inset 0 3px 10px rgba(0, 0, 0, 0.4); |
| 172 | } |
| 173 | |
| 174 | /* ==================== FOCUS STATE VARIATIONS ==================== */ |
| 175 | .focus-v1.force-focus { |
| 176 | outline: 3px solid #4d9fff; |
| 177 | outline-offset: 2px; |
| 178 | } |
| 179 | |
| 180 | .focus-v2.force-focus { |
| 181 | outline: 2px solid #409cff; |
| 182 | outline-offset: 3px; |
| 183 | } |
| 184 | |
| 185 | .focus-v3.force-focus { |
| 186 | outline: 4px solid #4d9fff; |
| 187 | outline-offset: 1px; |
| 188 | } |
| 189 | |
| 190 | .focus-v4.force-focus { |
| 191 | outline: 3px solid #4d9fff; |
| 192 | outline-offset: 2px; |
| 193 | box-shadow: 0 0 0 6px rgba(64, 156, 255, 0.2); |
| 194 | } |
| 195 | |
| 196 | .focus-v5.force-focus { |
| 197 | outline: 2px solid #409cff; |
| 198 | outline-offset: 2px; |
| 199 | box-shadow: 0 0 0 4px rgba(64, 156, 255, 0.15); |
| 200 | } |
| 201 | |
| 202 | .focus-v6.force-focus { |
| 203 | box-shadow: 0 0 0 3px #1c1c1e, 0 0 0 6px #4d9fff; |
| 204 | } |
| 205 | |
| 206 | .focus-v7.force-focus { |
| 207 | outline: 3px solid #4d9fff; |
| 208 | outline-offset: 0px; |
| 209 | } |
| 210 | |
| 211 | .focus-v8.force-focus { |
| 212 | box-shadow: 0 0 0 4px rgba(64, 156, 255, 0.5); |
| 213 | } |
| 214 | |
| 215 | .focus-v9.force-focus { |
| 216 | outline: 2px solid #4d9fff; |
| 217 | outline-offset: 4px; |
| 218 | filter: brightness(1.1); |
| 219 | } |
| 220 | </style> |
| 221 | </head> |
| 222 | <body> |
| 223 | <h1>Interactive States Testing Grid</h1> |
| 224 | <p class="section-title">Systematically compare 9 variations for each state</p> |
| 225 | |
| 226 | <!-- HOVER STATES --> |
| 227 | <h2 style="text-align: center; margin-top: 60px; color: #409cff;">Hover State Variations</h2> |
| 228 | <div class="grid"> |
| 229 | <div class="test-box"> |
| 230 | <div class="test-label">V1: ORIGINAL DRAMATIC</div> |
| 231 | <button class="test-button hover-v1">Hover Me</button> |
| 232 | <div class="test-description">32px blur, 0.8 opacity<br>Scale 1.05, lift -4px<br>Brightness 1.4</div> |
| 233 | </div> |
| 234 | |
| 235 | <div class="test-box"> |
| 236 | <div class="test-label">V2: REFINED PROFESSIONAL</div> |
| 237 | <button class="test-button hover-v2">Hover Me</button> |
| 238 | <div class="test-description">12px blur, 0.4 opacity<br>No scale, lift -2px<br>Brightness 1.1</div> |
| 239 | </div> |
| 240 | |
| 241 | <div class="test-box"> |
| 242 | <div class="test-label">V3: SUBTLE TIGHT</div> |
| 243 | <button class="test-button hover-v3">Hover Me</button> |
| 244 | <div class="test-description">8px blur, 0.3 opacity<br>No scale, lift -1px<br>Brightness 1.05</div> |
| 245 | </div> |
| 246 | |
| 247 | <div class="test-box"> |
| 248 | <div class="test-label">V4: MEDIUM BALANCED</div> |
| 249 | <button class="test-button hover-v4">Hover Me</button> |
| 250 | <div class="test-description">16px blur, 0.5 opacity<br>No scale, lift -2px<br>Brightness 1.15</div> |
| 251 | </div> |
| 252 | |
| 253 | <div class="test-box"> |
| 254 | <div class="test-label">V5: TIGHT BUT BRIGHT ⭐</div> |
| 255 | <button class="test-button hover-v5">Hover Me</button> |
| 256 | <div class="test-description">8px blur, 0.6 opacity<br>No scale, lift -2px<br>Brightness 1.2</div> |
| 257 | </div> |
| 258 | |
| 259 | <div class="test-box"> |
| 260 | <div class="test-label">V6: WIDE SUBTLE</div> |
| 261 | <button class="test-button hover-v6">Hover Me</button> |
| 262 | <div class="test-description">20px blur, 0.3 opacity<br>No scale, lift -2px<br>Brightness 1.1</div> |
| 263 | </div> |
| 264 | |
| 265 | <div class="test-box"> |
| 266 | <div class="test-label">V7: NO GLOW</div> |
| 267 | <button class="test-button hover-v7">Hover Me</button> |
| 268 | <div class="test-description">Dark shadow only<br>No scale, lift -3px<br>Brightness 1.15</div> |
| 269 | </div> |
| 270 | |
| 271 | <div class="test-box"> |
| 272 | <div class="test-label">V8: MINIMAL</div> |
| 273 | <button class="test-button hover-v8">Hover Me</button> |
| 274 | <div class="test-description">6px blur, 0.4 opacity<br>No lift, no scale<br>Brightness 1.08</div> |
| 275 | </div> |
| 276 | |
| 277 | <div class="test-box"> |
| 278 | <div class="test-label">V9: STRONG CONTAINED</div> |
| 279 | <button class="test-button hover-v9">Hover Me</button> |
| 280 | <div class="test-description">10px blur, 0.7 opacity<br>No scale, lift -2px<br>Brightness 1.12</div> |
| 281 | </div> |
| 282 | </div> |
| 283 | |
| 284 | <!-- ACTIVE STATES --> |
| 285 | <h2 style="text-align: center; margin-top: 60px; color: #ff9500;">Active State Variations</h2> |
| 286 | <div class="grid"> |
| 287 | <div class="test-box"> |
| 288 | <div class="test-label">V1: CURRENT (96% SCALE)</div> |
| 289 | <button class="test-button active-v1">Active</button> |
| 290 | <div class="test-description">Scale 0.96<br>Brightness 0.85<br>No shadow</div> |
| 291 | </div> |
| 292 | |
| 293 | <div class="test-box"> |
| 294 | <div class="test-label">V2: SUBTLE SCALE</div> |
| 295 | <button class="test-button active-v2">Active</button> |
| 296 | <div class="test-description">Scale 0.98<br>Brightness 0.9<br>Gentle press</div> |
| 297 | </div> |
| 298 | |
| 299 | <div class="test-box"> |
| 300 | <div class="test-label">V3: DEEP PRESS</div> |
| 301 | <button class="test-button active-v3">Active</button> |
| 302 | <div class="test-description">Scale 0.94<br>Inset shadow<br>Brightness 0.8</div> |
| 303 | </div> |
| 304 | |
| 305 | <div class="test-box"> |
| 306 | <div class="test-label">V4: PUSH DOWN</div> |
| 307 | <button class="test-button active-v4">Active</button> |
| 308 | <div class="test-description">No scale<br>TranslateY +2px<br>Brightness 0.85</div> |
| 309 | </div> |
| 310 | |
| 311 | <div class="test-box"> |
| 312 | <div class="test-label">V5: SCALE + PUSH</div> |
| 313 | <button class="test-button active-v5">Active</button> |
| 314 | <div class="test-description">Scale 0.96 + Y+1px<br>Inset shadow<br>Brightness 0.85</div> |
| 315 | </div> |
| 316 | |
| 317 | <div class="test-box"> |
| 318 | <div class="test-label">V6: DRAMATIC SHRINK</div> |
| 319 | <button class="test-button active-v6">Active</button> |
| 320 | <div class="test-description">Scale 0.92<br>Saturate 1.2<br>Brightness 0.9</div> |
| 321 | </div> |
| 322 | |
| 323 | <div class="test-box"> |
| 324 | <div class="test-label">V7: INSET SHADOW ONLY</div> |
| 325 | <button class="test-button active-v7">Active</button> |
| 326 | <div class="test-description">No scale/transform<br>Strong inset shadow<br>Saturate 1.3</div> |
| 327 | </div> |
| 328 | |
| 329 | <div class="test-box"> |
| 330 | <div class="test-label">V8: MINIMAL FEEDBACK</div> |
| 331 | <button class="test-button active-v8">Active</button> |
| 332 | <div class="test-description">Scale 0.98 + Y+1px<br>Brightness 0.9<br>Light touch</div> |
| 333 | </div> |
| 334 | |
| 335 | <div class="test-box"> |
| 336 | <div class="test-label">V9: BALANCED PRESS</div> |
| 337 | <button class="test-button active-v9">Active</button> |
| 338 | <div class="test-description">Scale 0.95<br>Inset shadow<br>Brightness 0.88</div> |
| 339 | </div> |
| 340 | </div> |
| 341 | |
| 342 | <!-- FOCUS STATES --> |
| 343 | <h2 style="text-align: center; margin-top: 60px; color: #34c759;">Focus State Variations</h2> |
| 344 | <div class="grid"> |
| 345 | <div class="test-box"> |
| 346 | <div class="test-label">V1: CURRENT (3PX OFFSET 2)</div> |
| 347 | <button class="test-button focus-v1">Focus</button> |
| 348 | <div class="test-description">3px outline<br>2px offset<br>Standard blue</div> |
| 349 | </div> |
| 350 | |
| 351 | <div class="test-box"> |
| 352 | <div class="test-label">V2: THIN FAR</div> |
| 353 | <button class="test-button focus-v2">Focus</button> |
| 354 | <div class="test-description">2px outline<br>3px offset<br>Lighter weight</div> |
| 355 | </div> |
| 356 | |
| 357 | <div class="test-box"> |
| 358 | <div class="test-label">V3: THICK CLOSE</div> |
| 359 | <button class="test-button focus-v3">Focus</button> |
| 360 | <div class="test-description">4px outline<br>1px offset<br>Strong presence</div> |
| 361 | </div> |
| 362 | |
| 363 | <div class="test-box"> |
| 364 | <div class="test-label">V4: DOUBLE RING</div> |
| 365 | <button class="test-button focus-v4">Focus</button> |
| 366 | <div class="test-description">Outline + glow ring<br>Layered effect<br>Clear visibility</div> |
| 367 | </div> |
| 368 | |
| 369 | <div class="test-box"> |
| 370 | <div class="test-label">V5: SOFT GLOW</div> |
| 371 | <button class="test-button focus-v5">Focus</button> |
| 372 | <div class="test-description">2px outline<br>Soft shadow ring<br>Gentle approach</div> |
| 373 | </div> |
| 374 | |
| 375 | <div class="test-box"> |
| 376 | <div class="test-label">V6: GAP RING</div> |
| 377 | <button class="test-button focus-v6">Focus</button> |
| 378 | <div class="test-description">Box-shadow only<br>Dark gap + blue ring<br>Distinct separation</div> |
| 379 | </div> |
| 380 | |
| 381 | <div class="test-box"> |
| 382 | <div class="test-label">V7: NO OFFSET</div> |
| 383 | <button class="test-button focus-v7">Focus</button> |
| 384 | <div class="test-description">3px outline<br>0px offset<br>Tight border</div> |
| 385 | </div> |
| 386 | |
| 387 | <div class="test-box"> |
| 388 | <div class="test-label">V8: SHADOW RING</div> |
| 389 | <button class="test-button focus-v8">Focus</button> |
| 390 | <div class="test-description">Box-shadow only<br>No outline<br>Soft boundary</div> |
| 391 | </div> |
| 392 | |
| 393 | <div class="test-box"> |
| 394 | <div class="test-label">V9: BRIGHT FAR</div> |
| 395 | <button class="test-button focus-v9">Focus</button> |
| 396 | <div class="test-description">2px outline<br>4px offset<br>Brightness boost</div> |
| 397 | </div> |
| 398 | </div> |
| 399 | |
| 400 | <script> |
| 401 | document.addEventListener('DOMContentLoaded', () => { |
| 402 | // Force all hover states |
| 403 | document.querySelectorAll('[class*="hover-v"]').forEach(btn => { |
| 404 | btn.classList.add('force-hover'); |
| 405 | }); |
| 406 | |
| 407 | // Force all active states |
| 408 | document.querySelectorAll('[class*="active-v"]').forEach(btn => { |
| 409 | btn.classList.add('force-active'); |
| 410 | }); |
| 411 | |
| 412 | // Force all focus states |
| 413 | document.querySelectorAll('[class*="focus-v"]').forEach(btn => { |
| 414 | btn.classList.add('force-focus'); |
| 415 | }); |
| 416 | }); |
| 417 | </script> |
| 418 | </body> |
| 419 | </html> |