Remove container div

This commit is contained in:
saberzero1 2024-10-26 12:26:43 +02:00
parent 316a993fed
commit 979d653b1a
No known key found for this signature in database
GPG Key ID: 41AEE99107640F10
2 changed files with 296 additions and 287 deletions

View File

@ -84,7 +84,6 @@ export default ((userOpts?: Partial<Options>) => {
constructFileTree(allFiles, (fileData.filePath ?? "").replaceAll(" ", "-")) constructFileTree(allFiles, (fileData.filePath ?? "").replaceAll(" ", "-"))
} }
return ( return (
<div class="explorer-container">
<div class={classNames(displayClass, "explorer")}> <div class={classNames(displayClass, "explorer")}>
<button <button
type="button" type="button"
@ -148,7 +147,6 @@ export default ((userOpts?: Partial<Options>) => {
</ul> </ul>
</div> </div>
</div> </div>
</div>
) )
} }

View File

@ -1,35 +1,42 @@
@use "../../styles/variables.scss" as *; @use "../../styles/variables.scss" as *;
.explorer-container { .explorer {
overflow-y: hidden;
@media all and ($mobile) { @media all and ($mobile) {
order: -1; order: -1;
height: initial;
overflow: hidden;
} }
.explorer {
display: flex; display: flex;
button#mobile-explorer { button#mobile-explorer {
display: none; display: none;
} }
button#desktop-explorer { button#desktop-explorer {
display: flex; display: flex;
} }
@media all and ($mobile) { @media all and ($mobile) {
button#mobile-explorer { button#mobile-explorer {
display: flex; display: flex;
} }
button#desktop-explorer { button#desktop-explorer {
display: none; display: none;
} }
} }
height: 100%; height: 100%;
flex-direction: column; flex-direction: column;
overflow-y: hidden; overflow-y: hidden;
&.desktop-only { &.desktop-only {
@media all and not ($mobile) { @media all and not ($mobile) {
display: flex; display: flex;
} }
} }
/*&:after { /*&:after {
pointer-events: none; pointer-events: none;
content: ""; content: "";
@ -41,11 +48,11 @@
opacity: 1; opacity: 1;
transition: opacity 0.3s ease; transition: opacity 0.3s ease;
background: linear-gradient(transparent 0px, var(--light)); background: linear-gradient(transparent 0px, var(--light));
}*/ }*/
} }
button#mobile-explorer, button#mobile-explorer,
button#desktop-explorer { button#desktop-explorer {
background-color: transparent; background-color: transparent;
border: none; border: none;
text-align: left; text-align: left;
@ -70,23 +77,23 @@
&.collapsed .fold { &.collapsed .fold {
transform: rotateZ(-90deg); transform: rotateZ(-90deg);
} }
} }
.folder-outer { .folder-outer {
display: grid; display: grid;
grid-template-rows: 0fr; grid-template-rows: 0fr;
transition: grid-template-rows 0.3s ease-in-out; transition: grid-template-rows 0.3s ease-in-out;
} }
.folder-outer.open { .folder-outer.open {
grid-template-rows: 1fr; grid-template-rows: 1fr;
} }
.folder-outer > ul { .folder-outer > ul {
overflow: hidden; overflow: hidden;
} }
#explorer-content { #explorer-content {
list-style: none; list-style: none;
overflow: hidden; overflow: hidden;
overflow-y: auto; overflow-y: auto;
@ -113,26 +120,28 @@
max-height 0.35s ease, max-height 0.35s ease,
transform 0.35s ease, transform 0.35s ease,
opacity 0.2s ease; opacity 0.2s ease;
& li > a { & li > a {
color: var(--dark); color: var(--dark);
opacity: 0.75; opacity: 0.75;
pointer-events: all; pointer-events: all;
} }
} }
> #explorer-ul { > #explorer-ul {
max-height: none; max-height: none;
} }
} }
svg { svg {
pointer-events: all; pointer-events: all;
& > polyline { & > polyline {
pointer-events: none; pointer-events: none;
} }
} }
.folder-container { .folder-container {
flex-direction: row; flex-direction: row;
display: flex; display: flex;
align-items: center; align-items: center;
@ -173,36 +182,36 @@
pointer-events: none; pointer-events: none;
} }
} }
} }
.folder-icon { .folder-icon {
margin-right: 5px; margin-right: 5px;
color: var(--secondary); color: var(--secondary);
cursor: pointer; cursor: pointer;
transition: transform 0.3s ease; transition: transform 0.3s ease;
backface-visibility: visible; backface-visibility: visible;
} }
li:has(> .folder-outer:not(.open)) > .folder-container > svg { li:has(> .folder-outer:not(.open)) > .folder-container > svg {
transform: rotate(-90deg); transform: rotate(-90deg);
} }
.folder-icon:hover { .folder-icon:hover {
color: var(--tertiary); color: var(--tertiary);
} }
.no-background::after { .no-background::after {
background: none !important; background: none !important;
} }
#explorer-end { #explorer-end {
// needs height so IntersectionObserver gets triggered // needs height so IntersectionObserver gets triggered
height: 4px; height: 4px;
// remove default margin from li // remove default margin from li
margin: 0; margin: 0;
} }
.explorer { .explorer {
@media all and ($mobile) { @media all and ($mobile) {
#explorer-content { #explorer-content {
box-sizing: border-box; box-sizing: border-box;
@ -212,7 +221,7 @@
background-color: var(--light); background-color: var(--light);
max-width: 100dvw; max-width: 100dvw;
left: -100dvw; left: -100dvw;
width: 100dvw; width: 100%;
transition: all 300ms ease-in-out; transition: all 300ms ease-in-out;
overflow: hidden; overflow: hidden;
padding: 2rem 2rem 4rem; padding: 2rem 2rem 4rem;
@ -222,7 +231,6 @@
visibility: visible; visibility: visible;
&:not(.collapsed) { &:not(.collapsed) {
//height: 100dvh;
left: 0; left: 0;
} }
@ -232,7 +240,6 @@
} }
&.collapsed { &.collapsed {
//height: 0;
left: -100dvw; left: -100dvw;
visibility: visible; visibility: visible;
} }
@ -240,45 +247,49 @@
#mobile-explorer { #mobile-explorer {
margin: 5px; margin: 5px;
&:not(.collapsed) .lucide-menu { &:not(.collapsed) .lucide-menu {
transform: rotate(90deg); transform: rotate(-90deg);
transition: transform 200ms ease-in-out; transition: transform 200ms ease-in-out;
} }
.lucide-menu { .lucide-menu {
stroke: var(--darkgray); stroke: var(--darkgray);
transition: transform 200ms ease; transition: transform 200ms ease;
&:hover { &:hover {
stroke: var(--dark); stroke: var(--dark);
} }
} }
} }
} }
} }
.no-scroll { .no-scroll {
opacity: 0; opacity: 0;
overflow: hidden; overflow: hidden;
} }
html:has(.no-scroll) { html:has(.no-scroll) {
overflow: hidden; overflow: hidden;
} }
@media all and not ($mobile) { @media all and not ($mobile) {
.no-scroll { .no-scroll {
opacity: 1 !important; opacity: 1 !important;
overflow: auto !important; overflow: auto !important;
} }
html:has(.no-scroll) { html:has(.no-scroll) {
overflow: auto !important; overflow: auto !important;
} }
}
} }
// Lock page scroll on mobile // Lock page scroll on mobile
.lock-scroll { .lock-scroll {
position: static; position: static;
} }
@media all and ($mobile) { @media all and ($mobile) {
.lock-scroll { .lock-scroll {
position: fixed; position: fixed;