Skip to content

Commit

Permalink
headline fly
Browse files Browse the repository at this point in the history
  • Loading branch information
jadiehm committed Oct 13, 2023
1 parent fd8afab commit fdc9344
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/components/Chapter.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,11 @@
import Bookmark from "$components/Bookmark.svelte";
import inView from "$actions/inView.js";
import { activeSection } from "$stores/misc.js";
import { fly } from 'svelte/transition';
let scrollDir;
let lastY;
let headlingFly = false;
export let id;
export let data;
Expand All @@ -15,7 +17,10 @@
export let scrollY;
export let xShiftSection;
function setSectionEnter(id) { activeSection.set(id); }
function setSectionEnter(id) {
headlingFly = true;
activeSection.set(id);
}
function setSectionExit(id) {
let nextSection;
if (scrollDir == "down") {
Expand Down Expand Up @@ -50,7 +55,9 @@
use:inView={{ top: 0 }}
on:enter={() => setSectionEnter(id)}
on:exit={() => setSectionExit(id)}>
<h2>{resetTitles(id)}</h2>
{#if headlingFly}
<h2 in:fly={{ y: 200, duration: 2000 }}>{resetTitles(id)}</h2>
{/if}
<ChapterText copy={copyBlock}/>
<Bookmark category={"wall"} />
<WallScrolly data={data} copy={copyScroll} section={id} xShiftSection={xShiftSection} />
Expand Down

0 comments on commit fdc9344

Please sign in to comment.