-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwidget.html
More file actions
89 lines (84 loc) · 2.71 KB
/
Copy pathwidget.html
File metadata and controls
89 lines (84 loc) · 2.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
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Binaural Beats Widget</title>
<style>
body {
font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Helvetica Neue', Helvetica, Arial, sans-serif;
background: #f5f5f7;
margin: 0;
color: #1d1d1f;
text-align: center;
}
.widget {
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
height: 100vh;
padding: 16px;
background-color: #ffffff;
border-radius: 0;
}
.btn {
margin: 6px;
padding: 10px 16px;
background-color: #007aff;
color: white;
border: none;
border-radius: 8px;
cursor: pointer;
transition: all 0.2s ease;
font-size: 14px;
font-weight: 590;
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}
.btn:hover {
background-color: #0051d5;
transform: translateY(-1px);
}
.status {
margin-top: 12px;
font-size: 13px;
color: #515154;
font-weight: 500;
}
</style>
</head>
<body>
<div class="widget">
<div>
<button class="btn" onclick="startPreset('Focus Mode')">Focus Mode</button>
<button class="btn" onclick="startPreset('Deep Focus')">Deep Focus</button>
<button class="btn" onclick="startPreset('Alert Study')">Alert Study</button>
<button class="btn" onclick="startPreset('Calm Focus')">Calm Focus</button>
</div>
<button class="btn" onclick="stopAudio()">Stop</button>
<div class="status" id="statusDisplay">Status: Stopped</div>
</div>
<script>
function startPreset(preset) {
window.electronAPI.startPreset(preset);
}
function stopAudio() {
window.electronAPI.stopAudio();
}
window.electronAPI.getStatus().then(status => {
updateStatusDisplay(status);
});
window.electronAPI.onStatusUpdate((event, status) => {
updateStatusDisplay(status);
});
function updateStatusDisplay(status) {
const statusDisplay = document.getElementById('statusDisplay');
if (status.isPlaying) {
statusDisplay.textContent = `Status: Playing ${status.currentPreset}`;
} else {
statusDisplay.textContent = "Status: Stopped";
}
}
</script>
</body>
</html>