Skip to content

Commit

Permalink
🎨 Improve manageability of setting screens.
Browse files Browse the repository at this point in the history
* The titles is sticky when scrolling.
* Close "x" is always clickable.
  • Loading branch information
mxbaylee committed Jul 6, 2024
1 parent 72725ca commit 37304cb
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 2 deletions.
1 change: 0 additions & 1 deletion src/components/Card.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ export const Card = (props: CardProps) => {
const [{volume}] = useSettings()
const [playSound] = useSound(volume)

// TODO maybe put in useSound
// Generic function to wrap other fn's
const wrapSound = useCallback((fn: () => void): () => void => {
return () => {
Expand Down
1 change: 1 addition & 0 deletions src/components/InfoPanel.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import React from 'react'
import './css/InfoPanel.css'

export interface InfoPanelProps {
hideInfo: () => void
Expand Down
16 changes: 15 additions & 1 deletion src/components/css/Help.css
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,28 @@
background: rgba(255, 255, 255, 0.9);
color: black; border-radius: 0.5em;
width: calc(var(--card-width) * 1.2 * var(--card-ratio));
height: calc(var(--card-height) * 1.2 * var(--card-ratio));
height: calc((var(--card-height) * 1.2 * var(--card-ratio)) * 0.88);
overflow: auto;
cursor: default;
padding-top: calc(0.12 * (var(--card-height) * 1.2 * var(--card-ratio)));
}
.help .title {
border-radius: 0.5em 0.5em 0 0;
background: rgba(255, 255, 255, 0.8);
padding: 3px;
cursor: grab;
position: absolute;
top: 0;
left: 0;
width: calc((var(--card-width) * 1.2 * var(--card-ratio)) - (3px * 2));
height: calc(0.12 * (var(--card-height) * 1.2 * var(--card-ratio)));
line-height: calc(0.12 * (var(--card-height) * 1.2 * var(--card-ratio)));
}
.help .title h3 {
line-height: calc(0.12 * (var(--card-height) * 1.2 * var(--card-ratio)));
height: calc(0.12 * (var(--card-height) * 1.2 * var(--card-ratio)));
margin: 0;
padding: 0;
}
.help .content {
text-align: left;
Expand All @@ -27,6 +40,7 @@
font-weight: normal;
}
.help .close {
z-index: 2;
cursor: pointer;
position: absolute;
top: 0;
Expand Down
18 changes: 18 additions & 0 deletions src/components/css/InfoPanel.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
.settings {
width: calc(var(--card-width) * 1.2 * var(--card-ratio));
height: calc((var(--card-height) * 1.2 * var(--card-ratio)) * 0.88);
padding-top: calc(0.12 * (var(--card-height) * 1.2 * var(--card-ratio)));
}
.settings .title {
width: 100%;
position: absolute;
top: 0;
left: 0;
cursor: grab;
width: calc((var(--card-width) * 1.2 * var(--card-ratio)) - (3px * 2));
height: calc(0.12 * (var(--card-height) * 1.2 * var(--card-ratio)));
line-height: calc(0.12 * (var(--card-height) * 1.2 * var(--card-ratio)));
}
.settings .title h3 {
margin: 0;
}
1 change: 1 addition & 0 deletions src/components/css/SettingsPanel.css
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@
text-shadow: 0 1px 10px #FFD700, 0 2px 10px #FFAB00;
}
.settings .close {
z-index: 2;
cursor: pointer;
position: absolute;
top: 0;
Expand Down

0 comments on commit 37304cb

Please sign in to comment.