From 4e4f2b977cbe2d44bcf84cc07fab91220b5fa1b9 Mon Sep 17 00:00:00 2001 From: dertyp7 Date: Sun, 14 Jan 2024 13:19:40 +0100 Subject: [PATCH] Update scroll behavior and padding in About and Header styles --- src/App.tsx | 8 ++------ src/styles/About.scss | 2 +- src/styles/Header.scss | 2 +- 3 files changed, 4 insertions(+), 8 deletions(-) diff --git a/src/App.tsx b/src/App.tsx index c8c0d4b..7297d05 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -16,11 +16,7 @@ export default function App() { (entries) => { entries.forEach((entry) => { if (entry.isIntersecting) { - if (entry.target.id === "about") { - window.location.hash = ""; - } else { - window.location.hash = entry.target.id; - } + window.location.hash = entry.target.id; } }); }, @@ -47,7 +43,7 @@ export default function App() { return (
-
+
diff --git a/src/styles/About.scss b/src/styles/About.scss index c7021e1..fc9634d 100644 --- a/src/styles/About.scss +++ b/src/styles/About.scss @@ -1,6 +1,6 @@ .about { height: 100vh; - padding: 0rem 10rem; + padding: 5rem 10rem; .greeting { color: var(--color-accent); } diff --git a/src/styles/Header.scss b/src/styles/Header.scss index c467d5d..bef9d66 100644 --- a/src/styles/Header.scss +++ b/src/styles/Header.scss @@ -2,7 +2,7 @@ display: flex; align-items: center; justify-content: space-between; - position: sticky; + position: fixed; background-color: var(--color-background-body); top: 0; z-index: 100;