Scott Jehl on Nostr: Been a while since I wrote this up but I still love that you can dynamically toggle a ...
Been a while since I wrote this up but I still love that you can dynamically toggle a "sizes" attribute from say, 100vw to 200vw to cause the browser to select an contextually-appropriate, higher resolution source from its "srcset" list. It's such a cheap way to drive a "zoom" feature for product images, and it actually surprised me when it worked at the time. Responsive Image standards are good.
https://www.filamentgroup.com/lab/sizes-swap/Published at
2024-05-10 16:34:27Event JSON
{
"id": "5ae126234271fe0df94f96a337fa7614ea89759d436acdcb26a8f58c1a193a42",
"pubkey": "b366513fe344d7bcd092cb92e8dbb8f07ef6321dbdf1a05fd3439b0ba381c150",
"created_at": 1715358867,
"kind": 1,
"tags": [
[
"proxy",
"https://mstdn.social/users/scottjehl/statuses/112417758737095180",
"activitypub"
]
],
"content": "Been a while since I wrote this up but I still love that you can dynamically toggle a \"sizes\" attribute from say, 100vw to 200vw to cause the browser to select an contextually-appropriate, higher resolution source from its \"srcset\" list. It's such a cheap way to drive a \"zoom\" feature for product images, and it actually surprised me when it worked at the time. Responsive Image standards are good.\nhttps://www.filamentgroup.com/lab/sizes-swap/",
"sig": "3f52f2670d54da88c17ad747c356679515e5214ce0ac9f8064d846447be13c7185e0f8b84e946f98f9dcf0f01b1f65709183652cdb61bbb107f7d053e29771ad"
}