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,7 +155,8 @@ 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}>
<div className={styles.contentcontainer}>
{!isTouchscreenDevice && {!isTouchscreenDevice &&
!pages.find((x) => x.id === page && x.hideTitle) && ( !pages.find((x) => x.id === page && x.hideTitle) && (
<h1> <h1>
@ -167,16 +168,18 @@ export function GenericSettings({
</h1> </h1>
)} )}
<Switch>{children}</Switch> <Switch>{children}</Switch>
{/*</div>*/}
</div> </div>
)}
{!isTouchscreenDevice && ( {!isTouchscreenDevice && (
<div className={styles.action}>
<div onClick={exitSettings} className={styles.closeButton}> <div onClick={exitSettings} className={styles.closeButton}>
<X size={28} /> <X size={28} />
<span className={styles.esc} />
</div>
)}
</div> </div>
</div> </div>
)} )}
</div> </div>
); );
} }

View file

@ -80,17 +80,20 @@
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;
@ -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,11 +162,24 @@
} }
.content { .content {
flex: 3; flex: 1 1 800px;
display: flex;
overflow-y: auto;
overflow-x: hidden;
.scrollbox {
display: flex;
flex-grow: 1;
}
.contentcontainer {
display: flex;
max-width: 740px; max-width: 740px;
padding: 80px 2em; padding: 80px 2em;
overflow-y: scroll; visibility: visible;
overflow-x: hidden; 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;