diff --git a/src/components/sidebar/Sidebar.css b/src/components/sidebar/Sidebar.css index 821d010..d16d40b 100644 --- a/src/components/sidebar/Sidebar.css +++ b/src/components/sidebar/Sidebar.css @@ -1,33 +1,171 @@ -.sidebar { - scrollbar-width: thin; - scrollbar-color: rgba(255, 255, 255, 0.2) transparent; +.sidebar-container { + position: fixed; + top: 0; + left: 0; + width: 100%; + height: 100vh; + pointer-events: none; + z-index: 50; + isolation: isolate; } -.sidebar::-webkit-scrollbar { +.sidebar-overlay { + position: fixed; + inset: 0; + background-color: rgba(0, 0, 0, 0.75); + pointer-events: auto; + transition: opacity 0.3s ease; + z-index: 60; + will-change: opacity; +} + +.sidebar-main { + position: fixed; + top: 0; + left: 0; + width: 280px; + height: 100vh; + background-color: #0a0a0a; + transform: translateX(-100%); + transition: transform 0.3s ease; + pointer-events: auto; + z-index: 70; + display: flex; + flex-direction: column; + will-change: transform; +} + +@media (max-width: 575px) { + .sidebar-main { + width: 260px; + } +} + +.sidebar-main.sidebar-open { + transform: translateX(0); +} + +.sidebar-content { + height: 100%; + overflow-y: auto; + overscroll-behavior: contain; + display: flex; + flex-direction: column; + scrollbar-width: thin; + scrollbar-color: rgba(255, 255, 255, 0.2) transparent; + -webkit-overflow-scrolling: touch; +} + +.sidebar-content::-webkit-scrollbar { width: 5px; } -.sidebar::-webkit-scrollbar-track { +.sidebar-content::-webkit-scrollbar-track { background: transparent; } -.sidebar::-webkit-scrollbar-thumb { +.sidebar-content::-webkit-scrollbar-thumb { background-color: rgba(255, 255, 255, 0.2); border-radius: 20px; } -body.sidebar-open { - overflow: hidden; - padding-right: 5px; /* Prevent layout shift when scrollbar disappears */ - height: 100%; - position: fixed; - width: 100%; +.sidebar-header { + padding: 1.5rem; + border-bottom: 1px solid rgba(255, 255, 255, 0.05); + flex-shrink: 0; } -/* Wrapper to maintain scroll position when sidebar is opened */ -.sidebar-scroll-wrapper { - position: absolute; +.close-button { width: 100%; - height: 100%; + display: flex; + align-items: center; + justify-content: center; + gap: 0.5rem; + padding: 0.625rem 1rem; + background-color: rgba(255, 255, 255, 0.1); + border-radius: 0.5rem; + transition: background-color 0.2s ease; +} + +.close-button:hover { + background-color: rgba(255, 255, 255, 0.15); +} + +.quick-actions { + width: 100%; + padding: 1rem; + border-bottom: 1px solid rgba(255, 255, 255, 0.05); + flex-shrink: 0; +} + +@media (min-width: 1024px) { + .quick-actions { + display: none; + } +} + +.quick-actions-grid { + display: grid; + grid-template-columns: repeat(3, 1fr); + gap: 0.5rem; +} + +.quick-action-item { + display: flex; + flex-direction: column; + align-items: center; + gap: 0.5rem; + padding: 0.75rem; + border-radius: 0.5rem; + background-color: rgba(255, 255, 255, 0.05); + transition: background-color 0.2s ease; +} + +.quick-action-item:hover { + background-color: rgba(255, 255, 255, 0.1); +} + +.language-switcher { + display: flex; + background-color: rgba(255, 255, 255, 0.1); + border-radius: 0.25rem; +} + +.lang-button { + padding: 0.25rem 0.5rem; + font-size: 0.75rem; + font-weight: 500; + color: rgba(255, 255, 255, 0.6); + transition: all 0.2s ease; +} + +.lang-button:hover { + color: white; +} + +.lang-button.active { + background-color: rgba(255, 255, 255, 0.15); + color: white; +} + +.menu-items { + width: 100%; + padding: 0.5rem; + flex: 1; overflow-y: auto; +} + +.menu-item { + display: flex; + align-items: center; + gap: 0.75rem; + padding: 0.75rem 1rem; + color: rgba(255, 255, 255, 0.6); + border-radius: 0.5rem; + transition: all 0.2s ease; +} + +.menu-item:hover { + color: white; + background-color: rgba(255, 255, 255, 0.05); } \ No newline at end of file diff --git a/src/components/sidebar/Sidebar.jsx b/src/components/sidebar/Sidebar.jsx index 0e21070..37e7b5c 100644 --- a/src/components/sidebar/Sidebar.jsx +++ b/src/components/sidebar/Sidebar.jsx @@ -23,19 +23,34 @@ const Sidebar = ({ isOpen, onClose }) => { const location = useLocation(); const scrollPosition = useRef(0); + useEffect(() => { + const handleScroll = () => { + if (!isOpen) { + scrollPosition.current = window.scrollY; + } + }; + + window.addEventListener('scroll', handleScroll); + return () => window.removeEventListener('scroll', handleScroll); + }, [isOpen]); + useEffect(() => { if (isOpen) { - scrollPosition.current = window.pageYOffset; - document.body.classList.add('sidebar-open'); + scrollPosition.current = window.scrollY; + document.body.style.position = 'fixed'; document.body.style.top = `-${scrollPosition.current}px`; + document.body.style.width = '100%'; } else { - document.body.classList.remove('sidebar-open'); + document.body.style.position = ''; document.body.style.top = ''; + document.body.style.width = ''; window.scrollTo(0, scrollPosition.current); } + return () => { - document.body.classList.remove('sidebar-open'); + document.body.style.position = ''; document.body.style.top = ''; + document.body.style.width = ''; }; }, [isOpen]); @@ -44,29 +59,25 @@ const Sidebar = ({ isOpen, onClose }) => { }, [location]); return ( - <> +
{isOpen && (
)} -
-
+
{/* Header */} -
+
{/* Quick Actions */} -
-
+
+
Random Movie -
-
- {["EN", "JP"].map((lang, index) => ( +
+
+ {["EN", "JP"].map((lang) => ( @@ -112,21 +119,21 @@ const Sidebar = ({ isOpen, onClose }) => {
{/* Menu Items */} -
+
+
-
- + +
); }; diff --git a/src/pages/contact/Contact.jsx b/src/pages/contact/Contact.jsx index 82cdd01..b24d014 100644 --- a/src/pages/contact/Contact.jsx +++ b/src/pages/contact/Contact.jsx @@ -14,7 +14,7 @@ function Contact() {