-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
195 lines (181 loc) · 7.08 KB
/
index.html
File metadata and controls
195 lines (181 loc) · 7.08 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no, maximum-scale=1.0">
<meta name="theme-color" content="#16213e">
<meta name="description" content="Automatic bird detection and recording using AI">
<title>Bird Watcher</title>
<link rel="icon" href="icons/favicon.ico" type="image/x-icon">
<link rel="manifest" href="manifest.json">
<link rel="apple-touch-icon" href="icons/icon-192.png">
<link rel="stylesheet" href="style.css">
</head>
<body>
<!-- Camera View -->
<div id="camera-view" class="view">
<div id="video-container">
<canvas id="detection-overlay"></canvas>
</div>
<div class="overlay-top">
<div class="status-container">
<div id="status-indicator" class="status-indicator idle"></div>
<span id="status-text">Initializing...</span>
</div>
<div id="bird-status" class="bird-status">Not detecting</div>
<button id="toggle-btn" class="btn btn-icon toggle-btn">⏸</button>
</div>
<div class="overlay-bottom">
<button id="stop-btn" class="btn btn-danger hidden">
<span class="icon">⏹</span>
<span>Stop & Save</span>
</button>
<button id="review-btn" class="btn btn-primary">
<span class="icon">📁</span>
<span>Review</span>
<span id="clip-count" class="badge">0</span>
</button>
<button id="settings-btn" class="btn btn-secondary">
<span class="icon">⚙</span>
</button>
</div>
<!-- Settings Panel -->
<div id="settings-panel" class="settings-panel hidden">
<div class="settings-content">
<div class="settings-header">
<h2>Settings</h2>
<button id="close-settings-btn" class="btn btn-icon">✕</button>
</div>
<div class="settings-body">
<div class="setting-row">
<label for="show-logs">Show debug logs</label>
<input type="checkbox" id="show-logs">
</div>
<div class="setting-row">
<label for="bitrate">Video bitrate</label>
<select id="bitrate">
<option value="1000000">1 Mbps (~7 MB/min)</option>
<option value="2500000" selected>2.5 Mbps (~18 MB/min)</option>
<option value="5000000">5 Mbps (~37 MB/min)</option>
<option value="8000000">8 Mbps (~60 MB/min)</option>
</select>
</div>
<div class="setting-row">
<label for="sensitivity">Detection sensitivity</label>
<select id="sensitivity">
<option value="0.15">Very high (more false positives)</option>
<option value="0.25">High</option>
<option value="0.35" selected>Medium</option>
<option value="0.50">Low (only obvious birds)</option>
</select>
</div>
<div class="setting-row">
<label for="tile-grid">Scan detail</label>
<select id="tile-grid">
<option value="1">1x1 (fastest, large birds only)</option>
<option value="2">2x2 (balanced)</option>
<option value="3" selected>3x3 (best for small birds)</option>
</select>
</div>
<div class="setting-row">
<label for="max-duration">Max clip length</label>
<select id="max-duration">
<option value="60000">1 min</option>
<option value="300000">5 min</option>
<option value="600000" selected>10 min</option>
<option value="1800000">30 min</option>
<option value="0">No limit</option>
</select>
</div>
<div class="setting-row">
<label>Clear cache & reload [dev only]</label>
<button id="clear-cache-btn" class="btn btn-secondary btn-small">Clear</button>
</div>
<div class="setting-row">
<label id="version-label" style="font-size: 11px; opacity: 0.5;">v21</label>
</div>
</div>
</div>
</div>
</div>
<!-- Review View -->
<div id="review-view" class="view hidden">
<header class="header">
<button id="back-btn" class="btn btn-icon">←</button>
<h1>Recorded Clips</h1>
<span id="storage-info" class="storage-info">0 clips</span>
</header>
<div id="clips-grid" class="clips-grid">
<p class="empty-message">No clips recorded yet</p>
</div>
</div>
<!-- Player View -->
<div id="player-view" class="view hidden">
<header class="header">
<button id="close-player-btn" class="btn btn-icon">←</button>
<h1>Playback</h1>
<div class="header-actions">
<button id="player-share-btn" class="btn btn-icon">📤</button>
<button id="player-download-btn" class="btn btn-icon">⬇</button>
</div>
</header>
<div class="player-container">
<video id="video-player" controls playsinline></video>
</div>
<div class="player-actions">
<button id="download-btn" class="btn btn-secondary">
<span class="icon">⬇</span> Download
</button>
<button id="delete-btn" class="btn btn-danger">
<span class="icon">🗑</span> Delete
</button>
</div>
</div>
<!-- Welcome Popup -->
<div id="welcome-popup" class="welcome-popup hidden">
<div class="welcome-content">
<img src="icons/icon-192.png" alt="Bird Watcher" class="welcome-icon">
<h2>Welcome to Bird Watcher</h2>
<div class="welcome-body">
<p><strong>How it works:</strong></p>
<ul>
<li>Point your camera at a bird feeder</li>
<li>App auto-detects birds using AI</li>
<li>Recording starts when a bird appears</li>
<li>Stops 10 seconds after bird leaves</li>
</ul>
<p><strong>Privacy:</strong></p>
<ul>
<li>Completely local - nothing sent to servers</li>
<li>Videos saved on your phone only</li>
<li>Save to Photos from the Review page</li>
</ul>
<p><strong>Tips:</strong></p>
<ul>
<li>Drag the detection zone to your feeder</li>
<li>Small birds are detected using tiled scanning across the full frame</li>
<li>Tap pause button to stop detecting</li>
</ul>
</div>
<button id="welcome-close-btn" class="btn btn-primary">Got it!</button>
</div>
</div>
<!-- TensorFlow.js and COCO-SSD from CDN -->
<script src="https://cdn.jsdelivr.net/npm/@tensorflow/tfjs@4.10.0/dist/tf.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/@tensorflow-models/coco-ssd@2.2.3/dist/coco-ssd.min.js"></script>
<!-- App modules -->
<script type="module" src="src/app.js"></script>
<script>
// Remove any lingering service workers — we don't need offline caching
if ('serviceWorker' in navigator) {
navigator.serviceWorker.getRegistrations().then(regs => {
regs.forEach(reg => reg.unregister());
});
// Clear old caches too
if ('caches' in window) {
caches.keys().then(names => names.forEach(n => caches.delete(n)));
}
}
</script>
</body>
</html>