-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtime.html
More file actions
175 lines (172 loc) · 3.87 KB
/
Copy pathtime.html
File metadata and controls
175 lines (172 loc) · 3.87 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Current Time in New York City and Dakar</title>
<style>
body {
font-family: Arial, sans-serif;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
min-height: 100vh;
margin: 0;
background: linear-gradient(-45deg, #d8f3dc, #b7e4c7, #95d5b2, #74c69d, #52b788, #40916c);
background-size: 400% 400%;
animation: gradientShift 18s ease infinite;
position: relative;
overflow: hidden;
}
h1 {
margin-bottom: 20px;
color: #1b4332;
position: relative;
z-index: 1;
}
.city {
background: rgba(255, 255, 255, 0.85);
padding: 20px 30px;
margin: 10px;
border-radius: 8px;
box-shadow: 0 6px 18px rgba(0,0,0,0.1);
text-align: center;
position: relative;
z-index: 1;
}
.city h2 {
margin: 0 0 10px;
color: #2d6a4f;
}
.time {
font-size: 1.2em;
font-weight: bold;
color: #1b4332;
}
.floating-shapes {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
pointer-events: none;
z-index: 0;
overflow: hidden;
}
.shape {
position: absolute;
border-radius: 50%;
background: radial-gradient(circle at 30% 30%, rgba(255,255,255,0.65), rgba(104,201,155,0.35) 50%, rgba(40,111,82,0.25) 75%, rgba(27,67,50,0));
animation: floatUp 22s linear infinite;
opacity: 0;
}
.shape1 {
width: 180px;
height: 180px;
left: 12%;
bottom: -25%;
animation-duration: 24s;
}
.shape2 {
width: 120px;
height: 120px;
left: 45%;
bottom: -20%;
animation-duration: 18s;
animation-delay: -6s;
}
.shape3 {
width: 220px;
height: 220px;
left: 70%;
bottom: -30%;
animation-duration: 28s;
animation-delay: -12s;
}
.shape4 {
width: 140px;
height: 140px;
left: 25%;
bottom: -35%;
animation-duration: 20s;
animation-delay: -3s;
}
.shape5 {
width: 200px;
height: 200px;
left: 80%;
bottom: -40%;
animation-duration: 26s;
animation-delay: -10s;
}
.shape6 {
width: 100px;
height: 100px;
left: 5%;
bottom: -15%;
animation-duration: 16s;
animation-delay: -8s;
}
@keyframes gradientShift {
0% {
background-position: 0% 50%;
}
50% {
background-position: 100% 50%;
}
100% {
background-position: 0% 50%;
}
}
@keyframes floatUp {
0% {
transform: translateY(0) scale(0.8) rotate(0deg);
opacity: 0;
}
10% {
opacity: 0.6;
}
50% {
transform: translateY(-50vh) scale(1.05) rotate(120deg);
opacity: 0.75;
}
100% {
transform: translateY(-110vh) scale(1.2) rotate(320deg);
opacity: 0;
}
}
</style>
</head>
<body>
<div class="floating-shapes">
<span class="shape shape1"></span>
<span class="shape shape2"></span>
<span class="shape shape3"></span>
<span class="shape shape4"></span>
<span class="shape shape5"></span>
<span class="shape shape6"></span>
</div>
<h1>Current Date and Time</h1>
<div class="city">
<h2>New York City</h2>
<div id="ny-time" class="time"></div>
</div>
<div class="city">
<h2>Dakar</h2>
<div id="dakar-time" class="time"></div>
</div>
<script>
function updateTime() {
const options = { weekday: 'long', year: 'numeric', month: 'long', day: 'numeric', hour: 'numeric', minute: 'numeric', second: 'numeric' };
const nyElement = document.getElementById('ny-time');
const dakarElement = document.getElementById('dakar-time');
const nyTime = new Date().toLocaleString('en-US', { ...options, timeZone: 'America/New_York' });
const dakarTime = new Date().toLocaleString('en-US', { ...options, timeZone: 'Africa/Dakar' });
nyElement.textContent = nyTime;
dakarElement.textContent = dakarTime;
}
updateTime();
setInterval(updateTime, 1000);
</script>
</body>
</html>