2026-01-12 08:51:36 +03:00
|
|
|
<script lang="ts">
|
2026-01-26 12:54:40 +03:00
|
|
|
import { appliedFontsManager } from '$entities/Font';
|
|
|
|
|
import { displayedFontsStore } from '$features/DisplayFont';
|
2026-01-18 15:01:19 +03:00
|
|
|
import FontDisplay from '$features/DisplayFont/ui/FontDisplay/FontDisplay.svelte';
|
2026-01-26 12:54:40 +03:00
|
|
|
import { controlManager } from '$features/SetupFont';
|
|
|
|
|
import ComparisonSlider from '$widgets/ComparisonSlider/ui/ComparisonSlider/ComparisonSlider.svelte';
|
2026-01-24 15:39:38 +03:00
|
|
|
import { FontSearch } from '$widgets/FontSearch';
|
2026-01-18 15:01:19 +03:00
|
|
|
|
2026-01-02 21:15:40 +03:00
|
|
|
/**
|
|
|
|
|
* Page Component
|
|
|
|
|
*/
|
2026-01-24 15:39:38 +03:00
|
|
|
|
|
|
|
|
let searchContainer: HTMLElement;
|
|
|
|
|
|
|
|
|
|
let isExpanded = $state(false);
|
2026-01-26 12:54:40 +03:00
|
|
|
|
|
|
|
|
$effect(() => {
|
|
|
|
|
appliedFontsManager.touch(
|
|
|
|
|
displayedFontsStore.fonts.map(font => ({ slug: font.id, weight: controlManager.weight })),
|
|
|
|
|
);
|
|
|
|
|
});
|
2025-12-30 18:57:58 +03:00
|
|
|
</script>
|
|
|
|
|
|
2026-01-13 20:05:33 +03:00
|
|
|
<!-- Font List -->
|
2026-01-24 15:39:38 +03:00
|
|
|
<div class="p-2 will-change-[height]">
|
|
|
|
|
<div bind:this={searchContainer}>
|
|
|
|
|
<FontSearch bind:showFilters={isExpanded} />
|
|
|
|
|
</div>
|
|
|
|
|
|
2026-01-26 12:54:40 +03:00
|
|
|
<ComparisonSlider />
|
|
|
|
|
|
2026-01-24 15:39:38 +03:00
|
|
|
<div class="will-change-tranform transition-transform content">
|
|
|
|
|
<FontDisplay />
|
|
|
|
|
</div>
|
2026-01-18 15:01:19 +03:00
|
|
|
</div>
|
2026-01-24 15:39:38 +03:00
|
|
|
|
|
|
|
|
<style>
|
|
|
|
|
.content {
|
|
|
|
|
/* Tells the browser to skip rendering off-screen content */
|
|
|
|
|
content-visibility: auto;
|
|
|
|
|
/* Helps the browser reserve space without calculating everything */
|
|
|
|
|
contain-intrinsic-size: 1px 1000px;
|
|
|
|
|
|
|
|
|
|
-webkit-font-smoothing: antialiased;
|
|
|
|
|
-moz-osx-font-smoothing: grayscale;
|
|
|
|
|
}
|
|
|
|
|
</style>
|