← back

Theme maker 2002

← previous post

Ok, I've decided to go much faster and not make this that long, so...

picking up where we left off...

this is what my src looks like right now:

| - modules/
| - | - html.js
| - | - inputs.js
| - | - output.js
| - | - stateMachine.js
| - | - tools.js
| - styles/
| - | - tools.css
| - | - output.css
| - | - thebutton.css
| - index.js


This is just a tagged template function that takes in a tagged template and returns a DocumentFragment with the string provided as the innerHTML


This is a simple state machine implementation, you'll see how I'm using it later. Made following Kent C Dodds implementation


This will contain the code to add the inputs that will tweak our button's properties.


Here we basically export to arrays that will then be added to the tools and render an input.


This will contain the code to show the button's properties so that you can copy them.


This folder is pretty self explanatory, I wanted to modularize the styles, since we are using snowpack, we can later add them to the corresponding *.js files.


We'll here is where we merge everything, we will use the state machine to toggle between the two states we have, tools & output, and we will have a function that on every transition checks which fragment of the app should be rendered, kinda like a router but with a state machine.

And that's it! We are done, 100% custom made, with the help of snowpack 😅

Remember to check the code out at https://github.com/jenaro94/theme-maker-2000

Stuff cool to add: