From ae14b2b4ca9101766f43e1740c1813831c674c4e Mon Sep 17 00:00:00 2001 From: Michael Krebs Date: Fri, 4 Oct 2024 19:41:58 +0200 Subject: [PATCH] feat: scroll to top button --- src/lib/components/ScrollToTop.svelte | 33 +++++++++++++++++++++++++++ src/routes/+layout.svelte | 3 +++ 2 files changed, 36 insertions(+) create mode 100644 src/lib/components/ScrollToTop.svelte diff --git a/src/lib/components/ScrollToTop.svelte b/src/lib/components/ScrollToTop.svelte new file mode 100644 index 0000000..c47965f --- /dev/null +++ b/src/lib/components/ScrollToTop.svelte @@ -0,0 +1,33 @@ + + +{#if showButton} + +{/if} diff --git a/src/routes/+layout.svelte b/src/routes/+layout.svelte index 2a268d4..54ee8b7 100644 --- a/src/routes/+layout.svelte +++ b/src/routes/+layout.svelte @@ -4,6 +4,8 @@ import Navbar from "$components/navbar/Navbar.svelte"; import Footer from "$components/footer/Footer.svelte"; + import ScrollToTop from "$components/ScrollToTop.svelte"; + export let data: LayoutData; @@ -11,4 +13,5 @@