|
132 | 132 | display: block; |
133 | 133 | } |
134 | 134 |
|
| 135 | + :target { |
| 136 | + background-color: #ffc; |
| 137 | + outline: 10px solid #ffc; |
| 138 | + scroll-margin-top: 1.5rem; |
| 139 | + } |
| 140 | + |
135 | 141 | .c-snippet { |
136 | 142 | display: block; |
137 | 143 | background-color: #002a35; |
@@ -285,6 +291,9 @@ <h2><code>window.obs</code></h2> |
285 | 291 |
|
286 | 292 | <pre id=obs aria-live=polite></pre> |
287 | 293 |
|
| 294 | + <p><small><strong>Note:</strong> API support varies by browser; Chromium has |
| 295 | + the broadest coverage.</small></p> |
| 296 | + |
288 | 297 | <h2><code><video></code> Demo</h2> |
289 | 298 |
|
290 | 299 | <p>If your connection allows it, you should see a small video below. If not, |
@@ -340,9 +349,6 @@ <h2><code><video></code> Demo</h2> |
340 | 349 | })(); |
341 | 350 | </script> |
342 | 351 |
|
343 | | - <p><small><strong>Note:</strong> API support varies by browser; Chromium has |
344 | | - the broadest coverage.</small></p> |
345 | | - |
346 | 352 | <script> |
347 | 353 | // Render helpers |
348 | 354 | const byId = id => document.getElementById(id); |
@@ -461,6 +467,78 @@ <h2><code><video></code> Demo</h2> |
461 | 467 | setTimeout(renderAll, 0); |
462 | 468 | </script> |
463 | 469 |
|
| 470 | + |
| 471 | + |
| 472 | + |
| 473 | + |
| 474 | + <h2 id=showcase>Showcase</h2> |
| 475 | + |
| 476 | + <p>These fine folk are using Obs.js:</p> |
| 477 | + |
| 478 | + <style> |
| 479 | + |
| 480 | + .c-showcase { |
| 481 | + margin-left: 0; |
| 482 | + list-style: none; |
| 483 | + |
| 484 | + dt { |
| 485 | + font-weight: bold; |
| 486 | + |
| 487 | + &::after { |
| 488 | + content: ":"; |
| 489 | + } |
| 490 | + |
| 491 | + } |
| 492 | + |
| 493 | + dd { |
| 494 | + margin-left: 1.5rem; |
| 495 | + } |
| 496 | + |
| 497 | + } |
| 498 | + |
| 499 | + </style> |
| 500 | + |
| 501 | + <ul class=c-showcase id=jsShowcase> |
| 502 | + |
| 503 | + <li> |
| 504 | + <img src=./assets/showcase/csswizardry.com.png alt="csswizardry.com homepage screenshot" width=1000 height=594 loading=lazy> |
| 505 | + <dl> |
| 506 | + <dt>Site</dt> |
| 507 | + <dd><a href=https://csswizardry.com>csswizardry.com</a></dd> |
| 508 | + <dt>Usage</dt> |
| 509 | + <dd>Deliver low-resolution hero images on constrained networks; disable |
| 510 | + transitions and animations on low battery mode.</dd> |
| 511 | + </dl> |
| 512 | + </li> |
| 513 | + |
| 514 | + </ul> |
| 515 | + |
| 516 | + <script> |
| 517 | + (() => { |
| 518 | + // Shuffle the Showcase so there’s no preferential treatment. |
| 519 | + const showcase = document.querySelector('#jsShowcase'); |
| 520 | + const items = [...showcase.querySelectorAll('li')]; |
| 521 | + |
| 522 | + // Bail out if there is nothing to shuffle. |
| 523 | + if (items.length === 1) { |
| 524 | + return; |
| 525 | + } else{ |
| 526 | + |
| 527 | + for (let i = items.length - 1; i > 0; i--) { |
| 528 | + const j = Math.floor(Math.random() * (i + 1)); |
| 529 | + [items[i], items[j]] = [items[j], items[i]]; |
| 530 | + } |
| 531 | + |
| 532 | + } |
| 533 | + |
| 534 | + showcase.append(...items); |
| 535 | + })(); |
| 536 | + </script> |
| 537 | + |
| 538 | + |
| 539 | + |
| 540 | + |
| 541 | + |
464 | 542 | <script type=module> |
465 | 543 | (() => { |
466 | 544 | // Bail out if SpeedCurve is not available. |
|
0 commit comments