[VOATDEV?] Favicons #2
2 22 Sep 2016 23:18 by u/netk6
Hello everyone,
I've posted recently on the topic of favicons. Here's the second round!
First of all, check this before/after picture of a random section of voat:
[1320×610] http://favicon.netk6.com/voat.png
If you would like to try it yourself, follow the instructions here.
It's a JavaScript bookmark that adds the linked website's favicon next to each submission:
var n, i, a, d, l;
n = document.querySelectorAll('div.entry p.title span.domain a');
for (i = 0; i < n.length; ++i)
{
a = n[i];
if (1 !== a.childNodes.length) continue;
d = a.textContent;
if ('v/' === d.substr(0, 2)) d = 'voat.co';
l = a.lastChild;
a.insertBefore(new Image(16, 16), l).src = 'http://favicon.netk6.com/16/'+d;
a.insertBefore(document.createTextNode(' '), l);
}
void(0);
Here are a few other examples of link decorations:
http://favicon.netk6.com/decorations.html
There are now more than 12 million favicons available.
| W×H | Path | Total icons | Total size |
|---|---|---|---|
| 16×16 | 16/ | 5,639,587 | 1.9GB |
| 24×24 | 24/ | 2,693,641 | 1.7GB |
| 32×32 | 32/ | 2,627,080 | 1.6GB |
| 64×64 | 64/ | 902,051 | 1.3GB |
| 128×128 | 128/ | 462,719 | 1.6GB |
By the way, I'm looking for cool ideas for a short domain name related to favicons, e.g. favi.co, but that one's already taken, obviously.
After that, it's getting upgraded to HTTPS.
And eventually, I will ask Atko in /v/voatdev if he would like to implement it on the server side. The required modifications should be minimal, as the domain name is already available next to each submission.
Thoughts? Questions? Suggestions? Bugs to report?
I'm all ears!
2 comments
1 u/J_Darnley 23 Sep 2016 00:08
I don't have much of an opinion other than: why are websites serving 128px icons? What a waste.
0 u/netk6 [OP] 23 Sep 2016 00:20
Unfortunately, yes.
Some websites link the favicon from the HTML and use the largest icon they have, e.g:
If I don't find an exact 128×128 version of the favicon, I downsize the one that is just a bit larger.
Ultimately, I will downsize that 152×152 version if I don't find a 16×16 one.
On the other hand, some websites do it the right way, serving a <1KB favicon containing layers from 256×256 to 16×16, in 2, 4, or 8 bit per color version. Impressive.