mirror of
https://github.com/seigler/aurebesh
synced 2025-07-27 01:36:12 +00:00
improve styling of reference drawer
This commit is contained in:
parent
9dd15606d6
commit
be41bda281
5 changed files with 50 additions and 22 deletions
|
@ -11,10 +11,11 @@ export default function Drawer({ children }: DrawerProps) {
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
isOpen.value = !isOpen.value;
|
isOpen.value = !isOpen.value;
|
||||||
}}
|
}}
|
||||||
|
class="drawer-handle"
|
||||||
>
|
>
|
||||||
{isOpen.value ? "Hide 🞃" : "Expand 🞁"}
|
{isOpen.value ? "Reference 🞃" : "Reference 🞁"}
|
||||||
</button>
|
</button>
|
||||||
{isOpen.value && children}
|
{children}
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,20 +3,23 @@ import { fontNames, selectedFont } from "./store";
|
||||||
|
|
||||||
export default function FontPicker() {
|
export default function FontPicker() {
|
||||||
return (
|
return (
|
||||||
<select
|
<div>
|
||||||
onChange={(event) => {
|
Font:{" "}
|
||||||
const newValue = event.currentTarget.value;
|
<select
|
||||||
selectedFont.value = newValue;
|
onChange={(event) => {
|
||||||
localforage.setItem("aurebesh-font", newValue);
|
const newValue = event.currentTarget.value;
|
||||||
}}
|
selectedFont.value = newValue;
|
||||||
>
|
localforage.setItem("aurebesh-font", newValue);
|
||||||
{fontNames.map((font) => {
|
}}
|
||||||
return (
|
>
|
||||||
<option value={font} selected={font === selectedFont.value}>
|
{fontNames.map((font) => {
|
||||||
{font}
|
return (
|
||||||
</option>
|
<option value={font} selected={font === selectedFont.value}>
|
||||||
);
|
{font}
|
||||||
})}
|
</option>
|
||||||
</select>
|
);
|
||||||
|
})}
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
@ -34,8 +34,8 @@ export default function Main() {
|
||||||
</main>
|
</main>
|
||||||
<footer>
|
<footer>
|
||||||
<Drawer>
|
<Drawer>
|
||||||
<FontPicker />
|
|
||||||
<Reference />
|
<Reference />
|
||||||
|
<FontPicker />
|
||||||
</Drawer>
|
</Drawer>
|
||||||
</footer>
|
</footer>
|
||||||
</>
|
</>
|
||||||
|
|
|
@ -50,7 +50,7 @@ Pursued by the Empire's sinister agents, Princess Leia races home aboard her sta
|
||||||
</div>
|
</div>
|
||||||
</dialog>
|
</dialog>
|
||||||
|
|
||||||
<div>
|
<div class="readingbox-actions">
|
||||||
<button
|
<button
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
editModalRef.current?.showModal();
|
editModalRef.current?.showModal();
|
||||||
|
|
|
@ -145,7 +145,7 @@ dialog::backdrop {
|
||||||
height: "100%";
|
height: "100%";
|
||||||
z-index: 3;
|
z-index: 3;
|
||||||
background-color: var(--color-backdrop);
|
background-color: var(--color-backdrop);
|
||||||
backdrop-filter: blur(10px);
|
backdrop-filter: blur(1rem);
|
||||||
}
|
}
|
||||||
|
|
||||||
#app {
|
#app {
|
||||||
|
@ -240,6 +240,7 @@ h1 {
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
gap: 0.5em;
|
gap: 0.5em;
|
||||||
padding-bottom: 1em;
|
padding-bottom: 1em;
|
||||||
|
font-size: 4vmin;
|
||||||
}
|
}
|
||||||
|
|
||||||
main {
|
main {
|
||||||
|
@ -266,6 +267,12 @@ main {
|
||||||
padding: 1em;
|
padding: 1em;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.readingbox-actions {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: row;
|
||||||
|
justify-content: flex-end;
|
||||||
|
}
|
||||||
|
|
||||||
.dualtext-help[data-hover="true"] {
|
.dualtext-help[data-hover="true"] {
|
||||||
pointer-events: all;
|
pointer-events: all;
|
||||||
}
|
}
|
||||||
|
@ -304,11 +311,28 @@ main {
|
||||||
}
|
}
|
||||||
|
|
||||||
footer {
|
footer {
|
||||||
width: "100%";
|
width: 100%;
|
||||||
}
|
}
|
||||||
.drawer {
|
.drawer {
|
||||||
width: "100%";
|
position: fixed;
|
||||||
|
bottom: 0;
|
||||||
|
left: 0;
|
||||||
|
right: 0;
|
||||||
|
transform: translateY(100%);
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
align-items: stretch;
|
align-items: stretch;
|
||||||
|
padding: 1rem;
|
||||||
|
background-color: var(--color-backdrop);
|
||||||
|
backdrop-filter: blur(1rem);
|
||||||
|
}
|
||||||
|
.drawer[data-open="true"] {
|
||||||
|
transform: none;
|
||||||
|
}
|
||||||
|
.drawer-handle {
|
||||||
|
position: absolute;
|
||||||
|
left: 0;
|
||||||
|
right: 0;
|
||||||
|
bottom: 100%;
|
||||||
|
width: 100%;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue