From 4869352450586847b94c79e94f8260e07bb26ca0 Mon Sep 17 00:00:00 2001 From: DarkCat09 Date: Fri, 11 Aug 2023 13:40:37 +0400 Subject: [PATCH] Scroll to top button --- src/components/ScrollToTop.astro | 82 ++++++++++++++++++++++++++++++++ src/layouts/BlogLayout.astro | 2 + 2 files changed, 84 insertions(+) create mode 100644 src/components/ScrollToTop.astro diff --git a/src/components/ScrollToTop.astro b/src/components/ScrollToTop.astro new file mode 100644 index 0000000..f5ac699 --- /dev/null +++ b/src/components/ScrollToTop.astro @@ -0,0 +1,82 @@ +--- +import Icon from "./Icon.astro"; +--- + +
+ + + +
+ + + + diff --git a/src/layouts/BlogLayout.astro b/src/layouts/BlogLayout.astro index 88e586b..8780662 100644 --- a/src/layouts/BlogLayout.astro +++ b/src/layouts/BlogLayout.astro @@ -2,6 +2,7 @@ import Layout from "./Layout.astro"; import NavMenu from "./NavMenu.astro"; import MenuItem from "../components/MenuItem.astro"; +import ScrollToTop from "../components/ScrollToTop.astro"; export interface Props { title: string; @@ -14,6 +15,7 @@ const { title, description, mainpage = false } = Astro.props; + { mainpage ?