Started work on redoing settings structure

This commit is contained in:
nizune 2021-08-02 14:09:54 +02:00
parent ab54afc1e0
commit 4a248ffa5b
2 changed files with 85 additions and 33 deletions

View file

@ -155,28 +155,31 @@ export function GenericSettings({
)} )}
{(!isTouchscreenDevice || typeof page === "string") && ( {(!isTouchscreenDevice || typeof page === "string") && (
<div className={styles.content}> <div className={styles.content}>
{/*<div className={styles.scrollbox}>*/} <div className={styles.scrollbox}>
{!isTouchscreenDevice && <div className={styles.contentcontainer}>
!pages.find((x) => x.id === page && x.hideTitle) && ( {!isTouchscreenDevice &&
<h1> !pages.find((x) => x.id === page && x.hideTitle) && (
<Text <h1>
id={`app.settings.${category}.${ <Text
page ?? defaultPage id={`app.settings.${category}.${
}.title`} page ?? defaultPage
/> }.title`}
</h1> />
</h1>
)}
<Switch>{children}</Switch>
</div>
{!isTouchscreenDevice && (
<div onClick={exitSettings} className={styles.closeButton}>
<X size={28} />
<span className={styles.esc} />
</div>
)} )}
<Switch>{children}</Switch>
{/*</div>*/}
</div>
)}
{!isTouchscreenDevice && (
<div className={styles.action}>
<div onClick={exitSettings} className={styles.closeButton}>
<X size={28} />
</div> </div>
</div> </div>
)} )}
</div> </div>
); );
} }

View file

@ -80,20 +80,23 @@
display: flex; display: flex;
user-select: none; user-select: none;
flex-direction: row; flex-direction: row;
justify-content: center; /*justify-content: center;*/
background: var(--primary-background); background: var(--primary-background);
.scrollbox { /* Scrollbox hides the scrollbar on the desktop app. */
overflow: auto; @media (hover: hover) { .scrollbox { visibility: hidden; }}
visibility: hidden;
transition: visibility 0.2s; .scrollbox {
overflow-y: scroll;
visibility: hidden;
transition: visibility 0.1s;
} }
.container, .container,
.contentcontainer,
.scrollbox:hover, .scrollbox:hover,
.scrollbox:focus { .scrollbox:focus {
visibility: visible; visibility: visible;
} }
::-webkit-scrollbar-thumb { ::-webkit-scrollbar-thumb {
@ -109,6 +112,11 @@
justify-content: flex-end; justify-content: flex-end;
background: var(--secondary-background); background: var(--secondary-background);
display: flex;
-webkit-box-flex: 1;
-webkit-box-pack: end;
justify-content: flex-end;
.container { .container {
width: 218px; width: 218px;
padding: 80px 8px; padding: 80px 8px;
@ -137,9 +145,7 @@
color: var(--secondary-foreground); color: var(--secondary-foreground);
font-family: var(--monospace-font), monospace; font-family: var(--monospace-font), monospace;
user-select: text; user-select: text;
display: grid; display: grid;
//place-items: center;
> div { > div {
gap: 2px; gap: 2px;
@ -156,12 +162,25 @@
} }
.content { .content {
flex: 3; flex: 1 1 800px;
max-width: 740px; display: flex;
padding: 80px 2em; overflow-y: auto;
overflow-y: scroll;
overflow-x: hidden; overflow-x: hidden;
.scrollbox {
display: flex;
flex-grow: 1;
}
.contentcontainer {
display: flex;
max-width: 740px;
padding: 80px 2em;
visibility: visible;
flex-direction: column;
flex-grow: 1;
}
details { details {
margin: 14px 0; margin: 14px 0;
} }
@ -202,11 +221,40 @@
} }
} }
.action { .closeButton {
display: flex;
align-items: center;
justify-content: center;
border-radius: 50%;
height: 40px;
width: 40px;
border: 3px solid var(--tertiary-background);
cursor: pointer;
visibility: visible;
position: sticky;
top: 80px;
svg {
color: var(--secondary-foreground);
}
&:hover {
background: var(--secondary-header);
}
&:active {
transform: translateY(2px);
}
}
/*.action {
flex: 1; flex: 1;
flex-shrink: 0; flex-shrink: 0;
padding: 80px 8px; padding: 80px 8px;
color: var(--tertiary-background); color: var(--tertiary-background);
visibility: visible;
position: sticky;
top: 0;
&:after { &:after {
content: "ESC"; content: "ESC";
@ -231,6 +279,7 @@
width: 40px; width: 40px;
border: 3px solid var(--tertiary-background); border: 3px solid var(--tertiary-background);
cursor: pointer; cursor: pointer;
visibility: visible;
svg { svg {
color: var(--secondary-foreground); color: var(--secondary-foreground);
@ -248,7 +297,7 @@
> div { > div {
display: inline; display: inline;
} }
} }*/
section { section {
margin-bottom: 1em; margin-bottom: 1em;
@ -259,4 +308,4 @@
> div { > div {
margin: auto; margin: auto;
} }
} }