mirror of
https://github.com/AustinKelsay/plebdevs.git
synced 2025-06-05 00:32:03 +00:00
Merge pull request #72 from AustinKelsay/bugfix/course-sidebar-spacing-glitch
remove empty space when sidebar closed, fix transition animation
This commit is contained in:
commit
514eeb5126
@ -125,12 +125,10 @@ const CourseSidebar = ({
|
|||||||
)}
|
)}
|
||||||
|
|
||||||
{/* Desktop sidebar */}
|
{/* Desktop sidebar */}
|
||||||
{!isMobileView && (
|
{!isMobileView && sidebarVisible && (
|
||||||
<div className="relative flex flex-row-reverse z-[999]">
|
<div className="relative flex flex-row-reverse z-[999]">
|
||||||
<div
|
<div
|
||||||
className={`transition-all duration-500 ease-in-out flex ${
|
className={`transition-all duration-500 ease-in-out flex w-80 opacity-100`}
|
||||||
sidebarVisible ? 'w-80 opacity-100' : 'w-0 opacity-0 overflow-hidden'
|
|
||||||
}`}
|
|
||||||
>
|
>
|
||||||
<div className="ml-2 w-80 h-[calc(100vh-400px)] sticky overflow-hidden rounded-lg border border-gray-800 shadow-md bg-gray-800"
|
<div className="ml-2 w-80 h-[calc(100vh-400px)] sticky overflow-hidden rounded-lg border border-gray-800 shadow-md bg-gray-800"
|
||||||
style={{ top: `${navbarHeight + 70}px` }}> {/* Adjusted to match new header spacing */}
|
style={{ top: `${navbarHeight + 70}px` }}> {/* Adjusted to match new header spacing */}
|
||||||
|
@ -278,21 +278,11 @@ const Course = () => {
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
{/* Course Sidebar - positioned absolutely on desktop when visible */}
|
{/* Course Sidebar - positioned absolutely on desktop when visible */}
|
||||||
{!isMobileView ? (
|
{!isMobileView && (
|
||||||
<div
|
<div
|
||||||
className={`transition-all duration-500 ease-in-out ${
|
className={`transition-all duration-500 ease-in-out absolute top-0 right-0 w-[320px] h-full z-[999] overflow-visible
|
||||||
sidebarVisible ? 'opacity-100 translate-x-0' : 'opacity-0 translate-x-full'
|
${sidebarVisible ? 'opacity-100 translate-x-0 pointer-events-auto' : 'opacity-0 translate-x-full pointer-events-none'}
|
||||||
}`}
|
`}
|
||||||
style={{
|
|
||||||
position: 'absolute',
|
|
||||||
top: '0',
|
|
||||||
right: '0',
|
|
||||||
width: '320px',
|
|
||||||
height: '100%',
|
|
||||||
zIndex: 999,
|
|
||||||
overflow: 'visible',
|
|
||||||
pointerEvents: sidebarVisible ? 'auto' : 'none'
|
|
||||||
}}
|
|
||||||
>
|
>
|
||||||
<CourseSidebar
|
<CourseSidebar
|
||||||
lessons={uniqueLessons}
|
lessons={uniqueLessons}
|
||||||
@ -305,26 +295,6 @@ const Course = () => {
|
|||||||
hideToggleButton={true}
|
hideToggleButton={true}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
) : (
|
|
||||||
<div className={`flex-shrink-0 transition-all duration-300 z-[999] ${
|
|
||||||
(isMobileView && activeTab === 'lessons') ? 'ml-0 w-auto opacity-100' :
|
|
||||||
'w-0 ml-0 opacity-0 overflow-hidden'
|
|
||||||
}`}>
|
|
||||||
<CourseSidebar
|
|
||||||
lessons={uniqueLessons}
|
|
||||||
activeIndex={activeIndex}
|
|
||||||
onLessonSelect={handleLessonSelect}
|
|
||||||
completedLessons={completedLessons}
|
|
||||||
isMobileView={isMobileView}
|
|
||||||
onClose={() => {
|
|
||||||
setSidebarVisible(false);
|
|
||||||
toggleTab(getActiveTabIndex());
|
|
||||||
}}
|
|
||||||
sidebarVisible={sidebarVisible}
|
|
||||||
setSidebarVisible={setSidebarVisible}
|
|
||||||
hideToggleButton={true}
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user