-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
255 lines (230 loc) · 9.71 KB
/
Copy pathindex.html
File metadata and controls
255 lines (230 loc) · 9.71 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
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
<!DOCTYPE html>
<html lang="en">
<head>
<!-- Google tag (gtag.js) -->
<script async src="https://www.googletagmanager.com/gtag/js?id=G-VVXC65YW6G"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag() { dataLayer.push(arguments); }
gtag('js', new Date());
gtag('config', 'G-VVXC65YW6G');
</script>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>3.3 Rule Timer</title>
<link rel="icon" sizes="16x16 24x24 32x32 64x64" href="https://cdn.keyqcloud.com/keyq/logo/favicon/favicon.ico">
<link rel="icon" type="image/png" sizes="32x32"
href="https://cdn.keyqcloud.com/keyq/logo/favicon/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="16x16"
href="https://cdn.keyqcloud.com/keyq/logo/favicon/favicon-16x16.png">
<link rel="icon" type="image/png" sizes="48x48"
href="https://cdn.keyqcloud.com/keyq/logo/favicon/favicon-48x48.png">
<link rel="icon" type="image/png" sizes="192x192"
href="https://cdn.keyqcloud.com/keyq/logo/favicon/favicon-192x192.png">
<link rel="apple-touch-icon" type="image/png" sizes="180x180"
href="https://cdn.keyqcloud.com/keyq/logo/favicon/favicon-180x180.png">
<link rel="apple-touch-icon" type="image/png" sizes="167x167"
href="https://cdn.keyqcloud.com/keyq/logo/favicon/favicon-167x167.png">
<link rel="apple-touch-icon" type="image/png" sizes="152x152"
href="https://cdn.keyqcloud.com/keyq/logo/favicon/favicon-152x152.png">
<link rel="manifest" href="https://cdn.keyqcloud.com/keyq/logo/favicon/manifest.json">
<style>
body {
font-family: Arial, sans-serif;
background-color: #f4f4f4;
text-align: center;
}
.container {
width: 60%;
margin: auto;
background: white;
padding: 20px;
box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}
#keyq_logo {
width: 60%;
margin: 0 auto;
}
#countdownTimer {
font-family: Arial, sans-serif;
display: flex;
justify-content: center;
align-items: center;
}
#countdownTimer .timer-container {
text-align: center;
}
#countdownTimer select,
#countdownTimer button {
margin: 10px;
padding: 10px;
font-size: 16px;
}
#timerLabel {
font-size: 24px;
color: #333;
}
#countdownDisplay {
font-size: 48px;
color: #333;
}
#countdownWrapper {
margin: 20px 0;
}
#explanation-wrapper {
width: 70%;
margin: 0 auto;
}
footer {
background-color: #333;
color: #fff;
text-align: center;
padding: 20px 0;
margin-top: 30px;
}
.footer-container {
width: 80%;
margin: auto;
}
footer p {
font-size: 14px;
line-height: 1.6;
}
</style>
</head>
<body>
<div class="container">
<a href="https://www.keyq.cloud" target="_blank"><img id="keyq_logo"
src="https://cdn.keyqcloud.com/keyq/logo/keyq_logo_horizontal_light.png" /></a>
<div id="countdownTimer">
<div class="timer-container">
<h1 style="display:block">3.3 Rule Timer</h1>
<select id="timeSelect">
<option value="30">30 min</option>
<option value="60">1 hr</option>
<option value="90">1.5 hrs</option>
<option value="120">2 hrs</option>
<option value="180">3 hrs</option>
</select>
<button id="startButton">Start Timer</button>
<button id="pauseButton">Pause Timer</button>
<div id="countdownWrapper">
<span id="timerLabel"></span> <span id="countdownDisplay"></span>
</div>
<div id="explanation-wrapper">
<div class="rule-explanation">
<h2>About the 3.3 Rule</h2>
<p>
The 3.3 Rule, conceptualized by John Briggs, is a method to enhance productivity and prevent
burnout. It involves working for up to three hours, followed by a recovery period of about 30%
of the work time.
<a href="https://33rulebook.com/" target="_blank">Learn more about the 3.3 Rule</a>.
</p>
</div>
<div class="keyq-explanation">
<h2>About KeyQ</h2>
<p>
This timer tool was developed and made available by <a href="https://www.keyq.cloud"
target="_blank">KeyQ</a> to help entrepreneurs and professionals effectively implement the
3.3 Rule in their daily routines. Empower your productivity journey with KeyQ's innovative
solutions.
</p>
</div>
</div>
</div>
</div>
</div>
<footer>
<div class="footer-container">
<p>Disclaimer: The tools provided on this site are for informational purposes only. Use them at your own risk. KeyQ, Inc. is not responsible for any consequences arising from their use.</p>
<p>© 2020-2024 KeyQ, Inc. All rights reserved.</p>
</div>
</footer>
<script>
let isPaused = false;
let timerInterval;
let remainingTime;
let isInWorkSession = true; // Tracks if the current session is work or recovery
var workTime = 0.0; // convert minutes to milliseconds
var recoveryTime = 0.0; // 30% of work time
document.addEventListener('DOMContentLoaded', (event) => {
const alarmSound = new Audio('https://33ruletimer.keyq.cloud/alarm.mp3');
const startButton = document.getElementById('startButton');
const pauseButton = document.getElementById('pauseButton');
startButton.addEventListener('click', () => {
const selectedTime = parseFloat(document.getElementById('timeSelect').value);
workTime = selectedTime * 60 * 1000; // convert minutes to milliseconds
recoveryTime = workTime * 0.3; // 30% of work time
isPaused = false;
isInWorkSession = true;
remainingTime = workTime;
startButton.textContent = 'Restart Timer';
pauseButton.textContent = 'Pause Timer';
clearInterval(timerInterval);
updateLabel('Work Period');
startTimer(workTime, recoveryTime);
});
pauseButton.addEventListener('click', () => {
isPaused = !isPaused;
pauseButton.textContent = isPaused ? 'Resume Timer' : 'Pause Timer';
if (isPaused) {
clearInterval(timerInterval);
} else {
// Resume the timer from where it was paused
startTimer(remainingTime, isInWorkSession ? recoveryTime : remainingTime);
}
});
function startTimer(duration, recoveryDuration) {
remainingTime = duration;
timerInterval = setInterval(() => {
if (isPaused) {
clearInterval(timerInterval);
return;
}
if (remainingTime <= 0) {
playSoundForDuration(3);
clearInterval(timerInterval);
if (isInWorkSession) {
alert('Work period complete. Start recovery.');
isInWorkSession = false;
remainingTime = recoveryDuration;
startTimer(recoveryDuration, recoveryDuration);
updateLabel('Recovery Period');
} else {
alert('Recovery period complete. Ready for next session.');
isInWorkSession = true; // Reset for next session
}
return;
}
updateDisplay(remainingTime);
remainingTime -= 1000;
}, 1000);
}
function updateDisplay(time) {
const minutes = Math.floor(time / 60000);
const seconds = Math.floor((time % 60000) / 1000);
document.getElementById('countdownDisplay').textContent =
`${minutes}:${seconds < 10 ? '0' : ''}${seconds}`;
}
function updateLabel(text) {
const label = document.getElementById('timerLabel');
if (label) {
label.textContent = text;
}
if (text === 'Work Period') {
startButton.textContent = 'Restart Timer';
} else {
startButton.textContent = 'Start Timer';
}
}
function playSoundForDuration(durationInSeconds) {
alarmSound.play();
setTimeout(() => {
alarmSound.pause();
alarmSound.currentTime = 0;
}, durationInSeconds * 1000);
}
});
</script>
</body>
</html>