Svelte Circuits

Just a fun little SVG thing written in Svelte 5 for the purpose of exploring the new state management models. Feel free to browse around the source code - I've made some comments. You can play around with it at circuitsimulator.org.

  • Right click anywhere to open the logic gate dialog.
  • Click on one to create it (note there's a small bug where if you've panned the screen it goes somewhere else, I'll fix this at some point)
  • Drag any of the dots anywhere. If you drag it on top of another dot, it will connect, otherwise it will create a new dot.
  • Drag the middle part of a line in order to make a new dot.
  • You can zoom in and out and pan by holding the space bar or using two-finger swipe and pinch-to-zoom on your trackpad.

Note that I've never used this on mobile so I have no idea how the experience will go down!

https://github.com/user-attachments/assets/e1988d68-f4b1-49e8-bdbb-9687921b7c83

Top categories

Loading Svelte Themes