Skip to content

Commit 8ed2cb1

Browse files
committed
UI fixes encountered while testing
Main fixes: - Reduce head size when video is in portrait mode. (Size was based on video width only, not it's on both width and height.) - Fix VideoReview styling (centering, constrained width) when shown outside a lesson. - Audio: counting down for step training was too fast.
1 parent a34be28 commit 8ed2cb1

File tree

3 files changed

+16
-12
lines changed

3 files changed

+16
-12
lines changed

bouncy_frontend/src/lib/components/review/VideoReview.svelte

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@
5454
$: beatsPerStep =
5555
detectedSteps.length > 0 ? detectedSteps[0].poses.length : 4;
5656
$: avatarSizePixels = videoSrcHeight;
57-
$: headRadius = 0.075 * videoSrcHeight;
57+
$: headRadius = 0.075 * Math.min(videoSrcHeight, videoSrcWidth);
5858
let markedSegments = [];
5959
$: if (keypointSkeleton) {
6060
markedSegments = limbErrors.map((limb) => limb.render(keypointSkeleton));
@@ -359,13 +359,15 @@ once per 250ms. -->
359359
.poses-details {
360360
display: flex;
361361
overflow-x: auto;
362+
max-width: 100%;
362363
}
363364
364365
.background-strip {
365366
margin: 10px -25px;
366367
padding: 10px 30px;
367368
border-radius: 10px;
368369
box-shadow: 0px 0px 8px rgba(0, 0, 0, 0.55);
370+
text-align: center;
369371
}
370372
371373
.beat-label {

bouncy_frontend/src/routes/collection/step/[stepName]/[recordMode]/+page.svelte

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,8 @@
2424
const tracker = Tracker.UniqueStepTracker(instructorStep.id);
2525
registerTracker(tracker);
2626
setBpm(120);
27-
setHalfSpeed(isLearnMode);
27+
// setHalfSpeed(isLearnMode);
28+
setHalfSpeed(true);
2829
2930
const userCtx = getContext('user');
3031
@@ -132,7 +133,7 @@
132133
if (isLearnMode) {
133134
showLearnModeHint.set(true);
134135
showLearnModeHint.subscribe((hintShown) => {
135-
if (!$showLearnModeHint && isLearnMode && !isModelOn) {
136+
if (!$showLearnModeHint && !hintShown && !isModelOn) {
136137
turnOnRecording();
137138
}
138139
});
@@ -141,7 +142,7 @@
141142
if (isTrainMode) {
142143
showTrainModeHint.set(true);
143144
showTrainModeHint.subscribe((hintShown) => {
144-
if (!$showTrainModeHint && isTrainMode && !isModelOn) {
145+
if (!$showTrainModeHint && !hintShown && !isModelOn) {
145146
turnOnRecording();
146147
}
147148
});
@@ -169,10 +170,10 @@
169170
></VideoReview>
170171
<div>
171172
<a href={reviewVideoSrc} download>
172-
<Button class="light" symbol="download" text="record.download" />
173+
<Button class="light wide" symbol="download" text="record.download" />
173174
</a>
174175
<Button
175-
class="light"
176+
class="light wide"
176177
on:click={closeReview}
177178
symbol="arrow_back"
178179
text="record.back-button"
@@ -187,19 +188,19 @@
187188
</div>
188189
<div class="buttons">
189190
<Button
190-
class="light"
191+
class="light wide"
191192
on:click={openReview}
192193
symbol="tv"
193194
text="record.review-button"
194195
/>
195196
<Button
196-
class="light"
197+
class="light wide"
197198
on:click={reset}
198199
symbol="videocam"
199200
text="record.reset-button"
200201
/>
201202
<Button
202-
class="light"
203+
class="light wide"
203204
on:click={goBackToStep}
204205
symbol="arrow_back"
205206
text="record.back-button"
@@ -223,8 +224,9 @@
223224
<div>
224225
<Button
225226
on:click={stopCameraAndRecording}
227+
class="light wide"
226228
symbol="camera"
227-
text="record.stop-button"
229+
text="record.stop-record"
228230
/>
229231
</div>
230232
<LiveRecordingSettings
@@ -265,7 +267,7 @@
265267
266268
.buttons {
267269
display: grid;
268-
grid-template-columns: auto auto auto;
270+
grid-template-columns: auto;
269271
}
270272
271273
div.title {

bouncy_frontend/src/routes/courses/[courseId]/exercise/[lessonIndex]/record/+page.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@
151151
const detected = tracker.lastDetection;
152152
hitRate =
153153
detected.poseMatches / (detected.poseMisses + detected.poseMatches);
154-
passed = hitRate > 0.6;
154+
passed = hitRate >= 0.6;
155155
if (passed) {
156156
recordFinishedLesson(id, lessonIndex, 1);
157157
}

0 commit comments

Comments
 (0)