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
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# CountDown
This is a Simple count down timer made via Javascript
I am Fixing the Readme
I am Fixing the Readme.
Every year the countdown will reset at midnight of 31st dec.
12 changes: 5 additions & 7 deletions script.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,10 @@ let secEl = document.getElementById('sec');
function countdown(){

var currentTime= new Date().getTime(); // Curent Time
const newYear = new Date("dec 31, 2021 23:59:59").getTime(); // destination time

var year = new Date().getFullYear(); // gives us the current year
// ${year} adds the year variable automatically.
const newYear = new Date(`dec 31, ${year} 23:59:59`).getTime(); // destination time

var difference = newYear - currentTime;
// you have got the answere but in milliseconds
Expand All @@ -33,9 +36,4 @@ function Timeformat (time) {
}

setInterval(countdown,1000)
// 1000ms = 1 sec





// 1000ms = 1 sec
11 changes: 6 additions & 5 deletions style.css
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
@import url('https://fonts.googleapis.com/css2?family=Poppins:ital,wght@0,400;1,200&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Ubuntu:ital,wght@1,500&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Aboreto&display=swap');



Expand All @@ -11,17 +12,17 @@
body{
margin: 0px;
background: url('bg1.jpg') no-repeat;
background-size: cover;
background-size: cover;
/* background-position: center center; */
min-height: 100vh;
font-family: 'Poppins', sans-serif;
display: flex;
flex-direction: column;
align-items: center;

}
h1{

font-family: 'Aboreto', cursive;
font-size: 4.2rem;
font-weight: 400;
margin-top: 5rem;
Expand All @@ -33,13 +34,13 @@ h1{

.con{
display: flex;
/* border: 5px solid #ffffff9c;
/* border: 5px solid #ffffff9c;
padding: 15px 70px ; */
}

.big-text{
text-align: center;
font-size: 6rem;
font-size: 6rem;
margin: 0px 60px;
}

Expand Down