Greenheart / swipeforfuture.com

Solving the climate crisis, one swipe at a time 🌍🔥
https://swipeforfuture.com
GNU General Public License v3.0
6 stars 1 forks source link

Refactor code with the goal of removing legacy code and drastically reducing binary size #160

Closed Muthaias closed 3 years ago

Muthaias commented 3 years ago

I think that the initial refactor of the main logic has been proven to work quite well and I think it is time to strip out some legacy code and types in order to get a leaner code base.

I would like to:

The goal is twofold:

I would like your input before starting this @Greenheart

Greenheart commented 3 years ago

This would be a really fun project this coming week! I have similar ideas about simplifying the game 😃

Greenheart commented 3 years ago

For example, I've been working with https://svelte.dev for the last 8 months and really enjoyed how much it simplifies the equivalent React code.

One idea is to refactor the game to use Svelte (possibly with https://kit.svelte.dev and adapter-static to get a solid foundation). Svelte includes animation and transitions, which makes it easy to create the card stack animations we previously used react-spring for:

This is almost the card swipe animation: https://svelte.dev/examples#actions

Greenheart commented 3 years ago

Everything in this issue except Adjust parameters to only be limited to [0-100] if they are part of the visible game state is solved in the upcoming SvelteKit rewrite! :)

Greenheart commented 3 years ago

This is now completed! Thanks for really nice collaboration on this! :smile:

Moved the final remaining point from this issue to #147 instead.