web: mobile improvements

- all buttons now reflect that they're pressed or hovered
- settings feel way better on mobile
- settings header has been completely remade
This commit is contained in:
wukko 2024-06-25 20:59:25 +06:00
parent 49e2df425d
commit 7b289bfb16
No known key found for this signature in database
GPG key ID: 3E30B3F26C7B4AA2
6 changed files with 54 additions and 18 deletions

View file

@ -52,10 +52,10 @@
flex-direction: row; flex-direction: row;
align-items: center; align-items: center;
gap: 12px; gap: 12px;
justify-content: start; justify-content: start;
text-align: left; text-align: left;
transform: none; transform: none;
padding: 6px 12px;
} }
.checkbox-text { .checkbox-text {

View file

@ -30,6 +30,18 @@
#settings-section-categories { #settings-section-categories {
background: var(--button); background: var(--button);
border-radius: var(--border-radius); border-radius: var(--border-radius);
box-shadow: var(--button-box-shadow);
}
#settings-section-categories > :global(:not(.settings-tab:last-child)) {
border-bottom-left-radius: 0;
border-bottom-right-radius: 0;
box-shadow: 0 3px 0px -1.2px var(--button-stroke);
}
#settings-section-categories > :global(:not(.settings-tab:first-child)) {
border-top-left-radius: 0;
border-top-right-radius: 0;
} }
} }
</style> </style>

View file

@ -95,6 +95,7 @@
@media screen and (max-width: 750px) { @media screen and (max-width: 750px) {
.settings-tab { .settings-tab {
background: none; background: none;
padding: 9px;
--small-padding: 5px; --small-padding: 5px;
} }

View file

@ -70,9 +70,15 @@
opacity: 1; opacity: 1;
} }
@media (hover: hover) { .sidebar-tab:active:not(.active) {
.sidebar-tab:hover {
opacity: 1; opacity: 1;
background-color: var(--sidebar-hover);
}
@media (hover: hover) {
.sidebar-tab:hover:not(.active) {
opacity: 1;
background-color: var(--sidebar-hover);
} }
} }

View file

@ -26,9 +26,11 @@
--button-hover-transparent: rgba(0, 0, 0, 0.06); --button-hover-transparent: rgba(0, 0, 0, 0.06);
--button-stroke: rgba(0, 0, 0, 0.05); --button-stroke: rgba(0, 0, 0, 0.05);
--button-text: #282828; --button-text: #282828;
--button-box-shadow: 0 0 0 1.5px var(--button-stroke) inset;
--sidebar-bg: #000000; --sidebar-bg: #000000;
--sidebar-highlight: #ffffff; --sidebar-highlight: #ffffff;
--sidebar-hover: rgba(255, 255, 255, 0.1);
--input-border: #8d8d95; --input-border: #8d8d95;
@ -129,7 +131,7 @@
cursor: pointer; cursor: pointer;
background-color: var(--button); background-color: var(--button);
color: var(--button-text); color: var(--button-text);
box-shadow: 0 0 0 1.5px var(--button-stroke) inset; box-shadow: var(--button-box-shadow);
} }
:global(:focus-visible) { :global(:focus-visible) {
@ -139,7 +141,7 @@
} }
:global(button:active) { :global(button:active) {
transform: scale(0.95); background-color: var(--button-hover);
} }
:global(.button.active) { :global(.button.active) {

View file

@ -14,6 +14,8 @@
let screenWidth: number; let screenWidth: number;
$: currentPageTitle = $page.url.pathname.split("/").at(-1);
$: isMobile = screenWidth <= 750; $: isMobile = screenWidth <= 750;
$: isHome = $page.url.pathname === `/settings`; $: isHome = $page.url.pathname === `/settings`;
</script> </script>
@ -23,11 +25,19 @@
<div id="settings-page"> <div id="settings-page">
<div id="settings-sidebar"> <div id="settings-sidebar">
<div id="settings-header" class:back-visible={!isHome && isMobile}> <div id="settings-header" class:back-visible={!isHome && isMobile}>
{#if !isHome && isMobile} {#if isMobile}
{#if !isHome}
<a class="back-button" href="/settings"> <a class="back-button" href="/settings">
<IconChevronLeft /> <IconChevronLeft />
<h2 id="settings-page-title">settings</h2>
</a> </a>
{/if}
<h3 id="settings-page-title">
settings
{#if !isHome}
<span class="title-slash"> / </span>
{currentPageTitle}
{/if}
</h3>
{:else} {:else}
<h2 id="settings-page-title">settings</h2> <h2 id="settings-page-title">settings</h2>
{/if} {/if}
@ -77,7 +87,9 @@
#settings-page { #settings-page {
--settings-nav-width: 250px; --settings-nav-width: 250px;
--settings-padding: 30px; --settings-padding: 30px;
--settings-padding-small: calc(var(--settings-padding) - var(--padding)); --settings-padding-small: calc(
var(--settings-padding) - var(--padding)
);
display: grid; display: grid;
width: 100%; width: 100%;
grid-template-columns: var(--settings-nav-width) 1fr; grid-template-columns: var(--settings-nav-width) 1fr;
@ -110,11 +122,11 @@
} }
#settings-navigation { #settings-navigation {
gap: 12px; gap: var(--padding);
} }
#settings-header { #settings-header {
--back-padding: 6px; --back-padding: calc(var(--padding) / 2);
} }
.back-button { .back-button {
@ -123,7 +135,9 @@
color: var(--secondary); color: var(--secondary);
gap: var(--back-padding); gap: var(--back-padding);
padding: var(--back-padding); padding: var(--back-padding);
padding-right: calc(var(--back-padding) * 2);
position: absolute;
left: var(--back-padding);
} }
.back-button:active { .back-button:active {
@ -166,10 +180,7 @@
position: sticky; position: sticky;
padding: var(--padding); padding: var(--padding);
gap: 4px; gap: 4px;
} justify-content: center;
#settings-header.back-visible {
padding: calc(var(--padding) - var(--back-padding));
} }
#settings-sidebar { #settings-sidebar {
@ -178,7 +189,11 @@
#settings-page-title { #settings-page-title {
text-align: center; text-align: center;
font-size: 16px; letter-spacing: -0.3px;
}
.title-slash {
color: var(--gray);
} }
#settings-navigation { #settings-navigation {