Skip to content

webdev-desktop/Dark-Light-Toggle

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

4 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐ŸŒ— Dark / Light Mode Toggle โ€“ Modern UI Switch

๐Ÿ”— Live Demo

๐Ÿš€ A modern, responsive Dark/Light mode toggle with smooth animations, glassmorphism UI, and persistent theme storage. Built to practice UI/UX design, CSS animations, and state management using JavaScript.


๐Ÿ“Œ Tech Stack

  • ๐Ÿงฑ HTML5
  • ๐ŸŽจ CSS3
  • โš™๏ธ JavaScript

โœจ Features

  • ๐ŸŒž Light Mode / ๐ŸŒ™ Dark Mode toggle
  • ๐ŸŽฌ Smooth sliding animation (transform-based)
  • ๐ŸŽจ Glassmorphism modern UI design
  • โšก Instant theme switching
  • ๐Ÿ’พ Theme saved using localStorage
  • ๐Ÿ”„ Dynamic mode text display
  • โœจ Icon transition (Sun โ†” Moon)
  • ๐Ÿ“ฑ Fully responsive (Mobile โ†’ Desktop)
  • ๐Ÿšซ No layout shift or animation glitch

๐Ÿš€ Key Highlights

  • ๐ŸŽฏ Smooth Toggle Animation โ€“ Uses transform for GPU-accelerated sliding
  • ๐ŸŽจ Modern UI โ€“ Gradient background + glass effect
  • ๐Ÿ“ฑ Responsive Design โ€“ Built using clamp() for all screen sizes
  • ๐Ÿ’พ Persistent State โ€“ Remembers user preference
  • ๐Ÿง  Clean Code โ€“ Beginner-friendly + scalable structure
  • ๐ŸŒ— Dynamic Icons โ€“ Auto-switch based on mode

๐Ÿ“ธ Screenshots

๐Ÿ“ธ Desktop Preview ๐Ÿ“ธ Mobile Preview


๐Ÿ› ๏ธ Installation

Follow these steps to run the project locally:

# 1. Clone the repository
git clone https://github.com/webdev-desktop/Dark-Light-Toggle.git

# 2. Navigate to the folder
cd Dark-Light-Toggle

# 3. Open in browser
Open index.html

โ–ถ๏ธ Usage

  1. Click on the toggle switch ๐ŸŽš
  2. Switch between Light ๐ŸŒž and Dark ๐ŸŒ™ mode
  3. Observe smooth sliding animation ๐ŸŽฌ
  4. Check dynamic text update ๐Ÿง 
  5. Refresh page โ†’ mode stays saved ๐Ÿ’พ

๐Ÿ”ฎ Future Improvements

  • ๐ŸŒ— Advanced toggle animation (SVG morph)
  • ๐ŸŽฌ Physics-based animation (GSAP)
  • ๐ŸŽจ Multiple theme options
  • ๐Ÿ“ฑ Full settings panel UI
  • ๐ŸŒ Theme sync across devices

๐Ÿค Contribution

Contributions are welcome!

# Fork the repo
# Create a new branch
git checkout -b feature/your-feature

# Commit changes
git commit -m "Add your feature"

# Push to branch
git push origin feature/your-feature

Then open a Pull Request ๐Ÿš€


๐Ÿ‘จโ€๐Ÿ’ป Author

Apurv


๐Ÿ“„ License

This project is licensed under the MIT License.


โญ Support

If you like this project, donโ€™t forget to star โญ the repo and share it!

About

๐ŸŒ— A modern and fully responsive Dark/Light mode toggle with smooth sliding animation, glassmorphism UI, dynamic text updates, and persistent theme storage using localStorage.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors