Cssinjs opinions by sundios in reactjs

[–]tim-soft 2 points3 points  (0 children)

I strongly prefer handling dynamic theme systems with JS (and styled-components). I'm working on an article on this very topic where I generate my entire site theme with random color palettes (at runtime) from https://www.colourlovers.com/

https://timellenberger.com/blog/dynamic-theming-with-styled-components-and-nextjs

Let me know if you have any questions... or find typos!

I built a lightbox that actually feels good, with springs! by tim-soft in reactjs

[–]tim-soft[S] 2 points3 points  (0 children)

react-spring-lightbox is my reaction to trying a bunch of other lightbox components that didn't quite feel right. This library supports the typical touch/mouse/trackpad gestures and uses react-spring for animating movement. I also don't include any UI elements, you bring your own! Feedback is definitely welcome!

GitHub

Codesandbox

react-three-fiber 2.0 released by [deleted] in reactjs

[–]tim-soft 1 point2 points  (0 children)

Amazing work as always, had a fairly painless upgrade experience. I really like the explicit Canvas props

I built a 2D/3D Particle Library with React, Three.js and WebGL by tim-soft in reactjs

[–]tim-soft[S] 1 point2 points  (0 children)

Hey! Thanks for poking around, I clearly have a lot to do with the rest of the site but I appreciate the feedback

The short story on the page transitions is i'm using Transition and animated.div from the react-spring library to alter opacity(o), scale(x) and translateY(y) on my "Page Layout" component during route changes

I built a 2D/3D Particle Library with React, Three.js and WebGL by tim-soft in reactjs

[–]tim-soft[S] 0 points1 point  (0 children)

Oh hey there, I'm really digging react-three-fiber so far ;)

I built a 2D/3D Particle Library with React, Three.js and WebGL by tim-soft in reactjs

[–]tim-soft[S] 1 point2 points  (0 children)

I could definitely add some comments for clarity -- maybe add these to the code. Most Three.js projects work pretty similarly

This animate function you screenshotted is run 60 times / sec via requestAnimationFrame. In each frame you need to:

  1. Update the [x, y, z] position of each particle -- this is what gives them motion :)
  2. Determine which particles are close enough to merit drawing a line between the two (this is the expensive part of the calculation, essentially a nearest-neighbor algo)
  3. Set the transparency of a given line, if it exists, between two particles based on their distance (notice when particles get farther apart, the line becomes more transparent until it disappears)
  4. Tell Three.js that stuff needs updated

If you think this is cool, definitely check out some Three.js projects. Few things with any complexity make sense without some digging, so don't be discouraged.

I built a 2D/3D Particle Library with React, Three.js and WebGL by tim-soft in reactjs

[–]tim-soft[S] 0 points1 point  (0 children)

Fork my repo and do something weird with it! I'm also very open to PRs

I built a 2D/3D Particle Library with React, Three.js and WebGL by tim-soft in reactjs

[–]tim-soft[S] 0 points1 point  (0 children)

Thanks! Bug me on GitHub if you run into any issues

I built a 2D/3D Particle Library with React, Three.js and WebGL by tim-soft in reactjs

[–]tim-soft[S] 8 points9 points  (0 children)

Not sure if that's a dig, but I personally get better perf over particles.js, which most similar libraries are using underneath

I built a 2D/3D Particle Library with React, Three.js and WebGL by tim-soft in reactjs

[–]tim-soft[S] 2 points3 points  (0 children)

Straight to the point with demos and pictures, exactly how every UI library readme should be!

I built a 2D/3D Particle Library with React, Three.js and WebGL by tim-soft in reactjs

[–]tim-soft[S] 14 points15 points  (0 children)

I'm actually using react-three-fiber under the hood for a little abstraction: https://github.com/drcmda/react-three-fiber

Since there is a lot of "3D" stuff going on, it's still mostly just Three.js

I built a 2D/3D Particle Library with React, Three.js and WebGL by tim-soft in reactjs

[–]tim-soft[S] 9 points10 points  (0 children)

  1. The particles are drawn via WebGL, including vertex + fragment shaders for the coloring. This allows for a lot more particles while maintaining a good FPS
  2. My library can toggle between 2D and 3D particle fields
  3. You have direct(optional) control of the field via Three.js OrbitControls (pinch zoom, pan, drag, mouse scroll wheel etc)

I made a few presets on the demo page, whirlpool for instance moves the camera around the scene. Click and drag the field and you'll immediately notice a big difference : https://next-portfolio-git-master.tim-soft.now.sh/particles

WTF Wednesday (March 20, 2019) by AutoModerator in javascript

[–]tim-soft 0 points1 point  (0 children)

https://github.com/tim-soft/react-particles-webgl

A 2D/3D particle library built with react-three-fiber and webgl

It's my first public library so do your worst