feat(FontListItem): separate isVisible flags into two (partial and fully)

This commit is contained in:
Ilia Mashkov
2026-02-02 12:13:58 +03:00
parent 918e792e41
commit 4a94f7bd09

View File

@@ -19,7 +19,11 @@ interface Props {
/**
* Is element fully visible
*/
isVisible: boolean;
isFullyVisible: boolean;
/**
* Is element partially visible
*/
isPartiallyVisible: boolean;
/**
* From 0 to 1
*/
@@ -30,7 +34,7 @@ interface Props {
children: Snippet<[font: UnifiedFont]>;
}
const { font, isVisible, proximity, children }: Props = $props();
const { font, isFullyVisible, isPartiallyVisible, proximity, children }: Props = $props();
const selected = $derived(selectedFontsStore.has(font.id));
let timeoutId = $state<NodeJS.Timeout | null>(null);
@@ -49,7 +53,7 @@ const bloom = new Spring(0, {
// Sync spring to proximity for a "Lens" effect
$effect(() => {
bloom.target = isVisible ? 1 : 0;
bloom.target = isPartiallyVisible ? 1 : 0;
});
$effect(() => {