Skip to content

Commit e6a51b6

Browse files
authored
Merge pull request #8 from csswizardry/feature/showcase
Add initial showcase
2 parents cf6a141 + 3c80d62 commit e6a51b6

2 files changed

Lines changed: 81 additions & 3 deletions

File tree

113 KB
Loading

demo/index.html

Lines changed: 81 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,12 @@
132132
display: block;
133133
}
134134

135+
:target {
136+
background-color: #ffc;
137+
outline: 10px solid #ffc;
138+
scroll-margin-top: 1.5rem;
139+
}
140+
135141
.c-snippet {
136142
display: block;
137143
background-color: #002a35;
@@ -285,6 +291,9 @@ <h2><code>window.obs</code></h2>
285291

286292
<pre id=obs aria-live=polite></pre>
287293

294+
<p><small><strong>Note:</strong> API support varies by browser; Chromium has
295+
the broadest coverage.</small></p>
296+
288297
<h2><code>&lt;video&gt;</code> Demo</h2>
289298

290299
<p>If your connection allows it, you should see a small video below. If not,
@@ -340,9 +349,6 @@ <h2><code>&lt;video&gt;</code> Demo</h2>
340349
})();
341350
</script>
342351

343-
<p><small><strong>Note:</strong> API support varies by browser; Chromium has
344-
the broadest coverage.</small></p>
345-
346352
<script>
347353
// Render helpers
348354
const byId = id => document.getElementById(id);
@@ -461,6 +467,78 @@ <h2><code>&lt;video&gt;</code> Demo</h2>
461467
setTimeout(renderAll, 0);
462468
</script>
463469

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+
464542
<script type=module>
465543
(() => {
466544
// Bail out if SpeedCurve is not available.

0 commit comments

Comments
 (0)