- Notifications
You must be signed in to change notification settings - Fork725
add new project#7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Closed
Uh oh!
There was an error while loading.Please reload this page.
Closed
Changes fromall commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Uh oh!
There was an error while loading.Please reload this page.
Jump to
Jump to file
Failed to load files.
Loading
Uh oh!
There was an error while loading.Please reload this page.
Diff view
Diff view
There are no files selected for viewing
61 changes: 61 additions & 0 deletionsprojects/countdown-timer/app.js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
var button = document.getElementById("button"); | ||
const input = document.querySelectorAll(".select"); | ||
button.addEventListener('click', ()=> { | ||
var enterDate = document.getElementById("enterDate").value; | ||
var enterTime = document.getElementById("enterTime").value; | ||
const last = enterDate + " " + enterTime; | ||
const end = new Date(last); | ||
calculate(end); | ||
const myInterval = setInterval( | ||
() => { | ||
calculate(end); | ||
}, | ||
1000 | ||
) | ||
var stop = document.getElementById("stop"); | ||
stop.addEventListener('click', () => { | ||
clearInterval(myInterval); | ||
}) | ||
}) | ||
const calculate = (end) => { | ||
const now = new Date(); | ||
if(end > now) | ||
{ | ||
const diff = (end - now)/1000; | ||
// convert into day | ||
var day = Math.floor(diff / (3600 * 24)); | ||
input[0].value = day; | ||
// convert into hour | ||
var hour = Math.floor((diff / 3600) % 24); | ||
input[1].value = hour; | ||
// convert into min | ||
var min = Math.floor((diff / 60) % 60); | ||
input[2].value = min; | ||
//convert into sec | ||
var sec = Math.floor(diff % 60); | ||
input[3].value = sec; | ||
} | ||
else | ||
{ | ||
input[0].value = 0; | ||
input[1].value = 0; | ||
input[2].value = 0; | ||
input[3].value = 0; | ||
} | ||
} | ||
var reset = document.getElementById("reset"); | ||
reset.addEventListener('click', () => { | ||
window.location.reload(); | ||
}) |
58 changes: 58 additions & 0 deletionsprojects/countdown-timer/index.html
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
<!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>Countdown Timer</title> | ||
<link rel="stylesheet" href="style.css"> | ||
</head> | ||
<body> | ||
<p class="title">Countdown Timer</p> | ||
<div class="dateTime"> | ||
<table> | ||
<tr> | ||
<td><label for="date">Enter Date:</label></td> | ||
<td> <input type="date" id="enterDate" required></td> | ||
</tr> | ||
<br> | ||
<tr> | ||
<td><label for="date">Enter Time:</label></td> | ||
<td><input type="time" id="enterTime" required></td> | ||
</tr> | ||
</table> | ||
</div> | ||
<button id="button">calculate</button> | ||
<button id="stop">stop</button> | ||
<button id="reset">reset</button> | ||
<div class="container"> | ||
<div class="innerContainer" id="day"> | ||
<input type="text" class="select" id="day" readonly> | ||
<br> | ||
<p>Day</p> | ||
</div> | ||
<div class="innerContainer" id="hour"> | ||
<input type="text" class="select" id="hour" readonly> | ||
<br> | ||
<p>Hour</p> | ||
</div> | ||
<div class="innerContainer" id="min"> | ||
<input type="text" class="select" id="min" readonly> | ||
<br> | ||
<p>Minutes</p> | ||
</div> | ||
<div class="innerContainer" id="sec"> | ||
<input type="text" class="select" id="sec" readonly> | ||
<br> | ||
<p>Seconds</p> | ||
</div> | ||
</div> | ||
<script src="app.js"></script> | ||
</body> | ||
</html> |
79 changes: 79 additions & 0 deletionsprojects/countdown-timer/style.css
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
html | ||
{ | ||
height: 100%; | ||
font-weight: bolder; | ||
} | ||
body | ||
{ | ||
text-align: center; | ||
background-image: url("https://img.freepik.com/free-photo/neutral-tone-abstract-invitation-card_53876-97500.jpg?w=360&t=st=1678787861~exp=1678788461~hmac=ddf4b178837a6bad7c846053fe79fdfbc1e65bb4e3ee5c298f828b653335b6ed"); | ||
background-position: center; | ||
background-repeat: no-repeat; | ||
background-size: 100%; | ||
color:black; | ||
} | ||
table{ | ||
margin: auto; | ||
} | ||
tr, td{ | ||
text-align: left; | ||
} | ||
.title | ||
{ | ||
font-size: 40px; | ||
padding:1rem ; | ||
border: 1px solid #ffdfdd; | ||
} | ||
.dateTime label | ||
{ | ||
font-size: 20px; | ||
margin: 10px; | ||
} | ||
.dateTime input | ||
{ | ||
font-size: 20px; | ||
margin: 10px; | ||
padding: 5px 10px; | ||
border: 2px solid #ffdfdd ; | ||
background-color: #ffdfdd; | ||
border-radius: 10px; | ||
box-shadow: 3px 3px 3px #307d7e; | ||
} | ||
button | ||
{ | ||
margin: 20px 5px; | ||
padding: 5px 10px; | ||
font-size: 20px; | ||
background-color: #ffdfdd; | ||
border: 1px solid #ffdfdd; | ||
box-shadow: 3px 3px 3px #307d7e; | ||
border-radius: 5px; | ||
} | ||
.container | ||
{ | ||
display: flex; | ||
justify-content: center; | ||
} | ||
.innerContainer | ||
{ | ||
margin: 5px; | ||
} | ||
.innerContainer input | ||
{ | ||
height: 8vw; | ||
width: 8vw; | ||
border-radius: 200px; | ||
color: black; | ||
background-color: #ffdfdd; | ||
/* background: transparent; */ | ||
text-align: center; | ||
font-size: 5vw; | ||
} |
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.