forked from simranlotey/Hacktoberfest
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
3d2fc34
commit 8b018bd
Showing
3 changed files
with
77 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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,27 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8" /> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> | ||
<link rel="stylesheet" href="styles.css" /> | ||
<title>Time Zone Timer</title> | ||
</head> | ||
<body> | ||
<h1>Basic Timer for Different Time Zones</h1> | ||
<div class="timer"> | ||
<div class="timezone"> | ||
<h2>New York (EST)</h2> | ||
<p id="new-york-time"></p> | ||
</div> | ||
<div class="timezone"> | ||
<h2>London (GMT)</h2> | ||
<p id="london-time"></p> | ||
</div> | ||
<div class="timezone"> | ||
<h2>Tokyo (JST)</h2> | ||
<p id="tokyo-time"></p> | ||
</div> | ||
</div> | ||
<script src="script.js"></script> | ||
</body> | ||
</html> |
This file contains 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,19 @@ | ||
function updateClock() { | ||
const newYorkTime = new Date().toLocaleString("en-US", { | ||
timeZone: "America/New_York" | ||
}); | ||
const londonTime = new Date().toLocaleString("en-GB", { | ||
timeZone: "Europe/London" | ||
}); | ||
const tokyoTime = new Date().toLocaleString("en-JP", { | ||
timeZone: "Asia/Tokyo" | ||
}); | ||
|
||
document.getElementById("new-york-time").textContent = newYorkTime; | ||
document.getElementById("london-time").textContent = londonTime; | ||
document.getElementById("tokyo-time").textContent = tokyoTime; | ||
} | ||
|
||
updateClock(); | ||
setInterval(updateClock, 1000); | ||
|
This file contains 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,31 @@ | ||
body { | ||
font-family: Arial, sans-serif; | ||
text-align: center; | ||
margin: 0; | ||
padding: 0; | ||
background-color: #f0f0f0; | ||
} | ||
|
||
.timer { | ||
display: flex; | ||
justify-content: space-around; | ||
align-items: center; | ||
margin-top: 50px; | ||
} | ||
|
||
.timezone { | ||
background-color: #fff; | ||
border: 1px solid #ccc; | ||
border-radius: 5px; | ||
padding: 20px; | ||
box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1); | ||
} | ||
|
||
h2 { | ||
margin: 0; | ||
} | ||
|
||
p { | ||
font-size: 24px; | ||
} | ||
|