feat(SampleList): remove unused code
This commit is contained in:
@@ -5,11 +5,7 @@
|
||||
- Provides a typography menu for font setup.
|
||||
-->
|
||||
<script lang="ts">
|
||||
import {
|
||||
FontListItem,
|
||||
FontVirtualList,
|
||||
unifiedFontStore,
|
||||
} from '$entities/Font';
|
||||
import { FontVirtualList } from '$entities/Font';
|
||||
import { FontSampler } from '$features/DisplayFont';
|
||||
import {
|
||||
TypographyMenu,
|
||||
@@ -17,6 +13,7 @@ import {
|
||||
} from '$features/SetupFont';
|
||||
import { throttle } from '$shared/lib/utils';
|
||||
import { Skeleton } from '$shared/ui';
|
||||
import { layoutManager } from '../../model';
|
||||
|
||||
let text = $state('The quick brown fox jumps over the lazy dog...');
|
||||
let wrapper = $state<HTMLDivElement | null>(null);
|
||||
@@ -25,15 +22,6 @@ let innerHeight = $state(0);
|
||||
// Is the component above the middle of the viewport?
|
||||
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(() => {
|
||||
if (!wrapper) return;
|
||||
|
||||
@@ -69,28 +57,17 @@ const checkPosition = throttle(() => {
|
||||
itemHeight={220}
|
||||
useWindowScroll={true}
|
||||
weight={controlManager.weight}
|
||||
columns={layoutManager.columns}
|
||||
gap={layoutManager.gap}
|
||||
{skeleton}
|
||||
>
|
||||
{#snippet children({
|
||||
item: font,
|
||||
isFullyVisible,
|
||||
isPartiallyVisible,
|
||||
proximity,
|
||||
index,
|
||||
})}
|
||||
<FontListItem
|
||||
{font}
|
||||
{isFullyVisible}
|
||||
{isPartiallyVisible}
|
||||
{proximity}
|
||||
>
|
||||
<FontSampler {font} bind:text {index} />
|
||||
</FontListItem>
|
||||
{#snippet children({ item: font, index })}
|
||||
<FontSampler bind:text {font} {index} />
|
||||
{/snippet}
|
||||
</FontVirtualList>
|
||||
|
||||
<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}
|
||||
/>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user