Browse Source

fix: scroll locking bug

Signed-off-by: Muthu Kumar <muthukumar@thefeathers.in>
pull/2/head
Muthu Kumar 12 months ago
parent
commit
05eb3508bc
Failed to extract signature
  1. 11
      src/components/Container.tsx
  2. 16
      src/index.css

11
src/components/Container.tsx

@ -82,11 +82,6 @@ const Container: React.FC<{
child.style.removeProperty("transform"); child.style.removeProperty("transform");
}, 100 * idx); }, 100 * idx);
}); });
timer(() => {
document.body.style.maxHeight = "auto";
document.body.style.overflow = "auto";
}, containerChildren.length * 100);
} }
// cleanup // cleanup
@ -118,8 +113,7 @@ const Container: React.FC<{
child.style.opacity = "0"; child.style.opacity = "0";
}); });
} }
document.body.style.maxHeight = "100vh";
document.body.style.overflow = "hidden";
try { try {
const target = e.currentTarget! as HTMLButtonElement; const target = e.currentTarget! as HTMLButtonElement;
target.style.width = "0"; target.style.width = "0";
@ -167,11 +161,12 @@ const Container: React.FC<{
padding-block-start: 15rem; padding-block-start: 15rem;
padding-block-end: 8rem; padding-block-end: 8rem;
padding-inline: calc(100vw / 8); padding-inline: calc(100vw / 8);
overflow-x: hidden; overflow: hidden;
min-height: 100vh; min-height: 100vh;
position: relative; position: relative;
`}> `}>
<div <div
aria-hidden
className={cx( className={cx(
"fog", "fog",
css` css`

16
src/index.css

@ -6,6 +6,9 @@
--primary-colour: rgb(255, 85, 85); --primary-colour: rgb(255, 85, 85);
--text-colour: rgb(211, 207, 201); --text-colour: rgb(211, 207, 201);
--text-subdued: rgb(150, 150, 150); --text-subdued: rgb(150, 150, 150);
--card-active: rgb(45, 45, 45);
--card-active-border: rgb(60, 60, 60);
--card-hover: rgb(15, 15, 15);
font-weight: 500; font-weight: 500;
font-size: max(16px, 0.8vw); font-size: max(16px, 0.8vw);
} }
@ -13,19 +16,15 @@
* { * {
box-sizing: border-box; box-sizing: border-box;
scroll-behavior: smooth; scroll-behavior: smooth;
}
body {
margin: 0;
font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto",
"Oxygen", "Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue", "Oxygen", "Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue",
sans-serif; sans-serif;
color: var(--text-colour);
height: 100vh;
} }
#root { body {
height: 100%; margin: 0;
color: var(--text-colour);
overflow-x: hidden;
} }
code { code {
@ -77,7 +76,6 @@ h4 {
a { a {
color: var(--text-colour); color: var(--text-colour);
text-decoration: none; text-decoration: none;
font-family: Inter;
font-weight: 800; font-weight: 800;
transition: all 200ms; transition: all 200ms;
} }

Loading…
Cancel
Save