4 ms·
Sure! Here's mine: https://www.justus.ws https://www.justus.ws I've had this one for a couple years now. I've had more polished-looking sites in the past, but
by justusthane 4y ago
Sure! Here's mine: https://www.justus.ws https://www.justus.ws
I've had this one for a couple years now. I've had more polished-looking sites in the past, but this time I wanted to emphasize having fun with it and not being too precious - this allows me to update it without worrying about everything being perfect.
It's a static site built by Eleventy. I edit/build it locally, and then when I push up to Github it's rebuilt there by a Github action. Details here: https://www.justus.ws/how/ https://www.justus.ws/how/
Edit: An interesting tidbit: my avatar in the upper-left corner blinks on a random timer thanks to a very simple bit of JS[0]. However, it exhibits a strange and unexpected behaviour: if you don't interact with the webpage for a while, my avatar "goes to sleep"; e.g. the eyes close until you interact with it again.
I love this, but I don't know why it happens! I get that the browser probably pauses scripts after a time, but why would it always end up with its eyes closed, especially when the eyes are only supposed to close for 150ms at a time?
[0]:
async function blinktimer() {
async function blink() {
var src = $(" .avatar ").attr('src');
console.log("BLINK!");
$(" .avatar ").attr('src','/images/dadi-avatar_blink.png');
await sleep(150);
$(" .avatar ").attr('src',src);
}
while (true) {
var delay = Math.floor((Math.random() * 11000) + 0);
await sleep(delay);
blink();
}
};
- https://www.justus.ws/js/scripts.js https://www.justus.ws/js/scripts.js
- didactickhan 4y agoI found the center font hard to read.
- justusthane 4y agoThanks for the feedback - maybe your browser isn't loading my font? This is what it should look like: https://0x0.st/oR5C.png https://0x0.st/oR5C.png I should specify a better fallback font though. As an aside, for some reason all of your comments are showing up as dead (including a comment you made on another post 29 days ago). I vouched for your two comments here to bring them back. I'm not sure why that is, but you might want to reach out to hn@ycombinator.com
- didactickhan 4y agoThanks! The font looks normal on my tablet.
- spacebuffer 4y agogreat! seems very well made, the active button state reminds me of a guy called bill wurtz [0] [0]: https://www.youtube.com/watch?v=FZUcpVmEHuk https://www.youtube.com/watch?v=FZUcpVmEHuk
- justusthane 4y agoLove it!
- dysoco 4y agoI really like this design!
- emurlin 4y agoI'd guess there's a race condition that causes the eyes to end up closed, because the 'delay' can sometimes be less than 150 and `blink` gets called while it's already executing (so `src` ends up being the blink version). A simple fix would be adding `await` to `blink()` if that's the case! BTW, I made a vanilla JS version for fun, without jQuery or promises (untested) function blinktimer() { var avatar = document.querySelector(" .avatar "); var srcBlink = '/images/dadi-avatar_blink.png'; var blink = function() { console.log("BLINK!"); var srcOpen = avatar.src; avatar.src = srcBlink; setTimeout(function() { avatar.src = srcOpen; var delay = (Math.random() * 11000) | 0; setTimeout(blink, delay); }, 150); } var delay = (Math.random() * 11000) | 0; setTimeout(blink, delay); }
- justusthane 4y agoAh! That makes sense, thank you! I'd say it's more of an unintended feature than a bug :)