enkelmedia / TheDashboard

Magic dashboard for Umbraco
MIT License
39 stars 42 forks source link

Retina image of avatars #8

Closed bjarnef closed 9 years ago

bjarnef commented 9 years ago

You can use retina image for the avatars by using srcset attribute. Then the avatars will be sharper on retina screens on tablets and phones.

Actually the natural size requested from Gravatar is 80x80px but css scale it to 55x55px .. so it would be better to request a size on 55x55px and then maybe just use border-radius: 50% for div.logitem img

2x and 3x describe the image for screens with DPR (device-pixel-ratio) on 2 and 3. So these images is just 2 and 3 times the original size. If srcset is not supported it fallback to src attribute, but it is pretty well supported by modern devices both tables and phones.

See this screenshot from my tablet in full size. screenshot_2015-08-15-15-04-42

<img src="http://www.gravatar.com/avatar/8ed42a9b60e5c5e8d3e829c724956698&amp;s=55" srcset="http://www.gravatar.com/avatar/8ed42a9b60e5c5e8d3e829c724956698&amp;s=110 2x, http://www.gravatar.com/avatar/8ed42a9b60e5c5e8d3e829c724956698&amp;s=165 3x">
enkelmedia commented 9 years ago

Sounds like a good idea!