feat(ui): reduce size of sidebar when selecting a machine
This commit is contained in:
@@ -2,7 +2,8 @@ import styles from "./Sidebar.module.css";
|
||||
import { SidebarHeader } from "@/src/components/Sidebar/SidebarHeader";
|
||||
import { SidebarBody } from "@/src/components/Sidebar/SidebarBody";
|
||||
import cx from "classnames";
|
||||
import { splitProps } from "solid-js";
|
||||
import { Show, splitProps } from "solid-js";
|
||||
import { useMachineName } from "@/src/hooks/clan";
|
||||
|
||||
export interface LinkProps {
|
||||
path: string;
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
div.sidebar-pane {
|
||||
@apply border-none z-10;
|
||||
@apply flex flex-col border-none z-20 h-full;
|
||||
|
||||
animation: sidebarPaneShow 250ms ease-in forwards;
|
||||
|
||||
&.open {
|
||||
@apply w-60;
|
||||
@apply w-72;
|
||||
}
|
||||
|
||||
&.closing {
|
||||
@@ -90,7 +90,7 @@ div.sidebar-pane {
|
||||
@apply opacity-100;
|
||||
}
|
||||
100% {
|
||||
@apply w-60;
|
||||
@apply w-72;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
div.sidebar-section {
|
||||
@apply flex flex-col gap-2 w-full h-fit;
|
||||
@apply flex flex-col gap-2 w-full h-full;
|
||||
|
||||
& > div.header {
|
||||
@apply flex items-center justify-between px-1.5;
|
||||
|
||||
@@ -10,4 +10,35 @@
|
||||
.sidebarContainer {
|
||||
@apply absolute left-4 top-4 w-60 z-10;
|
||||
height: calc(100vh - 2rem);
|
||||
|
||||
animation: sidebarNoMachine 250ms ease-in-out;
|
||||
|
||||
&.machineSelected {
|
||||
@apply top-16;
|
||||
height: calc(100vh - 8rem);
|
||||
|
||||
animation: sidebarMachine 250ms ease-in-out;
|
||||
}
|
||||
}
|
||||
|
||||
@keyframes sidebarNoMachine {
|
||||
0% {
|
||||
@apply top-16;
|
||||
height: calc(100vh - 8rem);
|
||||
}
|
||||
100% {
|
||||
@apply top-4;
|
||||
height: calc(100vh - 2rem);
|
||||
}
|
||||
}
|
||||
|
||||
@keyframes sidebarMachine {
|
||||
0% {
|
||||
@apply top-4;
|
||||
height: calc(100vh - 2rem);
|
||||
}
|
||||
100% {
|
||||
@apply top-16;
|
||||
height: calc(100vh - 8rem);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -14,6 +14,7 @@ import {
|
||||
buildMachinePath,
|
||||
maybeUseMachineName,
|
||||
useClanURI,
|
||||
useMachineName,
|
||||
} from "@/src/hooks/clan";
|
||||
import { CubeScene } from "@/src/scene/cubes";
|
||||
import {
|
||||
@@ -119,7 +120,11 @@ export const Clan: Component<RouteSectionProps> = (props) => {
|
||||
)
|
||||
}
|
||||
>
|
||||
<div class={styles.sidebarContainer}>
|
||||
<div
|
||||
class={cx(styles.sidebarContainer, {
|
||||
[styles.machineSelected]: useMachineName(),
|
||||
})}
|
||||
>
|
||||
<Sidebar />
|
||||
</div>
|
||||
{props.children}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
.sidebarPane {
|
||||
@apply absolute left-[16.5rem] top-[5.5rem] w-64;
|
||||
.sidebarPaneContainer {
|
||||
@apply absolute left-[16.5rem] top-4 w-64 z-20;
|
||||
|
||||
height: calc(100vh - 14.5rem);
|
||||
height: calc(100vh - 2rem);
|
||||
}
|
||||
|
||||
@@ -52,18 +52,19 @@ export const Machine = (props: RouteSectionProps) => {
|
||||
const sectionProps = { clanURI, machineName, onSubmit, machineQuery };
|
||||
|
||||
return (
|
||||
<SidebarPane
|
||||
class={cx(styles.sidebarPane)}
|
||||
title={machineName}
|
||||
onClose={onClose}
|
||||
subHeader={() => (
|
||||
<SidebarMachineStatus clanURI={clanURI} machineName={machineName} />
|
||||
)}
|
||||
>
|
||||
<SidebarSectionInstall clanURI={clanURI} machineName={machineName} />
|
||||
<SectionGeneral {...sectionProps} />
|
||||
<SectionTags {...sectionProps} />
|
||||
</SidebarPane>
|
||||
<div class={styles.sidebarPaneContainer}>
|
||||
<SidebarPane
|
||||
title={machineName}
|
||||
onClose={onClose}
|
||||
subHeader={() => (
|
||||
<SidebarMachineStatus clanURI={clanURI} machineName={machineName} />
|
||||
)}
|
||||
>
|
||||
<SidebarSectionInstall clanURI={clanURI} machineName={machineName} />
|
||||
<SectionGeneral {...sectionProps} />
|
||||
<SectionTags {...sectionProps} />
|
||||
</SidebarPane>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user