diff --git a/README.md b/README.md
index 0f57702..af383c5 100644
--- a/README.md
+++ b/README.md
@@ -1,13 +1,15 @@
-# HTML-CSS-JavaScript-projects-for-beginners
-
-This is the source code of the YouTube video (10 projects) https://www.youtube.com/watch?v=ePzOFu2xXUQ.
-
-Part 2 (16 projects) : https://youtu.be/EWv2jnhZErc
-
-NEW HTML CSS JavaScript Projects Interesting HTML CSS JavaScript projects Learn HTML, CSS, and JavaScript 2021 to create modern websites. Fun learning HTML, CSS, and JavaScript!
-
-I'm Sahand, a web developer in computer science. I've been doing this for over a decade. This course was created to share my knowledge and experience with you. Build simple websites using HTML, CSS, and JavaScript. Responsive web design employs HTML, CSS, and JavaScript. This is a skill you'll learn in this course. This new course teaches students how to install Visual Studio Code and its extensions. Then we start from scratch with each project. After finishing HTML, it's on to CSS and JavaScript. Building in HTML, CSS, or JavaScript is fine. This guide explains HTML, CSS, and JavaScript syntax.
-
-Every project is started from scratch and finished without using copied code. Then they are used on the project to ensure everyone understands. This program's exciting project-based curriculum includes building modern, super cool, and responsive websites! Let's get started learning HTML, CSS, and JavaScript.
-
-Contact me if you have any questions through my twitter: @codewithsahand.
+# HTML CSS JavaScript Projects
+
+This is the source code of the website: 100 HTML CSS JavaScript Projects
+
Hi there! I'm Sahand, a web developer with over a decade of experience. This course, "HTML CSS JavaScript Projects," was created to share my knowledge and experience with you. In this course, you'll learn how to build simple, responsive websites using HTML, CSS, and JavaScript.
+
In this course, you'll learn how to install Visual Studio Code and its extensions, and then we'll start from scratch with each project. After finishing HTML, we'll move on to CSS and JavaScript. Building in HTML, CSS, or JavaScript is fine, and this guide will explain HTML, CSS, and JavaScript syntax.
+
Each project in this course is started from scratch and finished without using copied code. Then, we'll go over the code together to ensure that everyone understands. This program's exciting project-based curriculum includes building modern, super cool, and responsive websites!
+
If you have any questions, please feel free to contact me through my email: codewithsahand@gmail.com
-
-
-
diff --git a/projects/simple-stopwatch/stopwatch.js b/projects/simple-stopwatch/stopwatch.js
deleted file mode 100644
index df0d14a..0000000
--- a/projects/simple-stopwatch/stopwatch.js
+++ /dev/null
@@ -1,78 +0,0 @@
-// Get references to the timer and button elements
-var timer = document.getElementById("timer");
-var startButton = document.getElementById("start");
-var stopButton = document.getElementById("stop");
-var resetButton = document.getElementById("reset");
-
-// Initialize variables for tracking the start time, elapsed time, and timer interval
-var startTime,
- elapsedTime = 0,
- timerInterval;
-
-// Function to start the timer
-function startTimer() {
- // Calculate the start time by subtracting the elapsed time from the current time
- startTime = Date.now() - elapsedTime;
-
- // Start an interval that updates the timer display every 10 milliseconds
- timerInterval = setInterval(function printTime() {
- // Calculate the elapsed time by subtracting the start time from the current time
- elapsedTime = Date.now() - startTime;
-
- // Update the timer display with the formatted elapsed time
- timer.textContent = formatTime(elapsedTime);
- }, 10);
-
- // Disable the start button and enable the stop button
- startButton.disabled = true;
- stopButton.disabled = false;
-}
-
-// Function to stop the timer
-function stopTimer() {
- // Clear the interval that updates the timer display
- clearInterval(timerInterval);
-
- // Enable the start button and disable the stop button
- startButton.disabled = false;
- stopButton.disabled = true;
-}
-
-// Function to reset the timer
-function resetTimer() {
- // Clear the interval that updates the timer display
- clearInterval(timerInterval);
-
- // Reset the elapsed time to 0 and update the timer display
- elapsedTime = 0;
- timer.textContent = "00:00:00";
-
- // Enable the start button and disable the stop button
- startButton.disabled = false;
- stopButton.disabled = true;
-}
-
-// Function to format the elapsed time as a string
-function formatTime(time) {
- var hours = Math.floor(time / (1000 * 60 * 60));
- var minutes = Math.floor((time % (1000 * 60 * 60)) / (1000 * 60));
- var seconds = Math.floor((time % (1000 * 60)) / 1000);
- var milliseconds = Math.floor((time % 1000) / 10);
- // The ternary operator hours ? (hours > 9 ? hours : "0" + hours) : "00" checks if the hours variable has a value greater than zero. If it does, it checks if it is greater than 9. If it is, it returns the value of hours. If it is less than or equal to 9, it adds a leading zero to the hours value and returns it. If hours is zero, it returns the string "00".
-
- // The same logic is applied to format the minutes and seconds values.
- return (
- (hours ? (hours > 9 ? hours : "0" + hours) : "00") +
- ":" +
- (minutes ? (minutes > 9 ? minutes : "0" + minutes) : "00") +
- ":" +
- (seconds ? (seconds > 9 ? seconds : "0" + seconds) : "00") +
- "." +
- (milliseconds > 9 ? milliseconds : "0" + milliseconds)
- );
-}
-
-// Add event listeners to the button elements to trigger the timer functions
-startButton.addEventListener("click", startTimer);
-stopButton.addEventListener("click", stopTimer);
-resetButton.addEventListener("click", resetTimer);
diff --git a/projects/stopwatch/index.html b/projects/stopwatch/index.html
new file mode 100644
index 0000000..05d8b2b
--- /dev/null
+++ b/projects/stopwatch/index.html
@@ -0,0 +1,20 @@
+
+
+
+
+
+
+ Stopwatch
+
+
+
+
+
00:00:00
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/projects/stopwatch/index.js b/projects/stopwatch/index.js
new file mode 100644
index 0000000..0cbd647
--- /dev/null
+++ b/projects/stopwatch/index.js
@@ -0,0 +1,54 @@
+const timerEl = document.getElementById("timer");
+const startButtonEl = document.getElementById("start");
+const stopButtonEl = document.getElementById("stop");
+const resetButtonEl = document.getElementById("reset");
+
+let startTime = 0;
+let elapsedTime = 0;
+let timerInterval;
+
+function startTimer() {
+ startTime = Date.now() - elapsedTime;
+
+ timerInterval = setInterval(() => {
+ elapsedTime = Date.now() - startTime;
+ timerEl.textContent = formatTime(elapsedTime);
+ }, 10);
+
+ startButtonEl.disabled = true;
+ stopButtonEl.disabled = false;
+}
+
+function formatTime(elapsedTime) {
+ const milliseconds = Math.floor((elapsedTime % 1000) / 10);
+ const seconds = Math.floor((elapsedTime % (1000 * 60)) / 1000);
+ const minutes = Math.floor((elapsedTime % (1000 * 60 * 60)) / (1000 * 60));
+ const hours = Math.floor(elapsedTime / (1000 * 60 * 60));
+ return (
+ (hours ? (hours > 9 ? hours : "0" + hours) : "00") +
+ ":" +
+ (minutes ? (minutes > 9 ? minutes : "0" + minutes) : "00") +
+ ":" +
+ (seconds ? (seconds > 9 ? seconds : "0" + seconds) : "00") +
+ "." +
+ (milliseconds > 9 ? milliseconds : "0" + milliseconds)
+ );
+}
+function stopTimer() {
+ clearInterval(timerInterval);
+ startButtonEl.disabled = false;
+ stopButtonEl.disabled = true;
+}
+function resetTimer() {
+ clearInterval(timerInterval);
+
+ elapsedTime = 0;
+ timerEl.textContent = "00:00:00";
+
+ startButtonEl.disabled = false;
+ stopButtonEl.disabled = true;
+}
+
+startButtonEl.addEventListener("click", startTimer);
+stopButtonEl.addEventListener("click", stopTimer);
+resetButtonEl.addEventListener("click", resetTimer);
diff --git a/projects/simple-stopwatch/style.css b/projects/stopwatch/style.css
similarity index 61%
rename from projects/simple-stopwatch/style.css
rename to projects/stopwatch/style.css
index f1a4e31..cf0859d 100644
--- a/projects/simple-stopwatch/style.css
+++ b/projects/stopwatch/style.css
@@ -4,17 +4,16 @@ body {
display: flex;
flex-direction: column;
justify-content: center;
- align-items: center;
- height: 100vh;
+ min-height: 100vh;
overflow: hidden;
+ align-items: center;
}
#timer {
font-size: 7rem;
font-weight: 700;
- color: #f92672;
text-shadow: 2px 2px #f8a5c2;
- /* In the current code, the value 2px 2px #f8a5c2 sets a shadow that is 2 pixels to the right and 2 pixels down of the text, with a blur radius of 0 (no blur), and a color of #f8a5c2. */
+ color: #f92672;
width: 600px;
text-align: center;
margin: 40px auto;
@@ -29,15 +28,14 @@ button {
background-color: #f92672;
color: white;
border: none;
- border-radius: 30px;
font-size: 2rem;
font-weight: bold;
padding: 1.5rem 4rem;
- /* In the current code, the value 1.5rem 4rem sets a padding of 1.5rem (24px) for the top and bottom sides of the buttons, and 4rem (64px) for the left and right sides of the buttons. */
margin: 1rem;
+ border-radius: 30px;
cursor: pointer;
- transition: background-color 0.2s;
box-shadow: 2px 2px 10px rgba(0, 0, 0, 0.3);
+ transition: all 0.2s;
}
button:hover {
@@ -45,12 +43,19 @@ button:hover {
box-shadow: 2px 2px 10px rgba(0, 0, 0, 0.5);
}
-button:active {
- background-color: #f34282;
- box-shadow: none;
-}
-
button[disabled] {
opacity: 0.5;
cursor: default;
}
+
+@media (max-width: 800px) {
+ #timer {
+ font-size: 4rem;
+ width: 350px;
+ }
+
+ button {
+ font-size: 1.5rem;
+ padding: 1rem 2rem;
+ }
+}
diff --git a/projects/tip-calculator/index.html b/projects/tip-calculator/index.html
new file mode 100644
index 0000000..029457b
--- /dev/null
+++ b/projects/tip-calculator/index.html
@@ -0,0 +1,28 @@
+
+
+
+
+
+
+ Tip Calculator
+
+
+
+
+
Tip Calculator
+
Enter the bill amount and tip percentage to calculate the total.