JavaScript2025

Digital Counter

Contatore digitale con display LED vintage e sfondo 3D generativo. Animazioni CSS avanzate, interfaccia retro e controlli intuitivi.

JavaScriptCSS 3DAnimazioni
Screenshot di Digital Counter

๐Ÿ”ข Digital Counter

An advanced, responsive digital counter web application built with modern JavaScript, Bootstrap 5, and custom CSS styling.

Digital Counter Preview

โœจ Features

  • Interactive Digital Display - 6-digit LED-style counter with red glow effect
  • Multiple Controls - Increment, decrement, reset, and random number generation
  • Responsive Design - Optimized for mobile, tablet, and desktop devices
  • Modern UI - Bootstrap 5 with custom metallic gradient backgrounds
  • Touch Support - Full touch event handling for mobile devices
  • Custom Typography - DSEG7Classic font for authentic digital display
  • Alert System - User feedback for boundary conditions (min/max values)
  • Smooth Animations - CSS transitions and Bootstrap fade effects

๐Ÿš€ Demo

Live Demo

๐Ÿ› ๏ธ Technologies Used

  • HTML5 - Semantic markup structure
  • CSS3 - Custom styling with gradients, shadows, and responsive design
  • JavaScript ES6+ - Modern vanilla JavaScript with arrow functions and const/let
  • Bootstrap 5.3.8 - UI framework for responsive components
  • Bootstrap Icons - Vector icons for buttons
  • DSEG7Classic Font - Custom digital display typography

๐Ÿ“‚ Project Structure

digital-counter/
โ”œโ”€โ”€ src/
โ”‚   โ”œโ”€โ”€ assets/
โ”‚   โ”‚   โ”œโ”€โ”€ css/
โ”‚   โ”‚   โ”‚   โ””โ”€โ”€ style.css   # Custom styles and responsive design
โ”‚   โ”‚   โ”œโ”€โ”€ js/
โ”‚   โ”‚   โ”‚   โ””โ”€โ”€ script.js   # Application logic and interactivity
โ”‚   โ”‚   โ”œโ”€โ”€ img/            # Images and screenshots
โ”‚   โ”‚   โ””โ”€โ”€ fonts/          # Custom font files
โ”‚   โ””โ”€โ”€ ...
โ”œโ”€โ”€ index.html          # Main HTML file
โ”œโ”€โ”€ README.md
โ””โ”€โ”€ .gitignore

๐ŸŽฎ How to Use

  1. Increment: Click the up arrow (โ†‘) to increase the counter
  2. Decrement: Click the down arrow (โ†“) to decrease the counter
  3. Reset: Click the reset icon (โ†ป) to set counter to zero
  4. Random: Click the shuffle icon (๐Ÿ”€) to generate a random number
  5. Hold to Repeat: Hold increment/decrement buttons for continuous counting

Counter Limits

  • Minimum: 0
  • Maximum: 999,999
  • Display: 6 digits with leading zeros

โš™๏ธ Installation & Setup

Option 1: Direct Download

  1. Download or clone this repository
  2. Open src/index.html in your web browser
  3. No additional setup required!

Option 2: Local Development Server

# Clone the repository
git clone https://github.com/your-username/digital-counter.git

# Navigate to project directory
cd digital-counter

# Start a local server (Python example)
python -m http.server 8000

# Open browser to http://localhost:8000/

Option 3: GitHub Pages Deployment

  1. Fork this repository
  2. Go to repository Settings โ†’ Pages
  3. Select source branch (main/master)
  4. Your app will be available at https://simonecamerano.github.io/digital-counter

๐Ÿ“‹ Browser Compatibility

  • โœ… Chrome 90+
  • โœ… Firefox 88+
  • โœ… Safari 14+
  • โœ… Edge 90+
  • โœ… Mobile browsers (iOS Safari, Chrome Mobile)

๐ŸŽจ Customization

Colors

Edit the CSS variables in src/assets/css/style.css:

/* Digital display color */
.number {
  color: rgb(255, 0, 0); /* Change to your preferred color */
  text-shadow: 0 0 10px #FF0000; /* Matching glow effect */
}

/* Container backgrounds */
.first-container {
  background: /* Your gradient here */;
}

Font

Replace the DSEG7Classic font by updating the @font-face declaration:

@font-face {
  font-family: '7segment';
  src: url(/src/assets/fonts/your-font.woff2) format('woff2');
}

Dimensions

Modify container sizes and responsive breakpoints in the CSS.

๐Ÿ”ง Development

Key JavaScript Functions

  • modNum() - Updates the digital display
  • showAlert() - Displays user feedback messages
  • removeAlert() - Clears existing alerts
  • Button event handlers for all interactions

CSS Features

  • Flexbox layouts for responsive design
  • CSS Grid for number arrangement
  • Custom gradients for metallic effects
  • Media queries for mobile optimization
  • CSS clamp() for responsive typography

๐Ÿค Contributing

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

๐Ÿ“ License

This project is licensed under the MIT License - see the LICENSE file for details.

๐Ÿ‘ค Author

Simone

๐Ÿ™ Acknowledgments

๐Ÿ“Š Project Stats

  • Lines of Code: ~500
  • File Size: < 100KB
  • Load Time: < 1 second
  • Lighthouse Score: 95+ (Performance, Accessibility, Best Practices, SEO)

โญ If you found this project helpful, please give it a star!

๐Ÿ› Found a bug? Report it here

๐Ÿ’ก Have a feature request? Let us know!