Zach Leatherman 5959 replies 6565 likes3636 reposts Original on MastodonOriginal on BlueskyAlso posted to Mastodon.
59 replies
@zachleat Can you make a <snow-shovel> component next?
@knowler .remove() 😈
@zachleat @knowler a classic Mac screensaver from the ’90s, from the same set as the venerable flying toasters! I grew up on this stuff 🤓 https://en.wikipedia.org/wiki/After_Dark_(software)
@zachleat small plea - maybe also host the JS? i hate to npm install anything on a simple web project that doesn't need node_modules, know what i mean?
@raymondcamden do you mean like start my own web components CDN? 😅
@zachleat heh, that's overkill probably. just in general it feels like we should avoid needing to use npm to install simple stuff. wouldnt you agree?
@raymondcamden ah yeah, for sure! I’m just confused as to the question—it doesn’t have any dependencies, so it doesn’t “require” `npm` at all.
Probably reusing this copy would have been better: https://github.com/zachleat/table-saw#installation
@zachleat i was overthinking it honestly - you link to the source on top - id just download from there if i wanted to skip npm. sorry :>
@raymondcamden ah no worries! I think it’s fine to call it out—I just got lazy on the README 😅
@zachleat ... a developer... being lazy..... UNHEARD OF!
@raymondcamden @zachleat Little tip: you can use esm.sh for code on GitHub. Versioning is ultimately commit based, but you can use tags too. I usually include the `?raw` param so it doesn’t do any of its bundling. Example:
@zachleat
Thank you Zach! Had to make a small css change on the background so you can see the snowflakes but now http://www.simoncox.com is decorated for Christmas!@simoncox ah do you mean to your web site’s background or to <snow-fall>? Looks great!
@zachleat Why doesn't your website follow my dark mode user preferences so I can see even more of this snow!?!?
Also, feature request 😉, can you add a `pile` attribute that causes the snow to pile up from the bottom of the element to which it applies? Sort of a timer after which a user should return to eating cookie and sipping hot chocolate by the fire... ☕ 🍪 🔥 🎅
@westbrook PRs welcome 😈😈😈 (not for dark mode 😅)
-
@westbrook for sure and I may add one at some point but only when I want to 😅
-
-
@miguel thanks!
@zachleat ayyyy https://bw.omg.lol/
@bw awesome!
@zachleat Fwiw, thanks for using the shadow DOM here, perfect use case for it 👌
(been wanting to try and make a PR to do the same for @stefan's sparkly-text https://www.stefanjudis.com/blog/a-web-component-to-make-your-text-sparkle/, haven't taken the time yet)
@zachleat @stefan Fwiw, here it is (sparkly-text with Shadow DOM)
https://codepen.io/tbroyer/pen/abXgYEy
It won't work in Safari < 16.4 due to lack of support for constructible stylesheet (I used the same detection code as Zach) but that can be worked around if needed by adding a <style> element in the shadow DOM.
BTW, things could be optimized too (create CSSStyleSheet once only, clone the sparkle rather than innerHTML every single time)(I also added the CSS pointer-events like in Zach's snow-fall)
A few folks have already added this to their web site! 🏆
1️⃣ @simoncox’s http://www.simoncox.com/
2️⃣ @bw’s https://bw.omg.lol/
3️⃣ @jhofker’s https://jordan.hofker.org/
4️⃣ https://ndyg.omg.lol/Quick work!
@zachleat and another! https://ndyg.omg.lol/
Tickled to see so many folks adding this—y’all make building for the web fun! ❤️
@zachleat More to come!
@zachleat @simoncox @bw @jhofker And this one… https://www.bobmonsour.com/
@zachleat Hey nice!
Looks great on my dark mode and even in light mode when there's an image or code block🤘 like https://tbeseda.com/blog/super-helpful-server-timing-http-response-headersI combined it with `const isWinter = [10, 11, 0, 1].includes(new Date().getMonth())` - bc I will probably forget I added it and don't want it snowing in July!
@zachleat Easy-peasy to get added. Cool! https://jordan.hofker.org/
@jhofker yay!
-
@zachleat Oooo, this is fun! It's awesome that you can set the snow color through a CSS variable. I gave this a go on my site locally, passing in the selected theme color 👀
@hexagoncircle ooooh that’s beautiful
@zachleat Thank you for this! It’s 45° F and there’s no snow here in Vermont, but at least our website has snow now.
@srwild yay! is it live somewhere?
@zachleat It is! Just pushed it live. https://bluehouse.group/
@zachleat I haven’t seen it mentioned before but one of my favourite things about the proliferation of web components on blogs is that the component behaviour/styling makes it into otherwise user-styles-only contexts—like RSS readers
@charlesharries that seems like a security problem 😅
@zachleat yes but it’s a very pretty security problem!
@charlesharries XSSnow is worth it!
<xss-nowfall>