escherize 2020-09-11T19:25:40.006600Z

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

dpsutton 2020-09-11T19:25:57.006800Z

like what?

escherize 2020-09-11T19:27:07.007500Z

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

escherize 2020-09-11T19:27:37.007800Z

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

phronmophobic 2020-09-11T19:31:13.008600Z

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

dpsutton 2020-09-11T19:32:47.009400Z

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

escherize 2020-09-11T19:38:20.010600Z

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:

escherize 2020-09-11T19:38:45.011Z

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

lilactown 2020-09-11T19:56:13.011300Z

you might want to debounce the mouse-move event

lilactown 2020-09-11T19:56:20.011500Z

or throttle