-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
121 lines (105 loc) · 4.54 KB
/
Copy pathindex.html
File metadata and controls
121 lines (105 loc) · 4.54 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>SoundCount</title>
<link rel="manifest" href="manifest.json">
<meta name="theme-color" content="#4caf50">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
<meta name="apple-mobile-web-app-title" content="SoundCount">
<link rel="apple-touch-icon" href="icons/icon-192.png">
<link rel="stylesheet" href="style.css">
</head>
<body>
<div id="app">
<!-- ===== Header ===== -->
<header>
<h1>SoundCount</h1>
<div id="status" class="status-idle">
<span class="dot"></span>
<span id="status-text">Ready</span>
</div>
</header>
<!-- ===== Body (counter + settings side by side on desktop) ===== -->
<div id="body-layout">
<!-- ===== Counter panel ===== -->
<main id="counter-panel">
<div id="counter-section">
<button id="btn-dec" class="adjust-btn" aria-label="Decrease count">−</button>
<div id="count-display">
<span id="count-number">0</span>
</div>
<button id="btn-inc" class="adjust-btn" aria-label="Increase count">+</button>
</div>
<div id="progress-section">
<div id="progress-bar-wrap" role="progressbar" aria-valuemin="0" aria-valuemax="100" aria-valuenow="0">
<div id="progress-bar"></div>
</div>
<div id="target-label">No target set</div>
</div>
<div id="level-wrap" title="Microphone level">
<div id="level-bar"></div>
</div>
</main>
<!-- ===== Settings panel ===== -->
<section id="settings-panel">
<!-- Mode tabs -->
<div id="mode-tabs" role="tablist" aria-label="Detection mode">
<button class="tab-btn active" data-mode="generic" role="tab" aria-selected="true">Generic</button>
<button class="tab-btn" data-mode="matched" role="tab" aria-selected="false">Matched</button>
</div>
<!-- Mode descriptions -->
<div id="generic-info" class="mode-info" role="tabpanel">
Counts any sharp, loud sound event (clap, knock, …).
</div>
<div id="matched-info" class="mode-info hidden" role="tabpanel">
<button id="btn-record" class="record-btn">🎙 Record Sample (3 s)</button>
<div id="sample-status" class="sample-status">No sample recorded yet</div>
</div>
<!-- Sensitivity -->
<div class="setting-row">
<label for="sensitivity">Sensitivity <output id="sensitivity-out" for="sensitivity">5</output></label>
<input type="range" id="sensitivity" min="1" max="10" value="5">
</div>
<!-- Minimum interval -->
<div class="setting-row">
<label for="cooldown">Min. interval <output id="cooldown-out" for="cooldown">500 ms</output></label>
<input type="range" id="cooldown" min="100" max="2000" step="50" value="500">
</div>
<!-- Match threshold (matched mode only) -->
<div class="setting-row hidden" id="similarity-row">
<label for="similarity">Match threshold <output id="similarity-out" for="similarity">80 %</output></label>
<input type="range" id="similarity" min="40" max="98" value="80">
</div>
<!-- Target -->
<div class="setting-row">
<label for="target-input">Target</label>
<div class="target-input-group">
<input type="number" id="target-input" min="1" max="99999" placeholder="—" inputmode="numeric">
<button id="btn-clear-target" class="small-btn" title="Clear target">✕</button>
</div>
</div>
<!-- Action buttons -->
<div id="action-row">
<button id="btn-reset" class="secondary-btn">Reset</button>
<button id="btn-toggle" class="primary-btn">▶ Start</button>
</div>
</section>
</div><!-- #body-layout -->
</div><!-- #app -->
<!-- ===== Recording overlay ===== -->
<div id="recording-overlay" class="hidden" role="dialog" aria-modal="true" aria-label="Recording reference sample">
<div id="recording-box">
<div id="recording-timer" aria-live="polite">3</div>
<p>Make the sound you want to count…</p>
<div id="rec-level-wrap">
<div id="rec-level-bar"></div>
</div>
<button id="btn-cancel-rec" class="cancel-btn">Cancel</button>
</div>
</div>
<script src="app.js"></script>
</body>
</html>