feat(SampleList): remove unused code
This commit is contained in:
@@ -5,11 +5,7 @@
|
|||||||
- Provides a typography menu for font setup.
|
- Provides a typography menu for font setup.
|
||||||
-->
|
-->
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import {
|
import { FontVirtualList } from '$entities/Font';
|
||||||
FontListItem,
|
|
||||||
FontVirtualList,
|
|
||||||
unifiedFontStore,
|
|
||||||
} from '$entities/Font';
|
|
||||||
import { FontSampler } from '$features/DisplayFont';
|
import { FontSampler } from '$features/DisplayFont';
|
||||||
import {
|
import {
|
||||||
TypographyMenu,
|
TypographyMenu,
|
||||||
@@ -17,6 +13,7 @@ import {
|
|||||||
} from '$features/SetupFont';
|
} from '$features/SetupFont';
|
||||||
import { throttle } from '$shared/lib/utils';
|
import { throttle } from '$shared/lib/utils';
|
||||||
import { Skeleton } from '$shared/ui';
|
import { Skeleton } from '$shared/ui';
|
||||||
|
import { layoutManager } from '../../model';
|
||||||
|
|
||||||
let text = $state('The quick brown fox jumps over the lazy dog...');
|
let text = $state('The quick brown fox jumps over the lazy dog...');
|
||||||
let wrapper = $state<HTMLDivElement | null>(null);
|
let wrapper = $state<HTMLDivElement | null>(null);
|
||||||
@@ -25,15 +22,6 @@ let innerHeight = $state(0);
|
|||||||
// Is the component above the middle of the viewport?
|
// Is the component above the middle of the viewport?
|
||||||
let isAboveMiddle = $state(false);
|
let isAboveMiddle = $state(false);
|
||||||
|
|
||||||
/**
|
|
||||||
* Calculate display range for pagination info
|
|
||||||
*/
|
|
||||||
const displayRange = $derived.by(() => {
|
|
||||||
const { offset, limit, total } = unifiedFontStore.pagination;
|
|
||||||
const loadedCount = Math.min(offset + limit, total);
|
|
||||||
return `Showing ${loadedCount} of ${total} fonts`;
|
|
||||||
});
|
|
||||||
|
|
||||||
const checkPosition = throttle(() => {
|
const checkPosition = throttle(() => {
|
||||||
if (!wrapper) return;
|
if (!wrapper) return;
|
||||||
|
|
||||||
@@ -69,28 +57,17 @@ const checkPosition = throttle(() => {
|
|||||||
itemHeight={220}
|
itemHeight={220}
|
||||||
useWindowScroll={true}
|
useWindowScroll={true}
|
||||||
weight={controlManager.weight}
|
weight={controlManager.weight}
|
||||||
|
columns={layoutManager.columns}
|
||||||
|
gap={layoutManager.gap}
|
||||||
{skeleton}
|
{skeleton}
|
||||||
>
|
>
|
||||||
{#snippet children({
|
{#snippet children({ item: font, index })}
|
||||||
item: font,
|
<FontSampler bind:text {font} {index} />
|
||||||
isFullyVisible,
|
|
||||||
isPartiallyVisible,
|
|
||||||
proximity,
|
|
||||||
index,
|
|
||||||
})}
|
|
||||||
<FontListItem
|
|
||||||
{font}
|
|
||||||
{isFullyVisible}
|
|
||||||
{isPartiallyVisible}
|
|
||||||
{proximity}
|
|
||||||
>
|
|
||||||
<FontSampler {font} bind:text {index} />
|
|
||||||
</FontListItem>
|
|
||||||
{/snippet}
|
{/snippet}
|
||||||
</FontVirtualList>
|
</FontVirtualList>
|
||||||
|
|
||||||
<TypographyMenu
|
<TypographyMenu
|
||||||
class="fixed bottom-4 sm:bottom-5 right-4 sm:left-1/2 sm:right-[unset] sm:-translate-x-1/2"
|
class="fixed bottom-4 sm:bottom-5 right-4 sm:left-1/2 sm:right-[unset] sm:-translate-x-1/2 z-50"
|
||||||
hidden={!isAboveMiddle}
|
hidden={!isAboveMiddle}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user