Update scroll behavior and padding in About and Header styles

This commit is contained in:
dertyp7
2024-01-14 13:19:40 +01:00
parent 0de5c8d60d
commit 4e4f2b977c
3 changed files with 4 additions and 8 deletions

View File

@@ -16,11 +16,7 @@ export default function App() {
(entries) => { (entries) => {
entries.forEach((entry) => { entries.forEach((entry) => {
if (entry.isIntersecting) { if (entry.isIntersecting) {
if (entry.target.id === "about") { window.location.hash = entry.target.id;
window.location.hash = "";
} else {
window.location.hash = entry.target.id;
}
} }
}); });
}, },
@@ -47,7 +43,7 @@ export default function App() {
return ( return (
<div id="app"> <div id="app">
<Header /> <Header />
<div id="about" className="section" ref={aboutRef}> <div className="section" ref={aboutRef}>
<About /> <About />
</div> </div>

View File

@@ -1,6 +1,6 @@
.about { .about {
height: 100vh; height: 100vh;
padding: 0rem 10rem; padding: 5rem 10rem;
.greeting { .greeting {
color: var(--color-accent); color: var(--color-accent);
} }

View File

@@ -2,7 +2,7 @@
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: space-between; justify-content: space-between;
position: sticky; position: fixed;
background-color: var(--color-background-body); background-color: var(--color-background-body);
top: 0; top: 0;
z-index: 100; z-index: 100;