Fork me on GitHub
#re-frame
<
2020-09-11
>
escherize19:09:40

Anyone doing any weird styling dynamic using reagent? I setup some dynamic shadows for fun lately

escherize19:09:07

Well I calculate the angle and distance of say the mouse cursor to a div, and use that info to set the :box-shadow property

escherize19:09:37

It really works great for making my computer's fans turn on

😊 3
phronmophobic19:09:13

that doesn't seem like it should consume too much cpu

dpsutton19:09:47

i'd be interested to compare to a vanilla js react with hooks version. i suspect immutability and the wrappers add some significant overhead

escherize19:09:20

Yeah I guess it's not actually so bad. Just seems intuitively like something a shader could do better. Anyways you can see an example of the dynamic shadows here: https://escherize.com/#/post/neumorph

escherize19:09:45

I dont think that works on mobile, at least there's no pointer to move around

lilactown19:09:13

you might want to debounce the mouse-move event