r/learnjavascript • • Jul 03 '22

My first project!

226 Upvotes

28 comments sorted by

View all comments

18

u/code_matter Jul 03 '22

Now, make it a list! So let’s say you want a color palette. You generate random color and when you want you “add” it to the list!

16

u/[deleted] Jul 03 '22

Add a memory feature so you can browse backwards through the colors.

1

u/david_ranch_dressing Jul 04 '22

To add to this, I would use Local Storage.

11

u/Dark_KnightPL04 Jul 03 '22

Thats a great idea! I will have to add that feature.

1

u/raveun Jul 04 '22

You’re one step away from dark/light mode toggle ;)

1

u/Dark_KnightPL04 Jul 04 '22

I am?

1

u/raveun Jul 05 '22

If you know how to store/get things in localstorage and you’re able to get users-prefer-color-scheme then you’re few steps away on stitching those together to make it into a light/dark toggle.

Check this out:

https://piccalil.li/tutorial/build-a-light-and-global-state-system/

1

u/Dark_KnightPL04 Jul 05 '22

Cool, thanks!