-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathext.html
321 lines (262 loc) · 10.2 KB
/
ext.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
<!DOCTYPE html>
<html>
<head>
<title>Pomodoro Timer</title>
<style>
body{ padding: 15%;
background-image: url('first-image.jpg');
background-image: url('second-image.jpg');
background-image: url('fourth-image.webp');
background-image: url('5-image.jpg');
background-image: url('6-image.jpg');
background-image: url('riyaz2.jpg');
background-image: url('riyaz1.jpg');
background-image: url('riyaz3.jpg');
background-image: url('riyaz4.jpg');
background-image: url('riyaz5.jpg');
background-image: url('riyaz6.jpg');
background-image: url('riyaz7.jpg');
background-image: url('riyaz8.jpg');
background-image: url('riyaz9.jpg');
background-image: url('riyaz10.jpg');
background-image: url('riyaz11.png');
background-image: url('t2.jpg');
background-image: url('t1.jpg');
background-image: url('t3.png');
background-image: url('t4.png');
background-image: url('t5.png');
background-image: url('t6.png');
background-image: url('t6.png');
background-image: url('t7.jpg');
background-image: url('t8.jpg');
background-image: url('third-image.jpg');
-ms-overflow-style: none; /* for Internet Explorer, Edge */
scrollbar-width: none; /* for Firefox */
overflow-y: scroll;background-repeat: no-repeat;
background-position: center center;
background-size: cover;
-webkit-app-region: no-drag;
}
label {
padding-left: 32%;
font-family: 'Bebas Neue', sans-serif;
color: white;
-webkit-app-region: no-drag;
}
body::-webkit-scrollbar {
display: none; /* for Chrome, Safari, and Opera */
}
#progress-bar {
width: 100%;
height: 15px;
background-color: white;
border-radius: 25px;
color: black;
-webkit-app-region: drag;
}
/* Add some styling for the timer display */
#timer {
display: flex;
align-items: center;
justify-content: center;
width: 250px;
height: 50px;
font-size: 20px;
border-radius: 25px;
background-color: white;
margin: 20px auto;
text-align: center;
font-family: 'Bebas Neue', sans-serif;
-webkit-app-region: drag;
}
/* Add some styling for the input fields */
input[type='number'] {
width: 25px;
height: 30px;
border: none;
border-radius: 5px;
text-align: center;
padding-left: 5%;
color: black;
font-family: 'Bebas Neue', sans-serif;
-webkit-app-region: no-drag;
}
.to {
font-family: 'Bebas Neue', sans-serif;
width: fit-content;
height: 30px;
padding: 10x;
border: 1px solid #ccc;
background-color: #eee;
cursor: pointer;
font-family: 'Bebas Neue', sans-serif;
margin: 0 auto;
border-radius: 50px;
text-align: center;
margin: auto;
-webkit-user-select: none;
-webkit-app-region: no-drag;
}
.ri {
font-family: 'Bebas Neue', sans-serif;
width: fit-content;
border: 1px transparent;
background-color: transparent;
cursor: pointer;
font-family: 'Bebas Neue', sans-serif;
border-radius: 50px;
position: absolute;
top: 8px;
left: 16px;
text-align: center;
margin: auto; }
.gt{ position: absolute;
top: 2px;
right: 1px;
font-family: 'Muro';
font-size: 10%;
-webkit-app-region: no-drag;
}
</style>
<script>
var imageIndex = 0;
var images = [ 'first-image.jpg', 'second-image.jpg','third-image.jpg' , 'fourth-image.webp' ,'5-image.jpg','6-image.jpg', 'riyaz1.jpg' , 'riyaz2.jpg' , 'riyaz3.jpg' , 'riyaz4.jpg' , 'riyaz5.jpg' , 'riyaz6.jpg' , 'riyaz7.jpg' , 'riyaz8.jpg' , 'riyaz9.jpg' , 'riyaz10.jpg' , 'riyaz11.png' , 't1.jpg' , 't2.jpg' , 't3.png' , 't4.png' , 't5.png' , 't6.png' , 't6.png' , 't7.jpg' , 't8.jpg' ,];
function changeBackground() {
imageIndex = (imageIndex + 1) % images.length;
document.body.style.backgroundImage = 'url(' + images[imageIndex] + ')';
}
</script>
</head>
<body>
<marquee onClick="closeWindow()" class="gt" id="close-btn" style="color: white; font-size: 15px;">padhle bhai padhle bhai padhle bhai padhle bhai padhle bhai padhle bhai padhle bhai padhle bhai padhle bhai padhle bhai padhle bhai padhle bhai padhle bhai padhle bhai padhle bhai padhle bhai padhle bhai padhle bhai padhle bhai padhle bhai padhle bhai padhle bhai padhle bhai padhle bhai padhle bhai padhle bhai padhle bhai padhle bhai padhle bhai padhle bhai padhle bhai padhle bhai padhle bhai padhle bhai padhle bhai padhle bhai padhle bhai padhle bhai padhle bhai padhle bhai padhle bhai padhle bhai padhle bhai padhle bhai padhle bhai padhle bhai padhle bhai padhle bhai padhle bhai padhle bhai padhle bhai padhle bhai padhle bhai padhle bhai padhle bhai padhle bhai padhle bhai padhle bhai padhle bhai padhle bhai </marquee>
<div id="progress-bar"></div>
<!-- Display the timer -->
<div id="timer"></div>
<!-- Add input fields for the Pomodoro and break lengths -->
<label a for="pomodoro-length" ondblclick="window.location.href = 'https://riyazweb.github.io/searcH/htmly.html';" >Pomodoro Length (minutes):</label>
<input type="number" id="pomodoro-length" value="">
<br>
<label for="break-length">Break Length (minutes):</label>
<input type="number" id="break-length" value="">
<!-- Add buttons for starting and resetting the timer -->
<button class="to" id="start">Start</button>
<button class="to" id="reset" type="submit" onClick="refreshPage()">Reset</button>
<button class="to" id="skip-break">Break</button>
<button class="ri" onclick="changeBackground()">ㅤㅤㅤㅤㅤ</button>
<script>
function refreshPage(){
window.location.reload();
}
// Get references to the timer display, input fields, and buttons
const timerDisplay = document.getElementById('timer');
const pomodoroInput = document.getElementById('pomodoro-length');
const breakInput = document.getElementById('break-length');
const startButton = document.getElementById('start');
const resetButton = document.getElementById('reset');
// Set the initial state of the timer
let isRunning = false;
let timeLeft = 0; // time left in seconds
let timerType = 'Pomodoro'; // can be 'Pomodoro' or 'Break'
// Function to display the time left in the timer
function displayTimeLeft() {
// Convert the time left in seconds to minutes and seconds
const minutes = Math.floor(timeLeft / 60);
const seconds = timeLeft % 60;
const progressBar = document.getElementById('progress-bar');
const totalTime = pomodoroInput.value * 60; // total time in seconds
const progress = (totalTime - timeLeft) / totalTime;
progressBar.style.width = `${100 - progress * 100}%`;
if (timeLeft >= 0) {
timerDisplay.textContent = timeLeft;
}
else {
timeLeft = 0;
timerDisplay.textContent = timeLeft;
clearInterval(interval); // stop the timer
}
// Display the time left in the timer display
timerDisplay.textContent = `${minutes}:${seconds}`;
}
// Function to start the timer
function startTimer() {
// Set the timer to be running
isRunning = true;
// Get the length of the Pomodoro and break timers from the input fields
const pomodoroLength = pomodoroInput.value * 60;
const breakLength = breakInput.value * 60;
const skipBreakButton = document.getElementById('skip-break');
skipBreakButton.addEventListener('click', skipToBreak);
// Set the time left based on the current timer type
if (timerType === 'Pomodoro') {
timeLeft = pomodoroLength;
} else {
timeLeft = breakLength;
}
// Update the timer display every 1000 milliseconds (1 second)
interval = setInterval(() => {
// Decrement the time left
timeLeft--;
// Display the updated time left
displayTimeLeft();
// If the timer has reached 0, reset it and switch to the other type of timer
if (timeLeft === 0) {
resetTimer();
if (timerType === 'Pomodoro') {
timerType = 'Break';
timeLeft = breakLength;
} else {
timerType = 'Pomodoro';
timeLeft = pomodoroLength;
}
}
}, 1000);
}
// Function to reset the timer
function resetTimer() {
// Set the timer to be not running
isRunning = false;
// Reset the time left to 0
timeLeft = 0;
// Display the reset time
displayTimeLeft();
}
function skipToBreak() {
// Set the timer to be running
isRunning = true;
// Set the time left to the break length
timeLeft = breakInput.value * 60;
// Set the timer type to be break
timerType = 'Break';
// Display the time left in the timer
displayTimeLeft();
// Start the timer countdown
interval = setInterval(() => {
// Decrement the time left
timeLeft--;
// Display the updated time left
displayTimeLeft();
// If the timer has reached 0, reset it and switch to the other type of timer
if (timeLeft === 0) {
resetTimer();
if (timerType === 'Pomodoro') {
timerType = 'Break';
timeLeft = breakLength;
} else {
timerType = 'Pomodoro';
timeLeft = pomodoroLength;
}
}
}, 10000);
}
// Add event listeners to the start and reset buttons
startButton.addEventListener('click', startTimer);
resetButton.addEventListener('click', resetTimer);
function closeWindow() {
const remote = (window.require) ? window.require("electron").remote : null;
const WIN = remote.getCurrentWindow();
WIN.close();
}
</script>
</div>
</body>
</html>