From 9a186b357b32325cf77fdce39a6c6c9aff76d8a5 Mon Sep 17 00:00:00 2001 From: Armand Philippot Date: Tue, 17 May 2022 18:31:21 +0200 Subject: chore: listen scroll to hide/show back to top button --- src/components/templates/layout/layout.module.scss | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'src/components/templates/layout/layout.module.scss') diff --git a/src/components/templates/layout/layout.module.scss b/src/components/templates/layout/layout.module.scss index 806d2d7..09904dc 100644 --- a/src/components/templates/layout/layout.module.scss +++ b/src/components/templates/layout/layout.module.scss @@ -13,6 +13,20 @@ border-top: fun.convert-px(3) solid var(--color-border-light); } +.back-to-top { + &--hidden { + opacity: 0; + transform: translateY(calc(var(--button-size) + var(--spacing-md))); + visibility: hidden; + } + + &--visible { + opacity: 1; + transform: translateY(0); + visibility: visible; + } +} + .noscript-spacing { width: 100%; height: fun.convert-px(75); -- cgit v1.2.3