From 858daff860eca9f9800371e2cd7216702f6672d1 Mon Sep 17 00:00:00 2001 From: Ilia Mashkov Date: Sun, 15 Feb 2026 23:11:10 +0300 Subject: [PATCH] feat(ComparisonSlider): create a scrollable list of fonts with clever controls --- .../components/FontList.svelte | 202 ++++++++++++++++++ 1 file changed, 202 insertions(+) create mode 100644 src/widgets/ComparisonSlider/ui/ComparisonSlider/components/FontList.svelte diff --git a/src/widgets/ComparisonSlider/ui/ComparisonSlider/components/FontList.svelte b/src/widgets/ComparisonSlider/ui/ComparisonSlider/components/FontList.svelte new file mode 100644 index 0000000..bcbf0cc --- /dev/null +++ b/src/widgets/ComparisonSlider/ui/ComparisonSlider/components/FontList.svelte @@ -0,0 +1,202 @@ + + + +{#snippet rightBrackets(className?: string)} + + + + + + + +{/snippet} + +{#snippet leftBrackets(className?: string)} + + + + + + +{/snippet} + +{#snippet brackets(renderLeft?: boolean, renderRight?: boolean, className?: string)} + {#if renderLeft} + {@render leftBrackets(className)} + {/if} + {#if renderRight} + {@render rightBrackets(className)} + {/if} +{/snippet} + +
+
+ + {#snippet children({ item: font })} + {@const isSelectedA = isFontA(font)} + {@const isSelectedB = isFontB(font)} + {@const isEither = isSelectedA || isSelectedB} + {@const isBoth = isSelectedA && isSelectedB} + {@const handleSelectFontA = () => selectFontA(font)} + {@const handleSelectFontB = () => selectFontB(font)} + +
+
+
+ + --- {font.name} --- + +
+
+ + + + +
+ {/snippet} +
+
+