I’m a bit down recently because the break ended and I had to fly all the way from home away from my family. I like to count and collect what makes me happy whenever I feel so.
Inspired by the Erasure Poetry, I decided to work on a “happiness discover”, to find out the happy sources in the text/input from the users about their daily lives.
Here is the link to it:
https://a2z-week1-happiness-discover.glitch.me/
Learning from the course example, it’s easy to erase the word by adjusting the font color to white. I struggled with how to create the poetry structure -
Everyone’s happiness is so different thus hard to define. I looked up on the internet and couldn’t find any “happynet” like wordnet, so I decided to come up with one by myself. If going furthur, this can be defined by people themselves. I created a list for the happiness source, here is what I have now (representing what I think will bring myself happiness:
'dog', 'tea', 'sun', 'sunshine', 'nature', 'outdoor', 'outdoors', 'friend', 'family', 'hang out', 'flower', 'drinks', 'tree', 'puppy', 'cat', 'kitty', 'warm', 'chill', 'sea', 'break', 'vacation', 'book', 'bed', 'meditation', 'trip', 'home', 'sleep', 'cook', 'laugh', 'song', 'favorite', 'laughing', 'money', 'satisfying', 'coffee', ':)', ":D", 'weather', 'love', 'soup', 'turkey', 'trifle', 'sherry', 'cheddar', 'excellent', 'gleaming', 'sparkling'
ChatGPT helped me a lot on the second question. Basically this method matters the most:
wordsList.includes()
It examines if the word input from users matches with my happiness array. If so, the word will be given colors. I later added more rules about puncutations, but the state of the word (progressive, past tense, etc.) needs to be further defined.