diff --git a/bouncy_frontend/src/lib/components/editor/VideoToStep.svelte b/bouncy_frontend/src/lib/components/editor/VideoToStep.svelte new file mode 100644 index 0000000..fc8066a --- /dev/null +++ b/bouncy_frontend/src/lib/components/editor/VideoToStep.svelte @@ -0,0 +1,141 @@ + + +

+ +

+ + +
+ +
+ {#if liveSkeleton} + + + + {/if} +
+
+ + + + + + + + diff --git a/bouncy_frontend/src/lib/i18n/de-CH.json b/bouncy_frontend/src/lib/i18n/de-CH.json index e1251a2..4e79ff0 100644 --- a/bouncy_frontend/src/lib/i18n/de-CH.json +++ b/bouncy_frontend/src/lib/i18n/de-CH.json @@ -73,6 +73,8 @@ } }, "editor": { + "title": "Labor", + "nav": "Labor", "edit-dance-context-menu": "Bearbeiten", "dance-copy-postfix": "Kopie", "delete-dance-button": "Tanz löschen", diff --git a/bouncy_frontend/src/lib/i18n/en-GB.json b/bouncy_frontend/src/lib/i18n/en-GB.json index b4311d4..a98c7a6 100644 --- a/bouncy_frontend/src/lib/i18n/en-GB.json +++ b/bouncy_frontend/src/lib/i18n/en-GB.json @@ -73,6 +73,8 @@ } }, "editor": { + "title": "Laboratory", + "nav": "Laboratory", "edit-dance-context-menu": "Edit", "dance-copy-postfix": "copy", "delete-dance-button": "Delete dance", diff --git a/bouncy_frontend/src/lib/pose.js b/bouncy_frontend/src/lib/pose.js index 54b75ac..2a3b092 100644 --- a/bouncy_frontend/src/lib/pose.js +++ b/bouncy_frontend/src/lib/pose.js @@ -91,7 +91,7 @@ export class PoseDetection { /** * * @param {import('@mediapipe/tasks-vision').ImageSource} videoElement - * @param {number} timestamp + * @param {number | undefined} timestamp */ trackFrame(videoElement, timestamp) { if (timestamp === undefined || timestamp === null) { diff --git a/bouncy_frontend/src/lib/stores/FeatureSelection.js b/bouncy_frontend/src/lib/stores/FeatureSelection.js index 4c82635..c7722fd 100644 --- a/bouncy_frontend/src/lib/stores/FeatureSelection.js +++ b/bouncy_frontend/src/lib/stores/FeatureSelection.js @@ -3,6 +3,7 @@ import { derived, readable, writable } from "svelte/store"; import { dev as envDev, browser } from '$app/environment'; +let experimental = writable(false); let privDev = envDev; export const dev = readable(privDev, (set) => { if (browser) { @@ -23,7 +24,7 @@ function versionNumberToString(v) { } /** @type {import("svelte/motion").Readable} */ -export const features = derived([version, dev], ([$v, $dev]) => { +export const features = derived([version, dev, experimental], ([$v, $dev, $experimental]) => { return { /* Fully enabled features for now but might be disabled again*/ enableDanceCollection: $v >= 0.003, @@ -32,6 +33,7 @@ export const features = derived([version, dev], ([$v, $dev]) => { /* Partially enabled features */ enableStepRecording: (stepName) => STABLE_TRACKING_STEPS.includes(stepName), + enableEditorPage: $experimental, /* Features that are not ready to be released */ enableAvatarRotation: $v >= 0.999, @@ -43,6 +45,11 @@ export const features = derived([version, dev], ([$v, $dev]) => { } ); +/** @param {boolean} yes */ +export function showExperimentalFeatures(yes) { + experimental.set(yes); +} + /** Steps that should be possible to track, with passing tests. */ export const STABLE_TRACKING_STEPS = [ "Running Man", diff --git a/bouncy_frontend/src/lib/types.js b/bouncy_frontend/src/lib/types.js index a7a0125..5c247be 100644 --- a/bouncy_frontend/src/lib/types.js +++ b/bouncy_frontend/src/lib/types.js @@ -6,6 +6,7 @@ * @property {(step: string)=>boolean} enableStepRecording * @property {boolean} enableDanceCollection * @property {boolean} enableDanceCreator + * @property {boolean} enableEditorPage * @property {boolean} enableCourses * @property {boolean} enableDevView * diff --git a/bouncy_frontend/src/routes/TabNavigation.svelte b/bouncy_frontend/src/routes/TabNavigation.svelte index 5161d9d..10cba20 100644 --- a/bouncy_frontend/src/routes/TabNavigation.svelte +++ b/bouncy_frontend/src/routes/TabNavigation.svelte @@ -31,6 +31,13 @@ icon: 'book_5', route: `${base}/collection`, }); + if (features.enableEditorPage) { + tabs.push({ + label: $t('editor.nav'), + icon: 'experiment', + route: `${base}/editor`, + }); + } tabs.push({ label: $t('profile.nav'), icon: 'account_circle', diff --git a/bouncy_frontend/src/routes/UserContext.svelte b/bouncy_frontend/src/routes/UserContext.svelte index 47c519c..6ba0bb4 100644 --- a/bouncy_frontend/src/routes/UserContext.svelte +++ b/bouncy_frontend/src/routes/UserContext.svelte @@ -7,6 +7,7 @@ import { generateRandomUsername } from '$lib/username'; import { setContext } from 'svelte'; import { writable } from 'svelte/store'; + import { showExperimentalFeatures } from '$lib/stores/FeatureSelection.js'; function fromLocalStorage() { try { @@ -49,6 +50,9 @@ ); if (browser) { user.subscribe((value) => (localStorage.user = JSON.stringify(value))); + user.subscribe((value) => { + showExperimentalFeatures(value.experimentalFeatures); + }); } /** diff --git a/bouncy_frontend/src/routes/dev/+page.svelte b/bouncy_frontend/src/routes/dev/+page.svelte index 9fdc993..3f81479 100644 --- a/bouncy_frontend/src/routes/dev/+page.svelte +++ b/bouncy_frontend/src/routes/dev/+page.svelte @@ -9,8 +9,6 @@ import Svg from '$lib/components/avatar/Svg.svelte'; import SvgAvatar2 from '$lib/components/avatar/SvgAvatar2.svelte'; import { LEFT_RIGHT_COLORING_LIGHT } from '$lib/constants'; - import PoseInputForm from '$lib/components/editor/PoseInputForm.svelte'; - import PoseEditForm from '$lib/components/editor/PoseEditForm.svelte'; /** @type {HTMLInputElement} */ let upload; @@ -22,8 +20,6 @@ let videoSrcHeight = 0; /** @type {import("$lib/instructor/bouncy_instructor").SkeletonV2 | undefined} */ let liveSkeleton; - /** @type {import("$lib/instructor/bouncy_instructor").SkeletonWrapper | undefined} */ - let poseSkeleton; let dataListener; /** @type {(skeleton: import("$lib/instructor/bouncy_instructor").SkeletonWrapper)=>void} */ @@ -130,20 +126,6 @@ console.log(step.name, step.start, step.end); }); } - - function copySkeleton() { - poseSkeleton = tracker.skeletonWrapperAt(selectedTimestamp); - if (poseSkeleton) { - loadSkeleton(poseSkeleton); - } - } - - function copyPose() { - let pose = poseFromForm(); - if (pose) { - loadPose(pose); - } - }

Dev

@@ -179,14 +161,6 @@ - - - - - - - -

Dance Evaluation

diff --git a/bouncy_frontend/src/routes/editor/+page.svelte b/bouncy_frontend/src/routes/editor/+page.svelte new file mode 100644 index 0000000..ae0d094 --- /dev/null +++ b/bouncy_frontend/src/routes/editor/+page.svelte @@ -0,0 +1,5 @@ + + +