Spaces:
Running
Running
Add 3 files
Browse files- README.md +6 -4
- index.html +330 -19
- prompts.txt +1 -0
README.md
CHANGED
@@ -1,10 +1,12 @@
|
|
1 |
---
|
2 |
-
title:
|
3 |
-
emoji:
|
4 |
-
colorFrom:
|
5 |
colorTo: red
|
6 |
sdk: static
|
7 |
pinned: false
|
|
|
|
|
8 |
---
|
9 |
|
10 |
-
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
|
|
|
1 |
---
|
2 |
+
title: studyfocus
|
3 |
+
emoji: 🐳
|
4 |
+
colorFrom: yellow
|
5 |
colorTo: red
|
6 |
sdk: static
|
7 |
pinned: false
|
8 |
+
tags:
|
9 |
+
- deepsite
|
10 |
---
|
11 |
|
12 |
+
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
|
index.html
CHANGED
@@ -1,19 +1,330 @@
|
|
1 |
-
<!
|
2 |
-
<html>
|
3 |
-
|
4 |
-
|
5 |
-
|
6 |
-
|
7 |
-
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<!DOCTYPE html>
|
2 |
+
<html lang="en">
|
3 |
+
<head>
|
4 |
+
<meta charset="UTF-8">
|
5 |
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
6 |
+
<title>ZenFocus - Lofi Study Timer</title>
|
7 |
+
<script src="https://cdn.tailwindcss.com"></script>
|
8 |
+
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
|
9 |
+
<style>
|
10 |
+
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');
|
11 |
+
|
12 |
+
body {
|
13 |
+
font-family: 'Inter', sans-serif;
|
14 |
+
background-color: #0f172a;
|
15 |
+
color: #f8fafc;
|
16 |
+
transition: background-color 0.5s ease;
|
17 |
+
}
|
18 |
+
|
19 |
+
.timer-container {
|
20 |
+
box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
|
21 |
+
}
|
22 |
+
|
23 |
+
.progress-ring__circle {
|
24 |
+
transition: stroke-dashoffset 0.5s;
|
25 |
+
transform: rotate(-90deg);
|
26 |
+
transform-origin: 50% 50%;
|
27 |
+
}
|
28 |
+
|
29 |
+
.music-controls {
|
30 |
+
backdrop-filter: blur(10px);
|
31 |
+
background-color: rgba(15, 23, 42, 0.7);
|
32 |
+
}
|
33 |
+
|
34 |
+
.time-option:hover {
|
35 |
+
transform: scale(1.05);
|
36 |
+
transition: transform 0.2s ease;
|
37 |
+
}
|
38 |
+
|
39 |
+
.time-option.active {
|
40 |
+
background-color: #3b82f6;
|
41 |
+
color: white;
|
42 |
+
}
|
43 |
+
|
44 |
+
.glow {
|
45 |
+
animation: glow 2s infinite alternate;
|
46 |
+
}
|
47 |
+
|
48 |
+
@keyframes glow {
|
49 |
+
from {
|
50 |
+
box-shadow: 0 0 5px rgba(59, 130, 246, 0.5);
|
51 |
+
}
|
52 |
+
to {
|
53 |
+
box-shadow: 0 0 20px rgba(59, 130, 246, 0.8);
|
54 |
+
}
|
55 |
+
}
|
56 |
+
</style>
|
57 |
+
</head>
|
58 |
+
<body class="min-h-screen flex flex-col items-center justify-center p-4">
|
59 |
+
<div class="max-w-md w-full space-y-8">
|
60 |
+
<div class="text-center">
|
61 |
+
<h1 class="text-4xl font-bold mb-2 text-blue-400">ZenFocus</h1>
|
62 |
+
<p class="text-slate-300">Stay focused, stay productive</p>
|
63 |
+
</div>
|
64 |
+
|
65 |
+
<div class="timer-container bg-slate-800 rounded-2xl p-8 relative overflow-hidden">
|
66 |
+
<div class="absolute inset-0 bg-gradient-to-br from-blue-900/20 to-slate-900/50"></div>
|
67 |
+
|
68 |
+
<div class="relative z-10 flex flex-col items-center">
|
69 |
+
<div class="relative w-64 h-64 mb-8">
|
70 |
+
<svg class="w-full h-full" viewBox="0 0 100 100">
|
71 |
+
<circle
|
72 |
+
class="text-slate-700"
|
73 |
+
stroke-width="8"
|
74 |
+
stroke="currentColor"
|
75 |
+
fill="transparent"
|
76 |
+
r="40"
|
77 |
+
cx="50"
|
78 |
+
cy="50"
|
79 |
+
/>
|
80 |
+
<circle
|
81 |
+
class="progress-ring__circle text-blue-500"
|
82 |
+
stroke-width="8"
|
83 |
+
stroke-linecap="round"
|
84 |
+
stroke="currentColor"
|
85 |
+
fill="transparent"
|
86 |
+
r="40"
|
87 |
+
cx="50"
|
88 |
+
cy="50"
|
89 |
+
/>
|
90 |
+
</svg>
|
91 |
+
<div class="absolute inset-0 flex items-center justify-center flex-col">
|
92 |
+
<div id="time-display" class="text-5xl font-bold">25:00</div>
|
93 |
+
<div id="timer-state" class="text-blue-400 font-medium mt-2">Ready</div>
|
94 |
+
</div>
|
95 |
+
</div>
|
96 |
+
|
97 |
+
<div class="flex space-x-4 mb-8">
|
98 |
+
<button id="start-btn" class="bg-blue-600 hover:bg-blue-700 text-white px-6 py-3 rounded-full font-medium flex items-center glow">
|
99 |
+
<i class="fas fa-play mr-2"></i> Start
|
100 |
+
</button>
|
101 |
+
<button id="reset-btn" class="bg-slate-700 hover:bg-slate-600 text-white px-6 py-3 rounded-full font-medium flex items-center">
|
102 |
+
<i class="fas fa-redo mr-2"></i> Reset
|
103 |
+
</button>
|
104 |
+
</div>
|
105 |
+
|
106 |
+
<div class="w-full">
|
107 |
+
<h3 class="text-lg font-medium mb-4 text-center">Select Duration</h3>
|
108 |
+
<div class="grid grid-cols-3 gap-3">
|
109 |
+
<button class="time-option py-2 px-4 rounded-lg bg-slate-700 hover:bg-slate-600" data-minutes="15">15 min</button>
|
110 |
+
<button class="time-option py-2 px-4 rounded-lg bg-slate-700 hover:bg-slate-600 active" data-minutes="25">25 min</button>
|
111 |
+
<button class="time-option py-2 px-4 rounded-lg bg-slate-700 hover:bg-slate-600" data-minutes="45">45 min</button>
|
112 |
+
<button class="time-option py-2 px-4 rounded-lg bg-slate-700 hover:bg-slate-600" data-minutes="60">60 min</button>
|
113 |
+
<button class="time-option py-2 px-4 rounded-lg bg-slate-700 hover:bg-slate-600" data-minutes="90">90 min</button>
|
114 |
+
<button class="time-option py-2 px-4 rounded-lg bg-slate-700 hover:bg-slate-600" data-minutes="120">120 min</button>
|
115 |
+
</div>
|
116 |
+
</div>
|
117 |
+
</div>
|
118 |
+
</div>
|
119 |
+
|
120 |
+
<div class="music-controls rounded-xl p-4 border border-slate-700">
|
121 |
+
<div class="flex items-center justify-between">
|
122 |
+
<div class="flex items-center">
|
123 |
+
<i class="fas fa-music text-blue-400 mr-3 text-xl"></i>
|
124 |
+
<div>
|
125 |
+
<h3 class="font-medium">Lofi Study Beats</h3>
|
126 |
+
<p class="text-sm text-slate-400">Chill focus music</p>
|
127 |
+
</div>
|
128 |
+
</div>
|
129 |
+
<div class="flex items-center space-x-2">
|
130 |
+
<button id="volume-down" class="p-2 text-slate-300 hover:text-white">
|
131 |
+
<i class="fas fa-volume-down"></i>
|
132 |
+
</button>
|
133 |
+
<button id="play-music" class="p-2 text-slate-300 hover:text-white">
|
134 |
+
<i class="fas fa-play"></i>
|
135 |
+
</button>
|
136 |
+
<button id="volume-up" class="p-2 text-slate-300 hover:text-white">
|
137 |
+
<i class="fas fa-volume-up"></i>
|
138 |
+
</button>
|
139 |
+
</div>
|
140 |
+
</div>
|
141 |
+
<audio id="lofi-audio" loop>
|
142 |
+
<source src="https://stream.laut.fm/lofi" type="audio/mpeg">
|
143 |
+
Your browser does not support the audio element.
|
144 |
+
</audio>
|
145 |
+
</div>
|
146 |
+
|
147 |
+
<div class="text-center text-slate-500 text-sm mt-8">
|
148 |
+
<p>Take breaks between sessions for maximum productivity</p>
|
149 |
+
</div>
|
150 |
+
</div>
|
151 |
+
|
152 |
+
<script>
|
153 |
+
document.addEventListener('DOMContentLoaded', function() {
|
154 |
+
// Timer elements
|
155 |
+
const timeDisplay = document.getElementById('time-display');
|
156 |
+
const timerState = document.getElementById('timer-state');
|
157 |
+
const startBtn = document.getElementById('start-btn');
|
158 |
+
const resetBtn = document.getElementById('reset-btn');
|
159 |
+
const timeOptions = document.querySelectorAll('.time-option');
|
160 |
+
|
161 |
+
// Music elements
|
162 |
+
const playMusicBtn = document.getElementById('play-music');
|
163 |
+
const volumeUpBtn = document.getElementById('volume-up');
|
164 |
+
const volumeDownBtn = document.getElementById('volume-down');
|
165 |
+
const lofiAudio = document.getElementById('lofi-audio');
|
166 |
+
|
167 |
+
// Timer variables
|
168 |
+
let timer;
|
169 |
+
let totalSeconds = 25 * 60; // Default 25 minutes
|
170 |
+
let remainingSeconds = totalSeconds;
|
171 |
+
let isRunning = false;
|
172 |
+
let isMusicPlaying = false;
|
173 |
+
|
174 |
+
// Progress ring
|
175 |
+
const circle = document.querySelector('.progress-ring__circle');
|
176 |
+
const radius = circle.r.baseVal.value;
|
177 |
+
const circumference = 2 * Math.PI * radius;
|
178 |
+
circle.style.strokeDasharray = circumference;
|
179 |
+
circle.style.strokeDashoffset = circumference;
|
180 |
+
|
181 |
+
// Initialize timer display
|
182 |
+
updateTimerDisplay();
|
183 |
+
|
184 |
+
// Time selection
|
185 |
+
timeOptions.forEach(option => {
|
186 |
+
option.addEventListener('click', function() {
|
187 |
+
timeOptions.forEach(opt => opt.classList.remove('active'));
|
188 |
+
this.classList.add('active');
|
189 |
+
|
190 |
+
const minutes = parseInt(this.dataset.minutes);
|
191 |
+
totalSeconds = minutes * 60;
|
192 |
+
remainingSeconds = totalSeconds;
|
193 |
+
updateTimerDisplay();
|
194 |
+
updateProgressRing();
|
195 |
+
|
196 |
+
// Reset timer state
|
197 |
+
if (isRunning) {
|
198 |
+
clearInterval(timer);
|
199 |
+
isRunning = false;
|
200 |
+
startBtn.innerHTML = '<i class="fas fa-play mr-2"></i> Start';
|
201 |
+
timerState.textContent = 'Ready';
|
202 |
+
}
|
203 |
+
});
|
204 |
+
});
|
205 |
+
|
206 |
+
// Start/Pause timer
|
207 |
+
startBtn.addEventListener('click', function() {
|
208 |
+
if (isRunning) {
|
209 |
+
// Pause timer
|
210 |
+
clearInterval(timer);
|
211 |
+
isRunning = false;
|
212 |
+
this.innerHTML = '<i class="fas fa-play mr-2"></i> Resume';
|
213 |
+
timerState.textContent = 'Paused';
|
214 |
+
|
215 |
+
// Pause music if playing
|
216 |
+
if (isMusicPlaying) {
|
217 |
+
lofiAudio.pause();
|
218 |
+
playMusicBtn.innerHTML = '<i class="fas fa-play"></i>';
|
219 |
+
isMusicPlaying = false;
|
220 |
+
}
|
221 |
+
} else {
|
222 |
+
// Start timer
|
223 |
+
isRunning = true;
|
224 |
+
this.innerHTML = '<i class="fas fa-pause mr-2"></i> Pause';
|
225 |
+
timerState.textContent = 'Focusing...';
|
226 |
+
|
227 |
+
// Start music if not already playing
|
228 |
+
if (!isMusicPlaying) {
|
229 |
+
lofiAudio.play().catch(e => console.log("Autoplay prevented:", e));
|
230 |
+
playMusicBtn.innerHTML = '<i class="fas fa-pause"></i>';
|
231 |
+
isMusicPlaying = true;
|
232 |
+
}
|
233 |
+
|
234 |
+
timer = setInterval(() => {
|
235 |
+
if (remainingSeconds > 0) {
|
236 |
+
remainingSeconds--;
|
237 |
+
updateTimerDisplay();
|
238 |
+
updateProgressRing();
|
239 |
+
} else {
|
240 |
+
// Timer completed
|
241 |
+
clearInterval(timer);
|
242 |
+
isRunning = false;
|
243 |
+
startBtn.innerHTML = '<i class="fas fa-play mr-2"></i> Start';
|
244 |
+
timerState.textContent = 'Completed!';
|
245 |
+
document.querySelector('.timer-container').classList.add('animate-pulse');
|
246 |
+
|
247 |
+
// Play completion sound
|
248 |
+
const audio = new Audio('https://assets.mixkit.co/sfx/preview/mixkit-alarm-digital-clock-beep-989.mp3');
|
249 |
+
audio.play();
|
250 |
+
|
251 |
+
// Stop music
|
252 |
+
lofiAudio.pause();
|
253 |
+
playMusicBtn.innerHTML = '<i class="fas fa-play"></i>';
|
254 |
+
isMusicPlaying = false;
|
255 |
+
}
|
256 |
+
}, 1000);
|
257 |
+
}
|
258 |
+
});
|
259 |
+
|
260 |
+
// Reset timer
|
261 |
+
resetBtn.addEventListener('click', function() {
|
262 |
+
clearInterval(timer);
|
263 |
+
isRunning = false;
|
264 |
+
remainingSeconds = totalSeconds;
|
265 |
+
updateTimerDisplay();
|
266 |
+
updateProgressRing();
|
267 |
+
startBtn.innerHTML = '<i class="fas fa-play mr-2"></i> Start';
|
268 |
+
timerState.textContent = 'Ready';
|
269 |
+
document.querySelector('.timer-container').classList.remove('animate-pulse');
|
270 |
+
|
271 |
+
// Stop music
|
272 |
+
lofiAudio.pause();
|
273 |
+
playMusicBtn.innerHTML = '<i class="fas fa-play"></i>';
|
274 |
+
isMusicPlaying = false;
|
275 |
+
});
|
276 |
+
|
277 |
+
// Music controls
|
278 |
+
playMusicBtn.addEventListener('click', function() {
|
279 |
+
if (isMusicPlaying) {
|
280 |
+
lofiAudio.pause();
|
281 |
+
this.innerHTML = '<i class="fas fa-play"></i>';
|
282 |
+
isMusicPlaying = false;
|
283 |
+
} else {
|
284 |
+
lofiAudio.play().catch(e => console.log("Play prevented:", e));
|
285 |
+
this.innerHTML = '<i class="fas fa-pause"></i>';
|
286 |
+
isMusicPlaying = true;
|
287 |
+
}
|
288 |
+
});
|
289 |
+
|
290 |
+
volumeUpBtn.addEventListener('click', function() {
|
291 |
+
if (lofiAudio.volume < 0.9) {
|
292 |
+
lofiAudio.volume += 0.1;
|
293 |
+
}
|
294 |
+
});
|
295 |
+
|
296 |
+
volumeDownBtn.addEventListener('click', function() {
|
297 |
+
if (lofiAudio.volume > 0.1) {
|
298 |
+
lofiAudio.volume -= 0.1;
|
299 |
+
}
|
300 |
+
});
|
301 |
+
|
302 |
+
// Helper functions
|
303 |
+
function updateTimerDisplay() {
|
304 |
+
const minutes = Math.floor(remainingSeconds / 60);
|
305 |
+
const seconds = remainingSeconds % 60;
|
306 |
+
timeDisplay.textContent = `${minutes.toString().padStart(2, '0')}:${seconds.toString().padStart(2, '0')}`;
|
307 |
+
}
|
308 |
+
|
309 |
+
function updateProgressRing() {
|
310 |
+
const offset = circumference - (remainingSeconds / totalSeconds) * circumference;
|
311 |
+
circle.style.strokeDashoffset = offset;
|
312 |
+
}
|
313 |
+
|
314 |
+
// Try to autoplay music (may be blocked by browser)
|
315 |
+
lofiAudio.volume = 0.5;
|
316 |
+
document.addEventListener('click', function initAudio() {
|
317 |
+
// This is needed to unlock audio on mobile devices
|
318 |
+
lofiAudio.play().then(() => {
|
319 |
+
lofiAudio.pause();
|
320 |
+
playMusicBtn.innerHTML = '<i class="fas fa-play"></i>';
|
321 |
+
isMusicPlaying = false;
|
322 |
+
}).catch(e => {
|
323 |
+
console.log("Audio initialization failed:", e);
|
324 |
+
});
|
325 |
+
document.removeEventListener('click', initAudio);
|
326 |
+
}, { once: true });
|
327 |
+
});
|
328 |
+
</script>
|
329 |
+
<p style="border-radius: 8px; text-align: center; font-size: 12px; color: #fff; margin-top: 16px;position: fixed; left: 8px; bottom: 8px; z-index: 10; background: rgba(0, 0, 0, 0.8); padding: 4px 8px;">Made with <img src="https://enzostvs-deepsite.hf.space/logo.svg" alt="DeepSite Logo" style="width: 16px; height: 16px; vertical-align: middle;display:inline-block;margin-right:3px;filter:brightness(0) invert(1);"><a href="https://enzostvs-deepsite.hf.space" style="color: #fff;text-decoration: underline;" target="_blank" >DeepSite</a> - 🧬 <a href="https://enzostvs-deepsite.hf.space?remix=PyQuarX/studyfocus" style="color: #fff;text-decoration: underline;" target="_blank" >Remix</a></p></body>
|
330 |
+
</html>
|
prompts.txt
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
create a website where you make a focus timer for when studying when you choose a duration and there's background lofi music when activate the timer
|