Live data from Hacker News

Show HN: Zany – Favicon API

zany.sh

1–10 of 12 posts

Re: Show HN: Zany – Favicon API

#5
You can make folks test it in their browsers by instructing them to copy and paste dataURI into their URL bar, like:

    data:text/html,
This one for example shows nearly invisible text in dark theme for me.

Or maybe add text input to dynamically update current page's favicon to see the outcome instantly.

Re: Show HN: Zany – Favicon API

#8
post #5

You can make folks test it in their browsers by instructing them to copy and paste dataURI into their URL bar, like: data:text/html, This one for example shows nearly invisible text in dark theme for me. Or maybe add text input to dynamically update current page's favicon to see the outcome instantly.

this is a great idea, going to update the docs. also, regarding dark themes, you can control the text/background color via query params:

    

Re: Show HN: Zany – Favicon API

#10
post #7

Or you can get a emoji as favicon with: http://www.w3.org/2000/svg%22 viewBox=%220 0 100 100%22> FAVORITE EMOJI HERE ">

Yup. My last "golfing" take was to use default font-size and fit viewBox accordingly:

    data:text/html;charset=utf-8,%F0%9F%A6%84'>
But haven't tested outside Windows, so it will be most probably off in some browsers (Safari?).

Or this funky quine document with same unicorn emoji that rotates or fades depending on prefers-reduced-motion:

    data:text/html;charset=utf-8,%0A%F0%9F%A6%84@keyframes x{to{transform:rotate(1turn)}}@keyframes y{to{opacity:0}}text{animation:2s x infinite alternate}@media(prefers-reduced-motion){text{animation-name:y}}'>%0AAnimated favicon affected by `prefers-reduced-motion` media query, embedded in datauri inside datauri document%0A:not(style,script){display:block; padding:0 .2em; background:darkslategray; color:snow; white-space:pre-wrap} title::after{content:' (in `' var(--prm) '` mode)'}html{--prm:'no-preference'}@media(prefers-reduced-motion:reduce){html{--prm:'reduce'}}%0Adocument.write('',decodeURIComponent(document.URL))
Post reply on HN