31
loading...
This website collects cookies to deliver better user experience
Just finished rebuilding https://t.co/UcT54hdIY5 with @astrodotbuild
Progressively enhanced with @sveltejs and clocking in at a whopping 12.5KB of total JS. Really digging how easy its becoming to build tiny sites these days
slide
transition to nicely animate the menu in and out.<Component:load />
<Component:idle />
<Component:visible />
:load
onto the component and it will be loaded on the client when the page loads.:idle
instead will tell Astro to wait for the browser to initially load the page and go idle before pulling down the component, boosting performance on initial load.:visible
will take advantage of the IntersectionObserver API to only load the component if a user scrolls down to it. This might be useful for a contact form at the bottom of a marketing page where you need custom JS validation logic but don't want to risk any performance hiccups when every conversion matters.<Component:media ="(min-width: 40em)"></Component:media>
:idle
to allow our whole page to load before enhancing the menu, but on desktop that menu is never even used. With :media
or similar we could make sure that the menu's JS is only loaded on mobile viewports, why even both loading it?31