Skip to content
This repository has been archived by the owner on Aug 17, 2021. It is now read-only.

Commit

Permalink
fix(Footer): Modify transition
Browse files Browse the repository at this point in the history
  • Loading branch information
martonlederer committed Oct 22, 2020
1 parent 57cbd32 commit 443554f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
8 changes: 6 additions & 2 deletions src/components/Footer.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,20 @@
import { fade } from "svelte/transition";
import { backOut } from "svelte/easing";
export let scrollTransition: boolean = false;
let element,
y,
windowHeight,
shown = false;
if (!scrollTransition) shown = true;
// fade animation
$: {
if (element !== undefined) {
if (element !== undefined && scrollTransition) {
let componentY = element.offsetTop + element.offsetHeight;
if (componentY <= y + windowHeight + 120 && !shown) shown = true;
if (componentY <= y + windowHeight + 60 && !shown) shown = true;
}
}
</script>
Expand Down
2 changes: 1 addition & 1 deletion src/routes/index.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -72,4 +72,4 @@
Let's chat!
</p>
</About>
<Footer />
<Footer scrollTransition={true} />

0 comments on commit 443554f

Please sign in to comment.