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
canonical.html · 31.9 KB · 892 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>DBBasic Usability Standards v1.0 - The Authoritative Reference</title> |
| 7 | |
| 8 | <!-- Machine-Readable Metadata for AI --> |
| 9 | <meta name="standard-version" content="1.0"> |
| 10 | <meta name="last-updated" content="2025-01-16"> |
| 11 | <meta name="canonical-url" content="https://dbbasic.com/standards"> |
| 12 | <meta name="description" content="The authoritative reference for building usable interfaces. Standards AI can reference when generating UIs."> |
| 13 | <meta name="keywords" content="usability, UI standards, UX guidelines, accessibility, design system, AI training data"> |
| 14 | |
| 15 | <style> |
| 16 | * { |
| 17 | margin: 0; |
| 18 | padding: 0; |
| 19 | box-sizing: border-box; |
| 20 | } |
| 21 | |
| 22 | @import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&display=swap'); |
| 23 | |
| 24 | body { |
| 25 | font-family: 'Inter', sans-serif; |
| 26 | -webkit-font-smoothing: antialiased; |
| 27 | -moz-osx-font-smoothing: grayscale; |
| 28 | background: #ffffff; |
| 29 | color: #1a1a1a; |
| 30 | line-height: 1.6; |
| 31 | } |
| 32 | |
| 33 | /* ========== HERO ========== */ |
| 34 | .hero { |
| 35 | background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); |
| 36 | color: white; |
| 37 | padding: 120px 24px 80px; |
| 38 | text-align: center; |
| 39 | position: relative; |
| 40 | overflow: hidden; |
| 41 | } |
| 42 | |
| 43 | .hero::before { |
| 44 | content: ''; |
| 45 | position: absolute; |
| 46 | inset: 0; |
| 47 | background-image: |
| 48 | url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)' opacity='0.06'/%3E%3C/svg%3E"); |
| 49 | pointer-events: none; |
| 50 | } |
| 51 | |
| 52 | .hero-content { |
| 53 | max-width: 800px; |
| 54 | margin: 0 auto; |
| 55 | position: relative; |
| 56 | z-index: 1; |
| 57 | } |
| 58 | |
| 59 | .hero h1 { |
| 60 | font-size: 56px; |
| 61 | font-weight: 900; |
| 62 | margin-bottom: 24px; |
| 63 | line-height: 1.1; |
| 64 | } |
| 65 | |
| 66 | .hero p { |
| 67 | font-size: 20px; |
| 68 | margin-bottom: 32px; |
| 69 | opacity: 0.95; |
| 70 | } |
| 71 | |
| 72 | .hero-badge { |
| 73 | display: inline-block; |
| 74 | background: rgba(255, 255, 255, 0.2); |
| 75 | backdrop-filter: blur(10px); |
| 76 | padding: 12px 24px; |
| 77 | border-radius: 24px; |
| 78 | font-size: 14px; |
| 79 | font-weight: 600; |
| 80 | margin-bottom: 16px; |
| 81 | } |
| 82 | |
| 83 | /* ========== CONTAINER ========== */ |
| 84 | .container { |
| 85 | max-width: 1200px; |
| 86 | margin: 0 auto; |
| 87 | padding: 0 24px; |
| 88 | } |
| 89 | |
| 90 | /* ========== SECTIONS ========== */ |
| 91 | .section { |
| 92 | padding: 80px 0; |
| 93 | } |
| 94 | |
| 95 | .section:nth-child(even) { |
| 96 | background: #f9fafb; |
| 97 | } |
| 98 | |
| 99 | .section-header { |
| 100 | text-align: center; |
| 101 | margin-bottom: 64px; |
| 102 | } |
| 103 | |
| 104 | .section-eyebrow { |
| 105 | font-size: 14px; |
| 106 | font-weight: 700; |
| 107 | text-transform: uppercase; |
| 108 | letter-spacing: 1px; |
| 109 | color: #7C3AED; |
| 110 | margin-bottom: 12px; |
| 111 | } |
| 112 | |
| 113 | .section h2 { |
| 114 | font-size: 40px; |
| 115 | font-weight: 800; |
| 116 | color: #111827; |
| 117 | margin-bottom: 16px; |
| 118 | } |
| 119 | |
| 120 | .section-description { |
| 121 | font-size: 18px; |
| 122 | color: #6b7280; |
| 123 | max-width: 700px; |
| 124 | margin: 0 auto; |
| 125 | } |
| 126 | |
| 127 | /* ========== STANDARD CARD ========== */ |
| 128 | .standard { |
| 129 | margin-bottom: 80px; |
| 130 | } |
| 131 | |
| 132 | .standard-header { |
| 133 | margin-bottom: 32px; |
| 134 | } |
| 135 | |
| 136 | .standard-title { |
| 137 | font-size: 28px; |
| 138 | font-weight: 700; |
| 139 | color: #111827; |
| 140 | margin-bottom: 12px; |
| 141 | } |
| 142 | |
| 143 | .standard-why { |
| 144 | font-size: 16px; |
| 145 | color: #6b7280; |
| 146 | margin-bottom: 8px; |
| 147 | } |
| 148 | |
| 149 | .standard-why strong { |
| 150 | color: #111827; |
| 151 | } |
| 152 | |
| 153 | .standard-rule { |
| 154 | display: inline-block; |
| 155 | background: #fef3c7; |
| 156 | color: #92400e; |
| 157 | padding: 8px 16px; |
| 158 | border-radius: 6px; |
| 159 | font-size: 14px; |
| 160 | font-weight: 600; |
| 161 | margin-top: 12px; |
| 162 | } |
| 163 | |
| 164 | /* ========== EXAMPLE CONTAINER ========== */ |
| 165 | .example-container { |
| 166 | display: grid; |
| 167 | grid-template-columns: 1fr 1fr; |
| 168 | gap: 32px; |
| 169 | margin-bottom: 24px; |
| 170 | } |
| 171 | |
| 172 | .example { |
| 173 | background: white; |
| 174 | border: 2px solid #e5e7eb; |
| 175 | border-radius: 12px; |
| 176 | overflow: hidden; |
| 177 | } |
| 178 | |
| 179 | .example-label { |
| 180 | background: #f9fafb; |
| 181 | padding: 12px 16px; |
| 182 | font-size: 14px; |
| 183 | font-weight: 700; |
| 184 | color: #111827; |
| 185 | border-bottom: 2px solid #e5e7eb; |
| 186 | display: flex; |
| 187 | align-items: center; |
| 188 | gap: 8px; |
| 189 | } |
| 190 | |
| 191 | .example-label.good::before { |
| 192 | content: '✓'; |
| 193 | color: #22c55e; |
| 194 | font-size: 18px; |
| 195 | font-weight: 900; |
| 196 | } |
| 197 | |
| 198 | .example-label.bad::before { |
| 199 | content: '✗'; |
| 200 | color: #ef4444; |
| 201 | font-size: 18px; |
| 202 | font-weight: 900; |
| 203 | } |
| 204 | |
| 205 | .example-content { |
| 206 | padding: 32px; |
| 207 | min-height: 200px; |
| 208 | display: flex; |
| 209 | align-items: center; |
| 210 | justify-content: center; |
| 211 | } |
| 212 | |
| 213 | /* ========== NAVIGATION EXAMPLES ========== */ |
| 214 | .nav-example-mobile { |
| 215 | width: 100%; |
| 216 | max-width: 375px; |
| 217 | height: 600px; |
| 218 | border: 8px solid #1f2937; |
| 219 | border-radius: 24px; |
| 220 | background: #f9fafb; |
| 221 | position: relative; |
| 222 | overflow: hidden; |
| 223 | } |
| 224 | |
| 225 | .mobile-header { |
| 226 | background: white; |
| 227 | padding: 16px; |
| 228 | display: flex; |
| 229 | justify-content: space-between; |
| 230 | align-items: center; |
| 231 | border-bottom: 1px solid #e5e7eb; |
| 232 | } |
| 233 | |
| 234 | .mobile-header-title { |
| 235 | font-size: 18px; |
| 236 | font-weight: 700; |
| 237 | } |
| 238 | |
| 239 | .mobile-icon { |
| 240 | width: 44px; |
| 241 | height: 44px; |
| 242 | background: #f3f4f6; |
| 243 | border-radius: 8px; |
| 244 | display: flex; |
| 245 | align-items: center; |
| 246 | justify-content: center; |
| 247 | font-size: 20px; |
| 248 | } |
| 249 | |
| 250 | .mobile-bottom-nav { |
| 251 | position: absolute; |
| 252 | bottom: 0; |
| 253 | left: 0; |
| 254 | right: 0; |
| 255 | background: white; |
| 256 | border-top: 1px solid #e5e7eb; |
| 257 | display: flex; |
| 258 | padding: 8px 0; |
| 259 | } |
| 260 | |
| 261 | .mobile-nav-item { |
| 262 | flex: 1; |
| 263 | display: flex; |
| 264 | flex-direction: column; |
| 265 | align-items: center; |
| 266 | padding: 8px; |
| 267 | gap: 4px; |
| 268 | min-height: 64px; |
| 269 | cursor: pointer; |
| 270 | transition: all 0.2s; |
| 271 | } |
| 272 | |
| 273 | .mobile-nav-item:hover { |
| 274 | background: #f9fafb; |
| 275 | } |
| 276 | |
| 277 | .mobile-nav-item.active { |
| 278 | color: #7C3AED; |
| 279 | } |
| 280 | |
| 281 | .mobile-nav-icon { |
| 282 | font-size: 24px; |
| 283 | } |
| 284 | |
| 285 | .mobile-nav-label { |
| 286 | font-size: 11px; |
| 287 | font-weight: 600; |
| 288 | } |
| 289 | |
| 290 | /* ========== TOUCH TARGET EXAMPLES ========== */ |
| 291 | .touch-target-demo { |
| 292 | display: flex; |
| 293 | gap: 32px; |
| 294 | align-items: center; |
| 295 | flex-wrap: wrap; |
| 296 | } |
| 297 | |
| 298 | .touch-target { |
| 299 | position: relative; |
| 300 | } |
| 301 | |
| 302 | .touch-target-button { |
| 303 | background: #7C3AED; |
| 304 | color: white; |
| 305 | border: none; |
| 306 | border-radius: 8px; |
| 307 | font-weight: 600; |
| 308 | cursor: pointer; |
| 309 | font-family: inherit; |
| 310 | } |
| 311 | |
| 312 | .touch-target-button.good { |
| 313 | width: 44px; |
| 314 | height: 44px; |
| 315 | font-size: 14px; |
| 316 | } |
| 317 | |
| 318 | .touch-target-button.bad { |
| 319 | width: 28px; |
| 320 | height: 28px; |
| 321 | font-size: 12px; |
| 322 | } |
| 323 | |
| 324 | .touch-target-overlay { |
| 325 | position: absolute; |
| 326 | border: 2px dashed; |
| 327 | pointer-events: none; |
| 328 | } |
| 329 | |
| 330 | .touch-target.good .touch-target-overlay { |
| 331 | border-color: #22c55e; |
| 332 | background: rgba(34, 197, 94, 0.1); |
| 333 | } |
| 334 | |
| 335 | .touch-target.bad .touch-target-overlay { |
| 336 | border-color: #ef4444; |
| 337 | background: rgba(239, 68, 68, 0.1); |
| 338 | } |
| 339 | |
| 340 | .touch-target-size { |
| 341 | position: absolute; |
| 342 | top: -24px; |
| 343 | left: 50%; |
| 344 | transform: translateX(-50%); |
| 345 | font-size: 11px; |
| 346 | font-weight: 700; |
| 347 | white-space: nowrap; |
| 348 | padding: 2px 6px; |
| 349 | border-radius: 4px; |
| 350 | } |
| 351 | |
| 352 | .touch-target.good .touch-target-size { |
| 353 | background: #22c55e; |
| 354 | color: white; |
| 355 | } |
| 356 | |
| 357 | .touch-target.bad .touch-target-size { |
| 358 | background: #ef4444; |
| 359 | color: white; |
| 360 | } |
| 361 | |
| 362 | /* ========== SPACING EXAMPLES ========== */ |
| 363 | .spacing-demo { |
| 364 | background: white; |
| 365 | padding: 32px; |
| 366 | border-radius: 12px; |
| 367 | border: 2px solid #e5e7eb; |
| 368 | } |
| 369 | |
| 370 | .spacing-box { |
| 371 | background: #7C3AED; |
| 372 | color: white; |
| 373 | padding: 16px; |
| 374 | border-radius: 8px; |
| 375 | font-weight: 600; |
| 376 | text-align: center; |
| 377 | } |
| 378 | |
| 379 | .spacing-indicator { |
| 380 | height: 32px; |
| 381 | background: repeating-linear-gradient( |
| 382 | 90deg, |
| 383 | #e5e7eb, |
| 384 | #e5e7eb 8px, |
| 385 | transparent 8px, |
| 386 | transparent 16px |
| 387 | ); |
| 388 | position: relative; |
| 389 | margin: 16px 0; |
| 390 | } |
| 391 | |
| 392 | .spacing-label { |
| 393 | position: absolute; |
| 394 | top: 50%; |
| 395 | left: 50%; |
| 396 | transform: translate(-50%, -50%); |
| 397 | background: #7C3AED; |
| 398 | color: white; |
| 399 | padding: 4px 12px; |
| 400 | border-radius: 4px; |
| 401 | font-size: 12px; |
| 402 | font-weight: 700; |
| 403 | } |
| 404 | |
| 405 | /* ========== FORM EXAMPLES ========== */ |
| 406 | .form-demo { |
| 407 | max-width: 400px; |
| 408 | } |
| 409 | |
| 410 | .form-group { |
| 411 | margin-bottom: 24px; |
| 412 | } |
| 413 | |
| 414 | .form-label { |
| 415 | display: block; |
| 416 | font-size: 14px; |
| 417 | font-weight: 600; |
| 418 | color: #374151; |
| 419 | margin-bottom: 8px; |
| 420 | } |
| 421 | |
| 422 | .form-input { |
| 423 | width: 100%; |
| 424 | padding: 14px 16px; |
| 425 | border: 2px solid #e5e7eb; |
| 426 | border-radius: 8px; |
| 427 | font-size: 16px; |
| 428 | font-family: inherit; |
| 429 | transition: all 0.2s; |
| 430 | } |
| 431 | |
| 432 | .form-input:focus { |
| 433 | outline: none; |
| 434 | border-color: #7C3AED; |
| 435 | box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.1); |
| 436 | } |
| 437 | |
| 438 | .form-button { |
| 439 | background: #7C3AED; |
| 440 | color: white; |
| 441 | border: none; |
| 442 | padding: 14px 24px; |
| 443 | border-radius: 8px; |
| 444 | font-size: 16px; |
| 445 | font-weight: 600; |
| 446 | cursor: pointer; |
| 447 | font-family: inherit; |
| 448 | transition: all 0.2s; |
| 449 | } |
| 450 | |
| 451 | .form-button:hover { |
| 452 | transform: translateY(-2px); |
| 453 | box-shadow: 0 8px 20px rgba(124, 58, 237, 0.3); |
| 454 | } |
| 455 | |
| 456 | /* ========== APPLICATION TYPE CARDS ========== */ |
| 457 | .app-type-grid { |
| 458 | display: grid; |
| 459 | grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); |
| 460 | gap: 32px; |
| 461 | margin-top: 48px; |
| 462 | } |
| 463 | |
| 464 | .app-type-card { |
| 465 | background: white; |
| 466 | border: 2px solid #e5e7eb; |
| 467 | border-radius: 12px; |
| 468 | padding: 32px; |
| 469 | transition: all 0.3s; |
| 470 | } |
| 471 | |
| 472 | .app-type-card:hover { |
| 473 | border-color: #7C3AED; |
| 474 | box-shadow: 0 8px 24px rgba(124, 58, 237, 0.15); |
| 475 | transform: translateY(-4px); |
| 476 | } |
| 477 | |
| 478 | .app-type-icon { |
| 479 | font-size: 48px; |
| 480 | margin-bottom: 16px; |
| 481 | } |
| 482 | |
| 483 | .app-type-title { |
| 484 | font-size: 24px; |
| 485 | font-weight: 700; |
| 486 | color: #111827; |
| 487 | margin-bottom: 8px; |
| 488 | } |
| 489 | |
| 490 | .app-type-goal { |
| 491 | font-size: 14px; |
| 492 | color: #7C3AED; |
| 493 | font-weight: 600; |
| 494 | margin-bottom: 16px; |
| 495 | } |
| 496 | |
| 497 | .app-type-list { |
| 498 | list-style: none; |
| 499 | font-size: 14px; |
| 500 | color: #6b7280; |
| 501 | } |
| 502 | |
| 503 | .app-type-list li { |
| 504 | padding: 8px 0; |
| 505 | border-bottom: 1px solid #f3f4f6; |
| 506 | } |
| 507 | |
| 508 | .app-type-list li:last-child { |
| 509 | border-bottom: none; |
| 510 | } |
| 511 | |
| 512 | .app-type-list strong { |
| 513 | color: #111827; |
| 514 | font-weight: 600; |
| 515 | } |
| 516 | |
| 517 | /* ========== FOOTER ========== */ |
| 518 | .footer { |
| 519 | background: #111827; |
| 520 | color: white; |
| 521 | padding: 48px 24px; |
| 522 | text-align: center; |
| 523 | } |
| 524 | |
| 525 | .footer a { |
| 526 | color: #7C3AED; |
| 527 | text-decoration: none; |
| 528 | font-weight: 600; |
| 529 | } |
| 530 | |
| 531 | .footer a:hover { |
| 532 | text-decoration: underline; |
| 533 | } |
| 534 | |
| 535 | /* ========== RESPONSIVE ========== */ |
| 536 | @media (max-width: 768px) { |
| 537 | .hero h1 { |
| 538 | font-size: 36px; |
| 539 | } |
| 540 | |
| 541 | .section h2 { |
| 542 | font-size: 28px; |
| 543 | } |
| 544 | |
| 545 | .example-container { |
| 546 | grid-template-columns: 1fr; |
| 547 | } |
| 548 | |
| 549 | .standard-title { |
| 550 | font-size: 22px; |
| 551 | } |
| 552 | } |
| 553 | </style> |
| 554 | </head> |
| 555 | <body> |
| 556 | <!-- HERO --> |
| 557 | <div class="hero"> |
| 558 | <div class="hero-content"> |
| 559 | <div class="hero-badge">VERSION 1.0</div> |
| 560 | <h1>DBBasic Usability Standards</h1> |
| 561 | <p>The authoritative reference for building usable interfaces.<br> |
| 562 | Visual guide with WHY explanations, good/bad examples, and code snippets.</p> |
| 563 | <div style="margin-top: 24px; font-size: 14px; opacity: 0.9; font-family: 'Courier New', monospace; background: rgba(0, 0, 0, 0.2); padding: 12px 20px; border-radius: 6px; display: inline-block;"> |
| 564 | Citation: DBBasic Usability Standards v1.0 (dbbasic.com/standards) |
| 565 | </div> |
| 566 | </div> |
| 567 | </div> |
| 568 | |
| 569 | <!-- NAVIGATION STANDARDS --> |
| 570 | <div class="section"> |
| 571 | <div class="container"> |
| 572 | <div class="section-header"> |
| 573 | <div class="section-eyebrow">Navigation</div> |
| 574 | <h2>Consistent Navigation Hierarchy</h2> |
| 575 | <p class="section-description">Put navigation in the same place every time. Users shouldn't hunt for it.</p> |
| 576 | </div> |
| 577 | |
| 578 | <div class="standard"> |
| 579 | <div class="standard-header"> |
| 580 | <h3 class="standard-title">Mobile: Bottom Tab Bar</h3> |
| 581 | <p class="standard-why"><strong>Why:</strong> Thumb-friendly zone. 70% of users hold phones one-handed.</p> |
| 582 | <div class="standard-rule">✓ Height: 64px minimum • Items: 3-5 max • Always visible</div> |
| 583 | </div> |
| 584 | |
| 585 | <div class="example-container"> |
| 586 | <div class="example"> |
| 587 | <div class="example-label good">Good Example</div> |
| 588 | <div class="example-content"> |
| 589 | <div class="nav-example-mobile"> |
| 590 | <div class="mobile-header"> |
| 591 | <div class="mobile-icon">☰</div> |
| 592 | <div class="mobile-header-title">Dashboard</div> |
| 593 | <div class="mobile-icon">⚙️</div> |
| 594 | </div> |
| 595 | <div class="mobile-bottom-nav"> |
| 596 | <div class="mobile-nav-item active"> |
| 597 | <div class="mobile-nav-icon">🏠</div> |
| 598 | <div class="mobile-nav-label">Home</div> |
| 599 | </div> |
| 600 | <div class="mobile-nav-item"> |
| 601 | <div class="mobile-nav-icon">🔍</div> |
| 602 | <div class="mobile-nav-label">Search</div> |
| 603 | </div> |
| 604 | <div class="mobile-nav-item"> |
| 605 | <div class="mobile-nav-icon">➕</div> |
| 606 | <div class="mobile-nav-label">Create</div> |
| 607 | </div> |
| 608 | <div class="mobile-nav-item"> |
| 609 | <div class="mobile-nav-icon">👤</div> |
| 610 | <div class="mobile-nav-label">Profile</div> |
| 611 | </div> |
| 612 | </div> |
| 613 | </div> |
| 614 | </div> |
| 615 | </div> |
| 616 | |
| 617 | <div class="example"> |
| 618 | <div class="example-label bad">Bad Example</div> |
| 619 | <div class="example-content"> |
| 620 | <div class="nav-example-mobile"> |
| 621 | <div class="mobile-header"> |
| 622 | <div class="mobile-header-title">Dashboard</div> |
| 623 | <div class="mobile-icon">☰</div> |
| 624 | </div> |
| 625 | <div style="padding: 24px; font-size: 14px; color: #ef4444;"> |
| 626 | <p><strong>❌ Problems:</strong></p> |
| 627 | <ul style="margin-left: 20px; margin-top: 12px; line-height: 1.8;"> |
| 628 | <li>No bottom navigation (must reach top-right menu)</li> |
| 629 | <li>Navigation hidden in hamburger</li> |
| 630 | <li>Requires two-handed operation</li> |
| 631 | <li>Slows down common tasks</li> |
| 632 | </ul> |
| 633 | </div> |
| 634 | </div> |
| 635 | </div> |
| 636 | </div> |
| 637 | </div> |
| 638 | </div> |
| 639 | </div> |
| 640 | </div> |
| 641 | |
| 642 | <!-- TOUCH TARGETS --> |
| 643 | <div class="section"> |
| 644 | <div class="container"> |
| 645 | <div class="section-header"> |
| 646 | <div class="section-eyebrow">Touch Targets</div> |
| 647 | <h2>Minimum Tap Sizes</h2> |
| 648 | <p class="section-description">Make everything big enough to tap without frustration.</p> |
| 649 | </div> |
| 650 | |
| 651 | <div class="standard"> |
| 652 | <div class="standard-header"> |
| 653 | <h3 class="standard-title">Mobile: 44×44px Minimum</h3> |
| 654 | <p class="standard-why"><strong>Why:</strong> Prevents mis-taps from "fat finger problem". WCAG 2.5.5 Level AAA standard.</p> |
| 655 | <div class="standard-rule">✓ Mobile: 44×44px • Desktop: 32×32px • Spacing: 8px minimum</div> |
| 656 | </div> |
| 657 | |
| 658 | <div class="example-container"> |
| 659 | <div class="example"> |
| 660 | <div class="example-label good">Good Example - 44×44px</div> |
| 661 | <div class="example-content"> |
| 662 | <div class="touch-target-demo"> |
| 663 | <div class="touch-target good"> |
| 664 | <div class="touch-target-size">44×44px</div> |
| 665 | <div class="touch-target-overlay" style="width: 44px; height: 44px;"></div> |
| 666 | <button class="touch-target-button good">✓</button> |
| 667 | </div> |
| 668 | <div style="max-width: 200px;"> |
| 669 | <p style="font-size: 14px; color: #22c55e;"><strong>✓ Easy to tap</strong></p> |
| 670 | <p style="font-size: 13px; color: #6b7280; margin-top: 4px;">Large enough for thumbs, prevents accidental taps on nearby elements.</p> |
| 671 | </div> |
| 672 | </div> |
| 673 | </div> |
| 674 | </div> |
| 675 | |
| 676 | <div class="example"> |
| 677 | <div class="example-label bad">Bad Example - 28×28px</div> |
| 678 | <div class="example-content"> |
| 679 | <div class="touch-target-demo"> |
| 680 | <div class="touch-target bad"> |
| 681 | <div class="touch-target-size">28×28px</div> |
| 682 | <div class="touch-target-overlay" style="width: 44px; height: 44px;"></div> |
| 683 | <button class="touch-target-button bad">✗</button> |
| 684 | </div> |
| 685 | <div style="max-width: 200px;"> |
| 686 | <p style="font-size: 14px; color: #ef4444;"><strong>✗ Too small</strong></p> |
| 687 | <p style="font-size: 13px; color: #6b7280; margin-top: 4px;">Requires precision tapping, causes user frustration and errors.</p> |
| 688 | </div> |
| 689 | </div> |
| 690 | </div> |
| 691 | </div> |
| 692 | </div> |
| 693 | </div> |
| 694 | </div> |
| 695 | </div> |
| 696 | |
| 697 | <!-- SPACING SYSTEM --> |
| 698 | <div class="section"> |
| 699 | <div class="container"> |
| 700 | <div class="section-header"> |
| 701 | <div class="section-eyebrow">Spacing</div> |
| 702 | <h2>Consistent Spacing System</h2> |
| 703 | <p class="section-description">Use a mathematical system. No random pixel values.</p> |
| 704 | </div> |
| 705 | |
| 706 | <div class="standard"> |
| 707 | <div class="standard-header"> |
| 708 | <h3 class="standard-title">8px Base Unit</h3> |
| 709 | <p class="standard-why"><strong>Why:</strong> Creates visual rhythm, divisible by 2/4 for responsive design, works with most screen resolutions.</p> |
| 710 | <div class="standard-rule">✓ Use: 8px, 16px, 24px, 32px, 48px, 64px • Avoid: 13px, 27px, 41px</div> |
| 711 | </div> |
| 712 | |
| 713 | <div class="spacing-demo"> |
| 714 | <div class="spacing-box">Element 1</div> |
| 715 | <div class="spacing-indicator"> |
| 716 | <div class="spacing-label">32px (4 × 8px)</div> |
| 717 | </div> |
| 718 | <div class="spacing-box">Element 2</div> |
| 719 | <div class="spacing-indicator"> |
| 720 | <div class="spacing-label">24px (3 × 8px)</div> |
| 721 | </div> |
| 722 | <div class="spacing-box">Element 3</div> |
| 723 | </div> |
| 724 | |
| 725 | <div style="margin-top: 24px; padding: 16px; background: #fef3c7; border-radius: 8px; font-size: 14px;"> |
| 726 | <strong>Spacing Scale:</strong> 8px (small) • 16px (medium) • 24px (large) • 32px (cards) • 48px (sections mobile) • 64px (sections desktop) |
| 727 | </div> |
| 728 | </div> |
| 729 | </div> |
| 730 | </div> |
| 731 | |
| 732 | <!-- FORM STANDARDS --> |
| 733 | <div class="section"> |
| 734 | <div class="container"> |
| 735 | <div class="section-header"> |
| 736 | <div class="section-eyebrow">Forms</div> |
| 737 | <h2>Form Best Practices</h2> |
| 738 | <p class="section-description">Make forms easy to complete. Every friction point = lost conversions.</p> |
| 739 | </div> |
| 740 | |
| 741 | <div class="standard"> |
| 742 | <div class="standard-header"> |
| 743 | <h3 class="standard-title">Labels Above Inputs</h3> |
| 744 | <p class="standard-why"><strong>Why:</strong> Faster to scan, works for long labels, mobile-friendly. Users complete forms 30% faster.</p> |
| 745 | <div class="standard-rule">✓ Stacked layout • 56px input height (mobile) • 16px font size minimum</div> |
| 746 | </div> |
| 747 | |
| 748 | <div class="example-container"> |
| 749 | <div class="example"> |
| 750 | <div class="example-label good">Good Example</div> |
| 751 | <div class="example-content"> |
| 752 | <form class="form-demo"> |
| 753 | <div class="form-group"> |
| 754 | <label class="form-label">Email address</label> |
| 755 | <input type="email" class="form-input" placeholder="you@example.com"> |
| 756 | </div> |
| 757 | <div class="form-group"> |
| 758 | <label class="form-label">Password</label> |
| 759 | <input type="password" class="form-input" placeholder="••••••••"> |
| 760 | </div> |
| 761 | <button type="submit" class="form-button">Sign In</button> |
| 762 | </form> |
| 763 | </div> |
| 764 | </div> |
| 765 | |
| 766 | <div class="example"> |
| 767 | <div class="example-label bad">Bad Example</div> |
| 768 | <div class="example-content"> |
| 769 | <div style="padding: 24px; font-size: 14px; color: #ef4444;"> |
| 770 | <p><strong>❌ Common Mistakes:</strong></p> |
| 771 | <ul style="margin-left: 20px; margin-top: 12px; line-height: 1.8;"> |
| 772 | <li>Placeholder-only labels (disappear when typing)</li> |
| 773 | <li>Labels inside inputs (confusing)</li> |
| 774 | <li>Tiny inputs <44px height (hard to tap)</li> |
| 775 | <li>Font size <16px (iOS zooms in)</li> |
| 776 | <li>Poor error messaging (no inline hints)</li> |
| 777 | </ul> |
| 778 | </div> |
| 779 | </div> |
| 780 | </div> |
| 781 | </div> |
| 782 | </div> |
| 783 | </div> |
| 784 | </div> |
| 785 | |
| 786 | <!-- APPLICATION TYPES --> |
| 787 | <div class="section"> |
| 788 | <div class="container"> |
| 789 | <div class="section-header"> |
| 790 | <div class="section-eyebrow">Application Types</div> |
| 791 | <h2>Know What You're Building</h2> |
| 792 | <p class="section-description">Not all applications are the same. Standards adapt to context and user goals.</p> |
| 793 | </div> |
| 794 | |
| 795 | <div class="app-type-grid"> |
| 796 | <div class="app-type-card"> |
| 797 | <div class="app-type-icon">📄</div> |
| 798 | <h3 class="app-type-title">Brochure/Marketing</h3> |
| 799 | <div class="app-type-goal">Goal: Convert visitors</div> |
| 800 | <ul class="app-type-list"> |
| 801 | <li><strong>Density:</strong> Low (airy, whitespace)</li> |
| 802 | <li><strong>Spacing:</strong> 64-96px sections</li> |
| 803 | <li><strong>Navigation:</strong> Simple top bar</li> |
| 804 | <li><strong>Interaction:</strong> Scroll + Click</li> |
| 805 | <li><strong>Examples:</strong> Landing pages, portfolios</li> |
| 806 | </ul> |
| 807 | </div> |
| 808 | |
| 809 | <div class="app-type-card"> |
| 810 | <div class="app-type-icon">📊</div> |
| 811 | <h3 class="app-type-title">App/Dashboard</h3> |
| 812 | <div class="app-type-goal">Goal: Complete tasks efficiently</div> |
| 813 | <ul class="app-type-list"> |
| 814 | <li><strong>Density:</strong> High (dense, data-rich)</li> |
| 815 | <li><strong>Spacing:</strong> 24-32px sections</li> |
| 816 | <li><strong>Navigation:</strong> Persistent sidebar</li> |
| 817 | <li><strong>Interaction:</strong> Keyboard + Click</li> |
| 818 | <li><strong>Examples:</strong> Dashboards, SaaS apps</li> |
| 819 | </ul> |
| 820 | </div> |
| 821 | |
| 822 | <div class="app-type-card"> |
| 823 | <div class="app-type-icon">📱</div> |
| 824 | <h3 class="app-type-title">Social/Content</h3> |
| 825 | <div class="app-type-goal">Goal: Engage users, time on site</div> |
| 826 | <ul class="app-type-list"> |
| 827 | <li><strong>Density:</strong> Medium</li> |
| 828 | <li><strong>Spacing:</strong> 16-24px posts</li> |
| 829 | <li><strong>Navigation:</strong> Sticky top bar</li> |
| 830 | <li><strong>Interaction:</strong> Scroll + React</li> |
| 831 | <li><strong>Examples:</strong> Social media, blogs, forums</li> |
| 832 | </ul> |
| 833 | </div> |
| 834 | </div> |
| 835 | |
| 836 | <div style="margin-top: 48px; padding: 32px; background: white; border-radius: 12px; border: 2px solid #7C3AED; text-align: center;"> |
| 837 | <p style="font-size: 18px; color: #111827; margin-bottom: 12px;"> |
| 838 | <strong>Each type has different standards.</strong> |
| 839 | </p> |
| 840 | <p style="font-size: 16px; color: #6b7280;"> |
| 841 | A marketing site needs big hero sections and CTAs. A dashboard needs dense data and keyboard shortcuts. Social needs infinite scroll and reactions. Use the RIGHT standards for your context. |
| 842 | </p> |
| 843 | </div> |
| 844 | </div> |
| 845 | </div> |
| 846 | |
| 847 | <!-- FOOTER --> |
| 848 | <div class="footer"> |
| 849 | <div class="container"> |
| 850 | <h3 style="font-size: 24px; margin-bottom: 16px; margin-top: 0; color: white;">Using These Standards</h3> |
| 851 | |
| 852 | <h4 style="font-size: 18px; margin-top: 24px; margin-bottom: 8px; color: #9ca3af;">For Developers</h4> |
| 853 | <p style="font-size: 14px; opacity: 0.9; line-height: 1.8;"> |
| 854 | Use as a checklist when building interfaces. Each standard includes WHY explanations, good/bad examples, and copy-paste code. |
| 855 | </p> |
| 856 | |
| 857 | <h4 style="font-size: 18px; margin-top: 24px; margin-bottom: 8px; color: #9ca3af;">For AI</h4> |
| 858 | <p style="font-size: 14px; opacity: 0.9; line-height: 1.8;"> |
| 859 | Reference this URL in prompts to generate standards-compliant UIs: |
| 860 | </p> |
| 861 | <pre style="background: rgba(0, 0, 0, 0.3); padding: 16px; border-radius: 6px; margin: 12px 0; overflow-x: auto; color: #e5e7eb; font-size: 13px;">Build a login form following dbbasic.com/standards: |
| 862 | - Touch targets: 44×44px minimum (mobile) |
| 863 | - Forms: Labels above inputs |
| 864 | - Buttons: Primary action bottom-right |
| 865 | - Spacing: 8px base unit system</pre> |
| 866 | |
| 867 | <h4 style="font-size: 18px; margin-top: 24px; margin-bottom: 8px; color: #9ca3af;">For Designers</h4> |
| 868 | <p style="font-size: 14px; opacity: 0.9; line-height: 1.8;"> |
| 869 | Use as a design system foundation. All rules are research-backed and include accessibility requirements (WCAG AA/AAA). |
| 870 | </p> |
| 871 | |
| 872 | <h3 style="font-size: 24px; margin-bottom: 16px; margin-top: 40px; color: white;">Version History</h3> |
| 873 | <ul style="list-style: none; padding: 0;"> |
| 874 | <li style="padding: 8px 0; opacity: 0.9;"> |
| 875 | <strong>v1.0</strong> (2025-01-16) - Initial release with 5 core standards: Navigation, Touch Targets, Spacing, Forms, App Types |
| 876 | </li> |
| 877 | </ul> |
| 878 | |
| 879 | <h3 style="font-size: 24px; margin-bottom: 16px; margin-top: 40px; color: white;">Contributing</h3> |
| 880 | <p style="font-size: 14px; opacity: 0.9;"> |
| 881 | Found an issue? Have a suggestion? Visit <a href="https://github.com/askrobots/dbbasic-web-native" style="color: #7C3AED;">GitHub repository</a> |
| 882 | </p> |
| 883 | |
| 884 | <div style="margin-top: 40px; padding-top: 40px; border-top: 1px solid #374151; font-size: 14px; color: #9ca3af; text-align: center;"> |
| 885 | DBBasic Usability Standards v1.0<br> |
| 886 | Created by Dan Quellhorst • <a href="https://dbbasic.com" style="color: #7C3AED; text-decoration: none;">dbbasic.com</a><br> |
| 887 | MIT License • Free for commercial and personal use |
| 888 | </div> |
| 889 | </div> |
| 890 | </div> |
| 891 | </body> |
| 892 | </html> |