diff --git a/frontend/src/components/ResourceTypes.svelte b/frontend/src/components/ResourceTypes.svelte index 3e9fbdf1..23f1b16c 100644 --- a/frontend/src/components/ResourceTypes.svelte +++ b/frontend/src/components/ResourceTypes.svelte @@ -129,8 +129,15 @@ ) } } + let windowWidth: number + $: console.log(`windowWidth: ${windowWidth}`) + + const TAILWIND_SM_MIN_WIDTH = import.meta.env.VITE_TAILWIND_SM_MIN_WIDTH + $: console.log(`TAILWIND_SM_MIN_WIDTH: ${TAILWIND_SM_MIN_WIDTH}`) + + @@ -178,88 +185,171 @@ {#if ($langCountStore > 0 && lang0ResourceTypesAndNames && lang0ResourceTypesAndNames.length == 0) || ($langCountStore > 1 && !lang1ResourceTypesAndNames)} {/if} -
+ {#if windowWidth < TAILWIND_SM_MIN_WIDTH} {#if $langCountStore > 0} -
+

{$langNamesStore[0]}

{/if} - {#if $langCountStore > 1 && lang1ResourceTypesAndNames} -
-

{$langNamesStore[1]}

-
- {/if} -
-
- {#if lang0ResourceTypesAndNames && lang0ResourceTypesAndNames.length > 0} -
-
- selectAllLang0ResourceTypes(event)} - /> - +
+ {#if lang0ResourceTypesAndNames && lang0ResourceTypesAndNames.length > 0} +
+
+ selectAllLang0ResourceTypes(event)} + /> + +
+
    + {#each lang0ResourceTypesAndNames as lang0ResourceTypeAndName, index} + + {/each} +
-
    - {#each lang0ResourceTypesAndNames as lang0ResourceTypeAndName, index} - - {/each} -
-
- {/if} - {#if lang1ResourceTypesAndNames && lang1ResourceTypesAndNames.length > 0} -
-
- selectAllLang1ResourceTypes(event)} - /> - + {/if} + {#if $langCountStore > 1 && lang1ResourceTypesAndNames} +
+

{$langNamesStore[1]}

-
    - {#each lang1ResourceTypesAndNames as lang1ResourceTypeAndName, index} - - {/each} -
-
- {/if} -
+ {/if} + {#if lang1ResourceTypesAndNames && lang1ResourceTypesAndNames.length > 0} +
+
+ selectAllLang1ResourceTypes(event)} + /> + +
+
    + {#each lang1ResourceTypesAndNames as lang1ResourceTypeAndName, index} + + {/each} +
+
+ {/if} +
+ {:else} +
+ {#if $langCountStore > 0} +
+

{$langNamesStore[0]}

+
+ {/if} + {#if $langCountStore > 1 && lang1ResourceTypesAndNames} +
+

{$langNamesStore[1]}

+
+ {/if} +
+
+ {#if lang0ResourceTypesAndNames && lang0ResourceTypesAndNames.length > 0} +
+
+ selectAllLang0ResourceTypes(event)} + /> + +
+
    + {#each lang0ResourceTypesAndNames as lang0ResourceTypeAndName, index} + + {/each} +
+
+ {/if} + {#if lang1ResourceTypesAndNames && lang1ResourceTypesAndNames.length > 0} +
+
+ selectAllLang1ResourceTypes(event)} + /> + +
+
    + {#each lang1ResourceTypesAndNames as lang1ResourceTypeAndName, index} + + {/each} +
+
+ {/if} +
+ {/if}