forked from DhruvSeth18/EduTurbold
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpomodoro.html
367 lines (357 loc) · 11.7 KB
/
pomodoro.html
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
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
<!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>Pomodoro</title>
<style>
@font-face {
font-family: myfont;
src: url(./Zallord\ free.ttf);
}
*{
margin: 0;
padding: 0;
box-sizing: border-box;
border-radius: 0;
font-family: myfont;
}
body{
width: 100%;
height: 100vh;
padding-top: 35px;
background-color: rgb(0, 0, 75);
position: relative;
}
.down{
margin-top: 4rem;
display: flex;
justify-content: center;
align-items: center;
height: 40vh;
}
.feature{
width: 100%;
display: flex;
justify-content: center;
}
.options{
padding-left: 2vw;
padding-right: 1vw;
display: flex;
justify-content: space-between;
display: flex;
justify-content: center;
}
.leftside{
display: flex;
align-items: center;
padding-left: 2vw;
}
.leftside p{
font-size: 2.1rem;
font-weight: bold;
letter-spacing: 4px;
}
.rightside{
display: flex;
justify-content: space-around;
align-items: center;
gap: 1rem;
}
.rightside a{
padding: 0.7rem 1rem;
font-size: 1.2rem;
background-color: rgba(255, 255, 255, 0.379);
color: white;
cursor: pointer;
letter-spacing: 1.5px;
font-family: none;
margin-right:1vw;
}
.rightside select{
color: white;
cursor: pointer;
border: 0;
font-weight: 800;
width: 120px;
height: 2.7rem;
letter-spacing: 1.8px;
font-size: 1.1rem;
background-color: rgba(255, 255, 255, 0.263);
}
.rightside select option{
background-color: rgb(0, 0, 75);
position: relative;
font-size: 1.5rem;
font-family: none;
text-align: center;
}
.sectionA{
width: 50%;
display: flex;
justify-content: space-around;
}
.sectionB {
width: 50%;
display: flex;
justify-content: space-between;
align-items: center;
}
.sectionB select {
margin-right: 20px; /* Add margin to create a gap */
}
.title{
width: 100%;
height: 15vh;
margin-bottom: 1rem;
display: flex;
justify-content: center;
align-items: center;
}
p{
color: white;
font-size: 6rem;
letter-spacing: 4px;
font-weight:500;
font-weight: bold;
}
.clock{
width: 33%;
height: 37vh;
outline: 0.25rem solid crimson;
outline-offset: -1rem;
-webkit-box-shadow: 0px 0px 21px 0px rgba(255,255,255,1);
-moz-box-shadow: 0px 0px 21px 0px rgba(255,255,255,1);
box-shadow: 0px 0px 21px 0px rgba(255,255,255,1);
border-radius: 5%;
display: flex;
justify-content: center;
align-items: center;
}
.clock p{
color: white;
background-color: ;
font-size: 6rem;
letter-spacing: 4px;
font-weight:500;
}
#Buttons{
width: 100%;
height: 7vh;
display: flex;
margin-top:3rem;
justify-content: center;
align-items: center;
}
#Buttons input{
width: 10%;
height: 3rem;
font-size: 1.7rem;
font-weight: 600;
letter-spacing: 4px;
border-radius: 10px;
border: 0;
outline: 0;
}
#Buttons input:hover{
scale: 0.95;
}
#Buttons input:active{
scale: 1.05;
}
#Pause{
margin-right: 2rem;
}
#Reset{
margin-left: 2rem;
}
#Resume{
margin-right: 2rem;
}
.color{
cursor: pointer;
width: 20%;
height: 25vh;
position: absolute;
background-color: rgba(255, 255, 255, 0.78);
top: 26vh;
left: 34vw;
border-radius: 15px;
display: grid;
grid-template-columns: 1fr 1fr 1fr;
padding: 20px;
gap: 1rem;
}
#ab{
height: 9vh;
}
.firstcolor{
background-color: orange;
}
.secondcolor{
background-color:crimson;
}
.thirdcolor{
background-color: yellowgreen;
}
.fourthcolor{
background-color: rgb(0, 0, 75);
}
@media(max-width: 600px){
}
</style>
</head>
<body>
<div class="title">
<p>Pomodoro Clock</p>
</div>
<div class="feature">
<div class="options">
<div class="rightside">
<div class="sectionA">
<a onclick="color()" id="color">COLOR</a>
<select id="Sessions" onchange="change1()">
<option value="2">2 Session</option>
<option value="4">4 Session</option>
<option value="8">8 Session</option>
</select>
</div>
<div class="sectionB">
<select id="Minutes" onchange="change1()">
<option value="25">25min</option>
<option value="30">30min</option>
<option value="50">50min</option>
<option value="55">55min</option>
</select>
<select id="Breaks" onchange="change1()">
<option value="5">5min</option>
<option value="10">10min</option>
<option value="15">15min</option>
</select>
</div>
</div>
</div>
</div>
<div class="down">
<div class="clock">
<p id="Time"></p>
</div>
</div>
<div id="Buttons">
<input id="start" type="submit" value="Start" onclick="start()">
<input id="Resume" type="submit" value="Resume" onclick="startAgain()" placeholder="Pause" style="display: none;" >
<input id="Pause" type="submit" value="pause" onclick="pause()" placeholder="Pause" style="display: none;" >
<input id="Reset" type="reset" value="reset" onclick="reset()" placeholder="Reset" style="display: none;" >
</div>
<div class="color" id="colorBox" style="display: none;">
<div id="ab" class="firstcolor" onclick="orange()" onmouseenter="orange1()"></div>
<div id="ab" class="secondcolor" onclick="crimson()" onmouseenter="crimson1()"></div>
<div id="ab" class="thirdcolor" onclick="lightgreen()" onmouseenter="lightgreen1()"></div>
<div id="ab" class="fourthcolor" onclick="HomeBlue()" onmouseenter="HomeBlue1()"></div>
</div>
<script>
var session = 2
var minute = 24
var second = 59
var Breaks = 5
var i=1
var id
var breakcount =0
var min = minute
document.getElementById("Time").innerHTML = "25"+" : "+"00"
function change1(){
session = document.getElementById("Sessions").value
minute = document.getElementById("Minutes").value
Breaks = document.getElementById("Breaks").value
document.getElementById("Time").innerHTML = minute+" : "+"00"
minute = minute -1
min = minute
}
function start(){
document.getElementById("start").style.display = "none"
document.getElementById("Pause").style.display = "inline-block"
document.getElementById("Reset").style.display = "inline-block"
document.getElementById("Resume").style.display = "none"
function clock(){
document.getElementById("Time").innerHTML = minute + " : "+second
if(second == 0){
minute =minute-1
if(minute==-1){
if(i!=session){
if(breakcount % 2==0){
minute = Breaks -1
breakcount++
playmusic2()
}
else{
playmusic()
minute = min
breakcount++
i++
}
}
else{
clearInterval(id)
}
}
second = 59
}
second = second-1
}
id = setInterval(clock,1000)
}
function pause(){
id = clearInterval(id)
document.getElementById("Pause").style.display = "none"
document.getElementById("Resume").style.display = "inline-block"
}
function startAgain(){
start()
}
function reset(){
location.reload()
}
function color(){
document.getElementById("colorBox").style.display ="grid"
}
function orange(){
document.querySelector("body").style.backgroundColor ="orange"
document.getElementById("colorBox").style.display ="none"
}
function crimson(){
document.querySelector("body").style.backgroundColor ="crimson"
document.getElementById("colorBox").style.display ="none"
}
function lightgreen(){
document.querySelector("body").style.backgroundColor ="yellowgreen"
document.getElementById("colorBox").style.display ="none"
}
function HomeBlue(){
document.querySelector("body").style.backgroundColor ="rgb(0, 0, 75)"
document.getElementById("colorBox").style.display ="none"
}
function orange1(){
document.querySelector("body").style.backgroundColor ="orange"
}
function crimson1(){
document.querySelector("body").style.backgroundColor ="crimson"
}
function lightgreen1(){
document.querySelector("body").style.backgroundColor ="yellowgreen"
}
function HomeBlue1(){
document.querySelector("body").style.backgroundColor ="rgb(0, 0, 75)"
}
function playmusic(){
let audio = new Audio("run.mp3")
audio.play()
}
function playmusic2(){
let audio = new Audio("break.mp3")
audio.play()
}
</script>
</body>
</html>