100JSProjects
LearnProjectsExplore all projects
100JS_WORKSPACE/Build · Learn · Repeat
100JSProjects

Practical HTML, CSS, and JavaScript projects designed to help you turn concepts into real skills—one build at a time.

01Explore

./All projects./Learning guides./About./Contact./Privacy

02Resources

./GitHub repository./Support the project

© 2026 100 JS Projects. Built for developers.

TermsCookiesContact
JS//Projects/Dark Mode Toggle

Dark Mode ToggleHTML, CSS & JavaScript Project

HTML5CSS3JavaScript
View Source CodeLive Demo
Dark Mode Toggle project previewTry Live Demo
What you'll build

Dark Mode Toggle

In this project, we'll create a toggle button that switches the website between dark and light modes, with a sliding animation for a more visually appealing transition. We'll use keyframe CSS queries to create the animation and JavaScript to change the background color dynamically. The user's preference will be stored using the browser's local storage, ensuring that their selection persists even if they refresh the page. This project will teach you advanced CSS techniques, JavaScript programming, and how to improve the user experience by storing data in the browser.

HTML
— Structure
CSS
— Design
JavaScript
— Logic
Complete project files

Build It from the Source Code

Create these three files, copy the code into each one, then open index.html with Live Server.

Project structure
dark-mode-toggle/
├── index.html
├── style.css
└── index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Dark Mode Toggle</title>
    <link rel="stylesheet" href="style.css" />
  </head>
  <body>
    <input type="checkbox" id="dark-mode" class="input" />
    <label for="dark-mode" class="label">
      <div class="circle"></div>
    </label>
    <script src="index.js"></script>
  </body>
</html>

JS// Related Projects

Keep Building with Similar Projects

Continue your learning journey with these handpicked projects that share similar concepts and technologies

Simple Stopwatch project preview
HTMLCSSJavaScript

Simple Stopwatch

Welcome to the Stopwatch Project! We will create a timer displayed at the top, along with three buttons - start, stop, and reset. Clicking the START button will begin the timer. The STOP button will pause the timer using a JavaScript method called SetInterval, which can be cleared using clearInterval. The RESET button will reset the timer to zero. If you click STOP and then START again, the timer will continue from the previously elapsed time. We'll start by installing CSS for the buttons' design and hover effects, then use JavaScript to get the browser time, manipulate the content, replace it with the calculated time, and provide the start, stop, and reset functionality.

View project
Temperature Converter project preview
HTMLCSSJavaScript

Temperature Converter

This project aims to create a temperature converter for beginners. The final version of the project includes three inputs for Celsius, Fahrenheit, and Kelvin temperature formats. When you change any of these inputs, for example, if you choose 100 degrees Celsius, you will see the equivalent Celsius value in Fahrenheit and Kelvin formats. Additionally, if you change one input, you will see a real-time change inside the other inputs. For instance, changing the Fahrenheit input to 100 degrees will show you that it is equal to 37 degrees Celsius and 311 Kelvin. To create this project, we will learn how to use an "onchange" event listener to track changes inside the inputs. We will also use the switch statement to track changes based on the name of the input we are working on. Additionally, we will use CSS to give the project a modern look, inspired by newMorphISM design. In summary, this project will help us learn how to create a temperature converter using JavaScript and CSS, and we will learn how to track changes using event listeners and switch statements.

View project
Dice Roll Simulator project preview
HTMLCSSJavaScript

Dice Roll Simulator

Welcome to the Dice Roll Simulator project. The final version of the project features a dice at the center of the screen and a "Roll dice" button. The button triggers an animation and generates a random number, which is displayed in the center of the dice when clicked, t. Additionally, the number is added to a history list. To achieve this, we used modern CSS to style the dice and added a JavaScript event listener to the button. The listener generates a random number, saves it to an array, and updates the history list.

View project
{ }View All Projects