From c7f6f4dc7c89380cce8ae9c078b8801f990240fd Mon Sep 17 00:00:00 2001 From: Mawoka Date: Sat, 23 Sep 2023 11:15:40 +0200 Subject: [PATCH] :sparkles: Implemented thumbhash into MediaComponent and reduced content-shift in editor --- frontend/src/lib/editor/MediaComponent.svelte | 8 +++++++- frontend/src/lib/editor/card.svelte | 17 ++++++++--------- frontend/src/routes/dashboard/+page.svelte | 7 ++++++- 3 files changed, 21 insertions(+), 11 deletions(-) diff --git a/frontend/src/lib/editor/MediaComponent.svelte b/frontend/src/lib/editor/MediaComponent.svelte index 36a64eb..5eef482 100644 --- a/frontend/src/lib/editor/MediaComponent.svelte +++ b/frontend/src/lib/editor/MediaComponent.svelte @@ -7,14 +7,17 @@ SPDX-License-Identifier: MPL-2.0 {#await media} -

Placeholder

+ {:then data} {#if type === 'img'} {img_data.alt_text -
+
@@ -123,9 +124,9 @@ SPDX-License-Identifier: MPL-2.0 {/await} {/key}
- {#if data.questions[selected_question].image != undefined && data.questions[selected_question].image !== ''} -
-
+ {#if data.questions[selected_question].image} +
+
- {#await import('$lib/editor/MediaComponent.svelte') then c} - - {/await} +
{:else} @@ -192,10 +191,10 @@ SPDX-License-Identifier: MPL-2.0 />
-
+

{type_to_name[String(data.questions[selected_question].type)]}

-
+
{#if type === QuizQuestionType.ABCD || type === QuizQuestionType.CHECK} {#await import('$lib/editor/ABCDEditorPart.svelte')} diff --git a/frontend/src/routes/dashboard/+page.svelte b/frontend/src/routes/dashboard/+page.svelte index b722761..ab5bd33 100644 --- a/frontend/src/routes/dashboard/+page.svelte +++ b/frontend/src/routes/dashboard/+page.svelte @@ -17,6 +17,7 @@ SPDX-License-Identifier: MPL-2.0 import { fly } from 'svelte/transition'; import StartGamePopup from '$lib/dashboard/start_game.svelte'; import Analytics from './Analytics.svelte'; + import MediaComponent from '$lib/editor/MediaComponent.svelte'; // import GrayButton from "$lib/components/buttons/gray.svelte"; @@ -177,11 +178,15 @@ SPDX-License-Identifier: MPL-2.0 >