Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
File renamed without changes.
Binary file removed README.md
Binary file not shown.
15 changes: 15 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Countdown</title>
<link rel="stylesheet" href="style.css">
</head>
<body>
<div id="countdown-container" ></div>

<script src="script.js"></script>

</body>
</html>
22 changes: 22 additions & 0 deletions script.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
function printRange(num = 0, action = () => {}) {
document.getElementById('countdown-container').innerText = num;
console.log(num)
if(action) {
action()
}
}


function printRange(num = 0, action = () => {}) {
document.getElementById('countdown-container').innerText = num;
if (num > 0) {
setTimeout(() => printRange(num - 1, action), 1000);
} else {
action();
}
}


printRange(10, () => {
document.getElementById('countdown-container').innerText = 'Happy Independence Day!';
});
7 changes: 7 additions & 0 deletions style.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#countdown-container{
height: 100px;
width: 100px;
background-color: blueviolet;
color: black;

}