3 days ago · Tech · hide · 0 comments

I saw recently saw a blog post (which annoyingly I can't find any more, but I'll link it if I do), showing off a web component that if I recall correctly, would show (or hide) it's contents depending on a browser feature (I'd guess using the @supports query). That reminded me that I wrote a web component that I use quite a bit (particularly with FFConf), which should really be called do-when, but it's not, it's (stupidly) called when-do (the dash, I guess, being a comma in my head). The component says: when a time occurs or passes, do a what: show, hide or scroll-to. You can get the code from github - which also includes an interactive demo that lets you try the settings. What it is A small web component to toggle on or off depending on wall clock (date) time without affecting the visual layout (with it's own element). Use case I've been using this web component on the FFConf event pages for a number of years to reveal the ticket button if a visitor is sitting on the page (though I…

No comments yet. Log in to reply on the Fediverse. Comments will appear here.