Skip to content

Commit 670e92f

Browse files
simonwclaude
andauthored
Reorder webcam results section: answer first, then scores, then buttons (#176)
Move the webcam controls below the bird detection result and score details so users see the most important information (is it a bird?) at the top of the results area. Co-authored-by: Claude <noreply@anthropic.com>
1 parent a63730e commit 670e92f

File tree

1 file changed

+18
-6
lines changed

1 file changed

+18
-6
lines changed

is-it-a-bird.html

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -222,6 +222,12 @@
222222
.webcam-container.active {
223223
display: block;
224224
}
225+
.webcam-bottom-controls {
226+
display: none;
227+
}
228+
.webcam-bottom-controls.active {
229+
display: block;
230+
}
225231
.video-wrapper {
226232
position: relative;
227233
overflow: hidden;
@@ -372,12 +378,6 @@ <h1>Is it a bird?</h1>
372378
<video id="webcam-video" autoplay playsinline></video>
373379
<div class="zoom-hint" id="zoom-hint">Pinch to zoom</div>
374380
</div>
375-
<div class="webcam-controls">
376-
<button class="webcam-btn start" id="start-camera-btn">Start Camera</button>
377-
<button class="webcam-btn stop" id="stop-camera-btn" style="display: none;">Stop Camera</button>
378-
<button class="webcam-btn switch" id="switch-camera-btn" style="display: none;">Switch Camera</button>
379-
</div>
380-
<div class="webcam-status" id="webcam-status"></div>
381381
</div>
382382

383383
<img id="preview" alt="Preview of uploaded image">
@@ -390,6 +390,15 @@ <h1>Is it a bird?</h1>
390390
<div id="result"></div>
391391
<div id="score-details"></div>
392392

393+
<div class="webcam-bottom-controls" id="webcam-bottom-controls">
394+
<div class="webcam-controls">
395+
<button class="webcam-btn start" id="start-camera-btn">Start Camera</button>
396+
<button class="webcam-btn stop" id="stop-camera-btn" style="display: none;">Stop Camera</button>
397+
<button class="webcam-btn switch" id="switch-camera-btn" style="display: none;">Switch Camera</button>
398+
</div>
399+
<div class="webcam-status" id="webcam-status"></div>
400+
</div>
401+
393402
<div class="footer">
394403
<p>This tool runs entirely in your browser using the <a href="https://huggingface.co/Xenova/clip-vit-base-patch32">Xenova/clip-vit-base-patch32</a> model. No images are uploaded to any server.</p>
395404
<p>Uses a threshold of 0.5 to determine if something is "likely a bird". The model compares the image against candidate labels: bird, animal, object, person, landscape.</p>
@@ -421,6 +430,7 @@ <h1>Is it a bird?</h1>
421430
const imageModeBtn = document.getElementById('image-mode-btn');
422431
const webcamModeBtn = document.getElementById('webcam-mode-btn');
423432
const webcamContainer = document.getElementById('webcam-container');
433+
const webcamBottomControls = document.getElementById('webcam-bottom-controls');
424434

425435
// Webcam elements
426436
const webcamVideo = document.getElementById('webcam-video');
@@ -647,13 +657,15 @@ <h1>Is it a bird?</h1>
647657
webcamModeBtn.classList.remove('active');
648658
dropzone.style.display = 'flex';
649659
webcamContainer.classList.remove('active');
660+
webcamBottomControls.classList.remove('active');
650661
stopWebcam();
651662
} else {
652663
webcamModeBtn.classList.add('active');
653664
imageModeBtn.classList.remove('active');
654665
dropzone.style.display = 'none';
655666
preview.style.display = 'none';
656667
webcamContainer.classList.add('active');
668+
webcamBottomControls.classList.add('active');
657669
// Reset result when switching to webcam
658670
document.body.classList.remove('is-bird', 'not-bird');
659671
result.style.display = 'none';

0 commit comments

Comments
 (0)