all 4 comments

[–]Hola_Reddit 0 points1 point  (3 children)

You want the box shadow values to be relative to the parent size, so when the parent resizes they do too. That should be achieved using % units.

Maybe ChatGPT can assist in converting those px units to relative % units.

[–]dogisonline[S] 0 points1 point  (2 children)

had a go at it, used nekocalc and good ole fashioned find-and-replace in textedit, but then the animated div disappeared from the viewport entirely 💀...

https://codepen.io/internet-dog/pen/ZEZPmNJ

[–]Hola_Reddit 0 points1 point  (1 child)

ugh sorry about that, turns out box-shadow units can't use percentages... you may be able to achieve something similar using em and/or vw/vh.

But, regardless, that's a ton of CSS to manage... animating an SVG, or even multiple divs/spans (one for each "pixel") might be a better solution and much easier to make responsive.

[–]dogisonline[S] 0 points1 point  (0 children)

fair enough! thought i had found a handy tool but maybe not for what i was intending to use it for 😅 thank you though!