Skip to content

shuddha2021/Emotion-Detector-Web-App

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 

Repository files navigation

Zenify

Zenify is a simple and fun web app that analyzes the sentiment of any sentence using HTML, CSS, and JavaScript. It uses a basic logic to determine whether the sentence is positive, negative, or neutral, and displays the result with a corresponding color and sound effect. You can try it out here: https://sentiment-analysis-tool.vercel.app/

Screenshot 2023-07-12 at 2 49 48 PM Screenshot 2023-07-12 at 2 49 16 PM Screenshot 2023-07-12 at 2 49 03 PM

How it works

Zenify uses the following JavaScript concepts to implement the sentiment analysis functionality:

  • Variables and constants
  • Strings and string methods
  • Conditional statements
  • Functions
  • Event listeners
  • DOM manipulation
  • Audio objects

The app consists of three main components: the input field, the submit button, and the output element. The user can type a sentence in the input field and click the submit button to see the sentiment result. The app then calls a function that takes the user input as an argument and returns a sentiment value based on some simple rules. For example, if the sentence contains words like "love", "happy", or "great", the function returns "positive". If it contains words like "hate", "sad", or "terrible", it returns "negative". Otherwise, it returns "neutral".

The app then displays the sentiment value in the output element with a corresponding color and sound effect. For example, if the sentiment is positive, the output element will have a green color and play a cheerful sound. If it is negative, it will have a red color and play a sad sound. If it is neutral, it will have a gray color and play a calm sound.

The app also clears the input field after displaying the result, focuses on the input field for convenience, and resets the output element class after a slight delay.

How to use

To use Zenify, you can either visit the live demo link or clone this repository and open the index.html file in your browser. Then, you can type any sentence in the input field and click the submit button to see its sentiment. You can also press the Enter key to submit your input. You can try different sentences and see how the app responds to them.

How to contribute

If you want to contribute to Zenify, you can fork this repository and make your changes. Then, you can create a pull request with a description of your changes and why you think they are useful. I will review your pull request and merge it if it meets the following criteria:

  • It improves the functionality or design of the app
  • It follows the code style and format of the original code
  • It does not introduce any bugs or errors
  • It does not conflict with any existing code

Thank you for your interest in Zenify!