The file `script.js` handles form submissions and frontend-to-backend communication. It gathers input values from HTML elements, packages them into a JSON payload, and sends them via the Fetch API to the Flask server.
Error responses are caught and displayed gracefully. The JavaScript also formats and renders the returned sentiment and answer list in the frontend UI dynamically.
UI Structure and Styling – index.html & style.css
The user interface is built using HTML5, styled with modern CSS for responsiveness and dark mode compatibility.
Elements include:
- Coin selection dropdown (`<select>`)
- Query input field (`<input>`)
- Submission button (`<button>`)
- Output div (`<div id="result">`)