design: improve settings page compactness
This commit is contained in:
4 files changed
+51
-28
No files matched your search
@@ -25,7 +25,7 @@
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
dockVisible = (scrollY?.current ?? 0) >= previousTop
|
dockVisible = (scrollY?.current ?? 0) <= previousTop
|
||||||
previousTop = scrollY?.current ?? 0
|
previousTop = scrollY?.current ?? 0
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -38,7 +38,7 @@
|
|||||||
<div
|
<div
|
||||||
class={[
|
class={[
|
||||||
'fixed bottom-0 lg:top-0',
|
'fixed bottom-0 lg:top-0',
|
||||||
dockVisible && 'max-lg:-bottom-24',
|
!dockVisible && 'max-lg:-bottom-24',
|
||||||
'max-w-3xl p-4 left-1/2 -translate-x-1/2 lg:max-w-full lg:p-0 lg:left-0 lg:translate-x-0',
|
'max-w-3xl p-4 left-1/2 -translate-x-1/2 lg:max-w-full lg:p-0 lg:left-0 lg:translate-x-0',
|
||||||
'w-full z-50 pointer-events-none',
|
'w-full z-50 pointer-events-none',
|
||||||
]}
|
]}
|
||||||
|
|||||||
@@ -305,11 +305,7 @@
|
|||||||
</p>
|
</p>
|
||||||
{/snippet}
|
{/snippet}
|
||||||
</Setting>
|
</Setting>
|
||||||
<Setting
|
<Setting optionClass="flex-2 max-w-full flex-wrap min-w-0 " icon={ChartBar}>
|
||||||
optionClass="flex-2 max-w-full flex-wrap min-w-0 "
|
|
||||||
itemsClass="flex-col items-start! lg:items-center! lg:flex-row"
|
|
||||||
icon={ChartBar}
|
|
||||||
>
|
|
||||||
{#snippet title()}
|
{#snippet title()}
|
||||||
<span>{$t('settings.app.sort.title')}</span>
|
<span>{$t('settings.app.sort.title')}</span>
|
||||||
{/snippet}
|
{/snippet}
|
||||||
@@ -607,7 +603,7 @@
|
|||||||
</Section>
|
</Section>
|
||||||
|
|
||||||
<Section id="moderation" title={$t('settings.moderation.title')}>
|
<Section id="moderation" title={$t('settings.moderation.title')}>
|
||||||
<Setting icon={Trash} itemsClass="flex-col! items-start!">
|
<Setting icon={Trash}>
|
||||||
{#snippet title()}
|
{#snippet title()}
|
||||||
<span>{$t('settings.moderation.replyPresets.title')}</span>
|
<span>{$t('settings.moderation.replyPresets.title')}</span>
|
||||||
{/snippet}
|
{/snippet}
|
||||||
|
|||||||
@@ -16,7 +16,6 @@
|
|||||||
mobile: boolean
|
mobile: boolean
|
||||||
}
|
}
|
||||||
mainClass?: string
|
mainClass?: string
|
||||||
itemsClass?: string
|
|
||||||
optionClass?: string
|
optionClass?: string
|
||||||
class?: string
|
class?: string
|
||||||
title?: import('svelte').Snippet
|
title?: import('svelte').Snippet
|
||||||
@@ -32,7 +31,6 @@
|
|||||||
mobile: true,
|
mobile: true,
|
||||||
},
|
},
|
||||||
mainClass = '',
|
mainClass = '',
|
||||||
itemsClass = '',
|
|
||||||
optionClass = '',
|
optionClass = '',
|
||||||
class: clazz = '',
|
class: clazz = '',
|
||||||
title,
|
title,
|
||||||
@@ -76,30 +74,37 @@
|
|||||||
{/if}
|
{/if}
|
||||||
</div>
|
</div>
|
||||||
{/if}
|
{/if}
|
||||||
<div
|
<div class={['setting-grid items-center', clazz]}>
|
||||||
class="flex flex-col @md/setting:flex-row items-center gap-2 {itemsClass}"
|
|
||||||
>
|
|
||||||
{#if icon}
|
{#if icon}
|
||||||
<Icon
|
<Icon
|
||||||
src={icon}
|
src={icon}
|
||||||
size="32"
|
size="32"
|
||||||
class="bg-red-200/20 dark:bg-red-800/20 p-1.5 self-start @md/setting:self-center rounded-lg color text-red-500 dark:text-red-200"
|
class="bg-red-200/20 dark:bg-red-800/20 p-1.5 rounded-lg color
|
||||||
|
text-red-500 dark:text-red-400 float-left mr-2 clear-both"
|
||||||
|
style="grid-area: icon;"
|
||||||
/>
|
/>
|
||||||
{/if}
|
{/if}
|
||||||
<div class="flex flex-col gap-0.5 flex-2 w-full shrink-0 min-w-48 {clazz}">
|
<h2
|
||||||
<h1 class="font-medium text-base">
|
class="font-medium text-base"
|
||||||
{@render title?.()}
|
style="grid-area: title; place-self: end start;"
|
||||||
</h1>
|
>
|
||||||
{#if description}
|
{@render title?.()}
|
||||||
<div class="text-slate-600 dark:text-zinc-400 text-sm">
|
</h2>
|
||||||
{@render description?.()}
|
{#if description}
|
||||||
</div>
|
<p
|
||||||
{/if}
|
class="text-slate-600 dark:text-zinc-400 text-sm"
|
||||||
</div>
|
style="grid-area: description; place-self: start start;"
|
||||||
|
>
|
||||||
|
{@render description?.()}
|
||||||
|
</p>
|
||||||
|
{/if}
|
||||||
{#if children}
|
{#if children}
|
||||||
<div
|
<div
|
||||||
class="w-full flex flex-col gap-2 flex-1 max-w-full
|
class={[
|
||||||
@md/setting:items-end shrink-0 {optionClass}"
|
'w-full flex flex-col gap-2 flex-1 max-w-full shrink-0 row-span-2 max-md:mt-2',
|
||||||
|
optionClass,
|
||||||
|
]}
|
||||||
|
style="grid-area: children;"
|
||||||
>
|
>
|
||||||
{@render children?.()}
|
{@render children?.()}
|
||||||
</div>
|
</div>
|
||||||
@@ -108,6 +113,27 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<style>
|
<style>
|
||||||
|
.setting-grid {
|
||||||
|
display: grid;
|
||||||
|
grid-template-columns: auto 1fr;
|
||||||
|
grid-template-rows: auto auto auto;
|
||||||
|
grid-template-areas:
|
||||||
|
'icon title'
|
||||||
|
'icon description'
|
||||||
|
'children children';
|
||||||
|
}
|
||||||
|
|
||||||
|
@media screen and (min-width: 768px) {
|
||||||
|
.setting-grid {
|
||||||
|
display: grid;
|
||||||
|
grid-template-columns: auto 1fr auto;
|
||||||
|
grid-template-rows: auto auto;
|
||||||
|
grid-template-areas:
|
||||||
|
'icon title children'
|
||||||
|
'icon description children';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
:global(.setting:nth-child(17n + 1) .color) {
|
:global(.setting:nth-child(17n + 1) .color) {
|
||||||
filter: hue-rotate(10deg);
|
filter: hue-rotate(10deg);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -72,12 +72,13 @@
|
|||||||
{/if}
|
{/if}
|
||||||
</div>
|
</div>
|
||||||
{/if}
|
{/if}
|
||||||
<div class="flex flex-col @md/setting:flex-row gap-2">
|
<div class="flex @md/setting:flex-row gap-2">
|
||||||
{#if icon}
|
{#if icon}
|
||||||
<Icon
|
<Icon
|
||||||
src={icon}
|
src={icon}
|
||||||
size="32"
|
size="32"
|
||||||
class="bg-red-200/20 dark:bg-red-800/20 p-1.5 self-start @md/setting:self-center rounded-lg color text-red-500 dark:text-red-200"
|
class="bg-red-200/20 dark:bg-red-800/20 p-1.5 self-center
|
||||||
|
rounded-lg color text-red-500 dark:text-red-400"
|
||||||
/>
|
/>
|
||||||
{/if}
|
{/if}
|
||||||
<Switch
|
<Switch
|
||||||
|
|||||||
Reference in new issue
Block a user