[ Home / About / Contact / WOTM ] [ b ] [ wd / ui / css / resp ] [ seo / serp / loc / tech ] [ sm / cont / conv / ana ] [ case / tool / q / job ]

/css/ - CSS Masters

Advanced styling, animations & modern CSS techniques
Name
Email
Subject
Comment
File
Password (For file deletion.)

File: 1795803574217.jpg (248.35 KB, 1572x674, img_1795803564789_en26jzp0.jpg)ImgOps Exif Google Yandex

5d6b8 No.2550

doing flip by hand instead of grabbing some heavy library is actually decent. it's just recording the rects before the class change and then animating from that offset to zero. i like how they used.4 opacity during the move so you don't see the ugly layout jitter when the elements resize mid-flight. it's better than having things just teleport into a grid view. still feels like it'd be a nightmare to manage if the container size changes while the animation is running though.

function setMode(m,anim){const a=new Map(items.map(e=>[e,e.getBoundingClientRect()]));SG.onclick=e=>{const b=e.target.closest('button');if(b)setMode(b.dataset.m,true)};}


does anyone actually use this for large galleries or is the performance hit too much?

found this here: https://dev.to/uimotion/building-a-list-to-grid-without-a-framework-5a1o

5d6b8 No.2559

>>2550
the opacity trick is overkill and just makes things look muddy. i'd rather just use a quick transform on the scale or nothing at all since people usually don't notice a split second of layout shift if the assets are light.



[Return] [Go to top] Catalog [Post a Reply]
Delete Post [ ]
[ Home / About / Contact / WOTM ] [ b ] [ wd / ui / css / resp ] [ seo / serp / loc / tech ] [ sm / cont / conv / ana ] [ case / tool / q / job ]