-
Notifications
You must be signed in to change notification settings - Fork 20
Expand file tree
/
Copy pathambient-sound-demo.html
More file actions
273 lines (248 loc) · 10.1 KB
/
ambient-sound-demo.html
File metadata and controls
273 lines (248 loc) · 10.1 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
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>FocusVerse - Ambient Sound Mixer Demo</title>
<link rel="stylesheet" href="backend/static/css/ambient-sound.css">
<style>
body {
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
margin: 0;
padding: 20px;
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
min-height: 100vh;
color: #333;
}
.demo-container {
max-width: 1200px;
margin: 0 auto;
background: rgba(255, 255, 255, 0.95);
border-radius: 20px;
padding: 30px;
box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}
.demo-header {
text-align: center;
margin-bottom: 30px;
}
.demo-title {
font-size: 2.5rem;
color: #333;
margin-bottom: 10px;
}
.demo-subtitle {
font-size: 1.2rem;
color: #666;
margin-bottom: 20px;
}
.demo-features {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
gap: 20px;
margin-bottom: 30px;
}
.feature-card {
background: #f8f9fa;
padding: 20px;
border-radius: 10px;
border-left: 4px solid #4CAF50;
}
.feature-title {
font-size: 1.3rem;
font-weight: 600;
color: #333;
margin-bottom: 10px;
}
.feature-description {
color: #666;
line-height: 1.6;
}
.demo-actions {
text-align: center;
margin-top: 30px;
}
.demo-btn {
background: #4CAF50;
color: white;
border: none;
padding: 15px 30px;
border-radius: 8px;
font-size: 1.1rem;
font-weight: 600;
cursor: pointer;
text-decoration: none;
display: inline-block;
margin: 0 10px;
transition: all 0.3s ease;
}
.demo-btn:hover {
background: #45a049;
transform: translateY(-2px);
}
.demo-btn.secondary {
background: #6c757d;
}
.demo-btn.secondary:hover {
background: #5a6268;
}
.mixer-demo {
position: relative;
height: 500px;
background: #f8f9fa;
border-radius: 10px;
overflow: hidden;
}
.demo-note {
background: #e3f2fd;
border: 1px solid #2196f3;
border-radius: 8px;
padding: 15px;
margin: 20px 0;
color: #1565c0;
}
.demo-note strong {
color: #0d47a1;
}
</style>
</head>
<body>
<div class="demo-container">
<div class="demo-header">
<h1 class="demo-title">🎵 Ambient Sound Mixer</h1>
<p class="demo-subtitle">Create your perfect focus atmosphere with customizable ambient sounds</p>
</div>
<div class="demo-features">
<div class="feature-card">
<h3 class="feature-title">🎚️ Volume Control</h3>
<p class="feature-description">
Fine-tune each ambient sound with individual volume sliders.
Mix rain, forest, cafe, and more to create your ideal focus environment.
</p>
</div>
<div class="feature-card">
<h3 class="feature-title">💾 Save Favorites</h3>
<p class="feature-description">
Save your favorite sound combinations as custom mixes.
Quickly switch between different atmospheres for various tasks.
</p>
</div>
<div class="feature-card">
<h3 class="feature-title">⏰ Auto-Start Timer</h3>
<p class="feature-description">
Automatically start your ambient sounds when the focus timer begins.
Seamlessly integrate with your productivity workflow.
</p>
</div>
<div class="feature-card">
<h3 class="feature-title">🌧️ Rich Sound Library</h3>
<p class="feature-description">
Choose from rain, forest, cafe, fireplace, ocean, typing, thunder, and wind sounds.
Each carefully selected for optimal focus enhancement.
</p>
</div>
</div>
<div class="demo-note">
<strong>Note:</strong> This is a demo of the Ambient Sound Mixer feature.
The actual sound files are not included in this demo, but the interface and functionality
are fully implemented and ready to use with real audio files.
</div>
<div class="mixer-demo">
<div id="ambient-sound-container"></div>
</div>
<div class="demo-actions">
<a href="backend/templates/index.html" class="demo-btn">🚀 Try FocusVerse</a>
<a href="https://github.com/your-repo/focusverse" class="demo-btn secondary">📁 View Source</a>
</div>
</div>
<script src="backend/static/js/ambient-sound-mixer.js"></script>
<script>
// Demo-specific modifications
document.addEventListener('DOMContentLoaded', () => {
// Override the fetch to return demo data
const originalFetch = window.fetch;
window.fetch = function(url, options) {
if (url.includes('/api/ambient-sounds')) {
return Promise.resolve({
ok: true,
json: () => Promise.resolve({
rain: {
name: 'Rain',
icon: '🌧️',
description: 'Gentle rain sounds',
file: 'https://www.bensound.com/bensound-music/bensound-rain.mp3',
fallback: 'https://www.soundjay.com/misc/sounds/rain-01.mp3',
default_volume: 0.3
},
forest: {
name: 'Forest',
icon: '🌲',
description: 'Forest ambiance with birds',
file: 'https://www.bensound.com/bensound-music/bensound-forest.mp3',
fallback: 'https://www.soundjay.com/nature/sounds/forest-01.mp3',
default_volume: 0.4
},
cafe: {
name: 'Cafe',
icon: '☕',
description: 'Coffee shop atmosphere',
file: 'https://www.bensound.com/bensound-music/bensound-cafe.mp3',
fallback: 'https://www.soundjay.com/misc/sounds/cafe-01.mp3',
default_volume: 0.2
},
fire: {
name: 'Fireplace',
icon: '🔥',
description: 'Crackling fire sounds',
file: 'https://www.bensound.com/bensound-music/bensound-fire.mp3',
fallback: 'https://www.soundjay.com/misc/sounds/fire-01.mp3',
default_volume: 0.3
},
ocean: {
name: 'Ocean',
icon: '🌊',
description: 'Ocean waves',
file: 'https://www.bensound.com/bensound-music/bensound-ocean.mp3',
fallback: 'https://www.soundjay.com/nature/sounds/ocean-01.mp3',
default_volume: 0.4
},
typing: {
name: 'Typing',
icon: '⌨️',
description: 'Keyboard typing sounds',
file: 'https://www.bensound.com/bensound-music/bensound-typing.mp3',
fallback: 'https://www.soundjay.com/misc/sounds/typing-01.mp3',
default_volume: 0.2
},
thunder: {
name: 'Thunder',
icon: '⛈️',
description: 'Distant thunder',
file: 'https://www.bensound.com/bensound-music/bensound-thunder.mp3',
fallback: 'https://www.soundjay.com/nature/sounds/thunder-01.mp3',
default_volume: 0.3
},
wind: {
name: 'Wind',
icon: '💨',
description: 'Gentle wind sounds',
file: 'https://www.bensound.com/bensound-music/bensound-wind.mp3',
fallback: 'https://www.soundjay.com/nature/sounds/wind-01.mp3',
default_volume: 0.3
}
})
});
} else if (url.includes('/api/ambient-mixes')) {
return Promise.resolve({
ok: true,
json: () => Promise.resolve([])
});
}
return originalFetch.apply(this, arguments);
};
// Initialize the mixer
window.ambientSoundMixer = new AmbientSoundMixer();
});
</script>
</body>
</html>