Cool project and thanks for explaining it in the FAQ.
The best part about these projects in not seeing the demo but rather learning the clever hacks that make the things tick (no pun).
Reminds me of a video on Vue mastery in which Evan you created a mini vuejs in like 10 mins. Its one thing to use or see something, something totally another to see how it does what it does behind the scenes.
The file itself is beautiful and makes me want to put in my pocket and carry around. Hope there's more single beautiful files in the world, reminds me of the single header culture in C where every person can have their own nice little .h file that belongs to themselves.
In a similar vein (but much less techinically sophistcated), I recently realized that making "cloze" cards (esp. ones w/ a large number of deletions and/or incremental-reveal cards) in Anki can be made a much less painful process by ditching the native method in favor of an almost entirely CSS implementation (basically, you use Anki's editor to underline the cloze deletions, use a line of JS to add innerText as an attribute to the element, and use CSS to make each answer appear in a little pop-up as you hover over (or touch, if on mobile) a blank. An example: https://streamable.com/xwewa4).
What impresses me is that this digital clock works just fine in Internet Explorer 11 from 2013, and even works in IE10 from 2012 (doesn’t work in IE9, but, then again, not even text-shadow works in IE9). It doesn’t use any modern CSS, but stuff which has been implemented by browsers since 2012.
One step toward that might be to enable a "fast forward" and "rewind" functionality, as are common on alarm clocks. Then at least you could set it to your current time.
Every time I see one of these demos showcasing the constraints they used, it always seems to remind me why nobody does that.
And its not because of the challenge, its because of the result. Which makes me more surprised that other people's activity puts this stuff on my feeds at all.
Kind of cool.. There is something funny happening when using the Dark Reader chrome extension.. imgbox.com/y62Z4gVm
Ironically enough, the css goes a bit mad.
Not really, it's just a bunch of boxes with borders, and each box has an animation saying when each border is white or black.
The only notable technological "gimmick" is that it doesn't use any more HTML elements than the ones the browser generates automatically from the "severely malformed" HTML it is given.
(Not to devalue the creativity of the demo, though!)
A possibly more elegant way to do this would be by using clip-path and CSS variables to render the digits, this would only require 1 element per digit and would make for more readable animations too.
var d = new Date();
document.documentElement.style.setProperty("--delay",
-(d.getHours() * 3600 +
d.getMinutes() * 60 +
d.getSeconds() +
d.getMilliseconds() / 1000
) + "s");
I think this would do it. It roughly matches what I did a few years back for an analogue CSS-only (except for this) clock.
However, this does still have a weakness: if the browser is suspended (e.g. machine in standby) it gets out of sync. It doesn’t care about leap seconds, either. You could fix these things by triggering this position update every so often, but that would be missing the point of it.
[+] [-] anonymousiam|5 years ago|reply
[+] [-] dheera|5 years ago|reply
Of course it might drift over time, but you could also serve up a refresh header to deal with that every hour or so.
[+] [-] reaperducer|5 years ago|reply
I think it's a generational Easter egg that he went with "microwaves" instead of "VCRs" or even "clock radios."
[+] [-] nkozyra|5 years ago|reply
[+] [-] schwartzworld|5 years ago|reply
[+] [-] ghoomketu|5 years ago|reply
The best part about these projects in not seeing the demo but rather learning the clever hacks that make the things tick (no pun).
Reminds me of a video on Vue mastery in which Evan you created a mini vuejs in like 10 mins. Its one thing to use or see something, something totally another to see how it does what it does behind the scenes.
[+] [-] Something1234|5 years ago|reply
[+] [-] slmjkdbtl|5 years ago|reply
[+] [-] t0astbread|5 years ago|reply
[+] [-] IceWreck|5 years ago|reply
[+] [-] athriren|5 years ago|reply
[+] [-] RaoulP|5 years ago|reply
[+] [-] porpoise|5 years ago|reply
In a similar vein (but much less techinically sophistcated), I recently realized that making "cloze" cards (esp. ones w/ a large number of deletions and/or incremental-reveal cards) in Anki can be made a much less painful process by ditching the native method in favor of an almost entirely CSS implementation (basically, you use Anki's editor to underline the cloze deletions, use a line of JS to add innerText as an attribute to the element, and use CSS to make each answer appear in a little pop-up as you hover over (or touch, if on mobile) a blank. An example: https://streamable.com/xwewa4).
[+] [-] sam0x17|5 years ago|reply
[+] [-] paco3346|5 years ago|reply
https://imgur.com/a/YShyehD
Note that in chromium there's an implicit style tag that doesn't show up in chrome.
Manually adding
fixes the issue with no ill effects in Chrome.[+] [-] bilekas|5 years ago|reply
[+] [-] leephillips|5 years ago|reply
[+] [-] unknown|5 years ago|reply
[deleted]
[+] [-] butz|5 years ago|reply
[+] [-] amenghra|5 years ago|reply
[+] [-] strenholme|5 years ago|reply
[+] [-] 1_player|5 years ago|reply
CSS hasn't changed much since its inception in 1996, mostly it's added some selector and layout rules in recent years.
[+] [-] brundolf|5 years ago|reply
[+] [-] jawns|5 years ago|reply
[+] [-] vmception|5 years ago|reply
And its not because of the challenge, its because of the result. Which makes me more surprised that other people's activity puts this stuff on my feeds at all.
[+] [-] bilekas|5 years ago|reply
I love those css felx's though this is cool
[+] [-] ybbond|5 years ago|reply
[+] [-] MrTortoise|5 years ago|reply
[+] [-] Nicksil|5 years ago|reply
Except for the HTML
[+] [-] cj|5 years ago|reply
view-source:https://www.quaxio.com/pure_css_digital_clock.css
[+] [-] reaperducer|5 years ago|reply
While technically correct is the best kind of correct, it's worth noting that the entirety of the HTML portion is:
[+] [-] ogre_codes|5 years ago|reply
[+] [-] reaperducer|5 years ago|reply
[+] [-] amenghra|5 years ago|reply
[+] [-] c22|5 years ago|reply
[+] [-] trianglem|5 years ago|reply
[deleted]
[+] [-] kroltan|5 years ago|reply
The only notable technological "gimmick" is that it doesn't use any more HTML elements than the ones the browser generates automatically from the "severely malformed" HTML it is given.
(Not to devalue the creativity of the demo, though!)
A possibly more elegant way to do this would be by using clip-path and CSS variables to render the digits, this would only require 1 element per digit and would make for more readable animations too.
[+] [-] systemvoltage|5 years ago|reply
[+] [-] jhowison|5 years ago|reply
[+] [-] kdps|5 years ago|reply
Q: Swiss made, how so? A: I was born in Switzerland. By induction, this clock is Swiss made. QED.
[+] [-] justusthane|5 years ago|reply
[+] [-] chrismorgan|5 years ago|reply
However, this does still have a weakness: if the browser is suspended (e.g. machine in standby) it gets out of sync. It doesn’t care about leap seconds, either. You could fix these things by triggering this position update every so often, but that would be missing the point of it.