Skip to content

Commit 4971fe8

Browse files
committed
Compress videos and loop them
1 parent 3756bd1 commit 4971fe8

File tree

4 files changed

+3
-3
lines changed

4 files changed

+3
-3
lines changed
Binary file not shown.
Binary file not shown.

src/pages/blog/2022-12-14-protocol-api-documentation-template/index.mdx

+3-3
Original file line numberDiff line numberDiff line change
@@ -37,21 +37,21 @@ We've got sticky code blocks that stay in view as you scroll through the request
3737

3838
<div className="relative rounded-lg overflow-hidden">
3939
<div className="absolute inset-0 rounded-lg ring-1 ring-inset ring-slate-900/10 pointer-events-none"></div>
40-
<video src={stickyCodeBlocks} controls className="block m-0" />
40+
<video src={stickyCodeBlocks} autoPlay playsInline loop muted className="block m-0" />
4141
</div>
4242

4343
There's also this beautiful hover effect on the homepage cards — it follows your mouse cursor with this gradient glow that uncovers a subtle background pattern:
4444

4545
<div className="relative rounded-lg overflow-hidden">
4646
<div className="absolute inset-0 rounded-lg ring-1 ring-inset ring-slate-900/10 pointer-events-none"></div>
47-
<video src={hoveringCards} controls className="block m-0" />
47+
<video src={hoveringCards} autoPlay playsInline loop muted className="block m-0" />
4848
</div>
4949

5050
My favorite detail though has to be the sidebar navigation, which tracks the visible page content but using a sort of "minimap" strategy, where _all_ visible page sections are highlighted:
5151

5252
<div className="relative rounded-lg overflow-hidden">
5353
<div className="absolute inset-0 rounded-lg ring-1 ring-inset ring-slate-900/10 pointer-events-none"></div>
54-
<video src={animatedSidebar} controls className="block m-0" />
54+
<video src={animatedSidebar} autoPlay playsInline loop muted className="block m-0" />
5555
</div>
5656

5757
Watching this animate as you scroll through the page is really a sight to behold — props to [Framer Motion](https://www.framer.com/motion/) for doing the heavy lifting here as usual. Even if I absolutely hated React I'm pretty sure I'd still use it just to use this library, it's really that good.

0 commit comments

Comments
 (0)