diff --git a/components/OrganizedContent.module.css b/components/OrganizedContent.module.css index c5107ad9..00113c82 100644 --- a/components/OrganizedContent.module.css +++ b/components/OrganizedContent.module.css @@ -146,9 +146,15 @@ z-index: 9; background: var(--primary-accent-light); border-radius: calc(5rem / 16); + transition: transform 0.3s ease-in-out; + transform: translateY(calc(94rem / 16)); padding: calc(11rem / 16) calc(9rem / 16); } + .burgerVisible { + transform: translateY(0); + } + .burger > svg { width: 100%; height: 100%; diff --git a/components/OrganizedContent.tsx b/components/OrganizedContent.tsx index d9385c50..a119b972 100644 --- a/components/OrganizedContent.tsx +++ b/components/OrganizedContent.tsx @@ -5,6 +5,7 @@ import React, { useState, useRef, useEffect, + useCallback, } from "react"; import styles from "./OrganizedContent.module.css"; @@ -48,6 +49,8 @@ export function OrganizedContent({ const section = sections[currentIndex]; const isReadAll = section.id === READ_ALL_ID; const ref = useRef(null); + const isVisible = useOnScreen(ref.current); + const burgerVisible = useBurger(isVisible); useEffect(() => { mobileNavOpen @@ -96,7 +99,9 @@ export function OrganizedContent({ )}