StefaDale/Click_Counter
Folders and files
| Name | Name | Last commit date | ||
|---|---|---|---|---|
Repository files navigation
Click Counter ============= Click Counter is a small static web application built with HTML, CSS, and vanilla JavaScript. It displays a numeric counter that can be increased or decreased with two buttons. Project purpose --------------- This project is a simple educational example of: - connecting HTML, CSS, and JavaScript files; - selecting DOM elements with JavaScript; - storing a small piece of UI state in a variable; - reacting to button click events; - updating visible page content dynamically; - applying a CSS class when the counter becomes negative. Files ----- - index.html: page structure, counter display, plus button, minus button, CSS/JS links. - style.css: page layout, centered counter card, button styles, hover/active feedback, negative-number color. - main.js: counter state, increment/decrement functions, display update logic, event listeners. - PROJECT_CONTEXT.md: Italian technical context for future developers or AI assistants. - PROJECT_CONTEXT_EN.md: English technical context for future developers or AI assistants. - README.txt: English project overview. - README_IT.txt: Italian project overview. How to run ---------- Open index.html directly in a web browser. No package installation, build step, local server, or backend is required. Current behavior ---------------- - The counter starts at 0. - Clicking + increases the counter by 1. - Clicking - decreases the counter by 1. - When the value is below 0, the displayed number turns red. - The counter value is not saved after refreshing the page. Possible future improvements ---------------------------- - Add a reset button. - Save the counter value in localStorage. - Add aria-live="polite" to improve screen reader feedback. - Add an explicit button:hover CSS rule for broader browser compatibility.