Skip to content

Commit

Permalink
only one interaction
Browse files Browse the repository at this point in the history
  • Loading branch information
thejackshelton committed Jan 13, 2025
1 parent c056ef0 commit 7062b47
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ export const JSChunkAnimator = component$(() => {
}[]
>([]);
const nextId = useSignal(0);
const hasInteracted = useSignal(false);

useStylesScoped$(`
.chunk-container {
Expand Down Expand Up @@ -72,6 +73,9 @@ export const JSChunkAnimator = component$(() => {
const target = event.target as HTMLElement;
const jsElement = target.closest("[data-js]");
if (jsElement) {
if (hasInteracted.value) return;

hasInteracted.value = true;
const rect = jsElement.getBoundingClientRect();
const centerX = rect.left + rect.width / 2;
const topY = rect.top - 30;
Expand Down

0 comments on commit 7062b47

Please sign in to comment.