feat: add icons to settings page (#607)

This commit is contained in:
Xylight authored and GitHub committed 2025-07-11 01:15:51 +00:00
1 parent d48cdffcee
commit 10e96e86e9
3 files changed
+149 -23

No files matched your search

+68 -1
View File
@@ -6,6 +6,7 @@
DevicePhoneMobile,
DeviceTablet,
Icon,
type IconSource,
} from 'svelte-hero-icons'
interface Props {
@@ -21,6 +22,7 @@
title?: import('svelte').Snippet
description?: import('svelte').Snippet
children?: import('svelte').Snippet
icon?: IconSource
}
let {
@@ -36,11 +38,15 @@
title,
description,
children,
icon,
}: Props = $props()
</script>
<div
class="flex flex-col w-full justify-between gap-2 max-w-full @container/setting {mainClass}"
class={[
'flex flex-col w-full justify-between gap-2 max-w-full @container/setting setting',
mainClass,
]}
>
{#if Object.values(supportedPlatforms).some(v => v == false)}
<div class="flex items-center gap-2 flex-wrap">
@@ -73,6 +79,13 @@
<div
class="flex flex-col @md/setting:flex-row items-center gap-2 {itemsClass}"
>
{#if icon}
<Icon
src={icon}
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"
/>
{/if}
<div class="flex flex-col gap-0.5 flex-2 w-full shrink-0 min-w-48 {clazz}">
<h1 class="font-medium text-base">
{@render title?.()}
@@ -93,3 +106,57 @@
{/if}
</div>
</div>
<style>
:global(.setting:nth-child(17n + 1) .color) {
filter: hue-rotate(10deg);
}
:global(.setting:nth-child(17n + 2) .color) {
filter: hue-rotate(30deg);
}
:global(.setting:nth-child(17n + 3) .color) {
filter: hue-rotate(50deg);
}
:global(.setting:nth-child(17n + 4) .color) {
filter: hue-rotate(70deg);
}
:global(.setting:nth-child(17n + 5) .color) {
filter: hue-rotate(90deg);
}
:global(.setting:nth-child(17n + 6) .color) {
filter: hue-rotate(110deg);
}
:global(.setting:nth-child(17n + 7) .color) {
filter: hue-rotate(130deg);
}
:global(.setting:nth-child(17n + 8) .color) {
filter: hue-rotate(150deg);
}
:global(.setting:nth-child(17n + 9) .color) {
filter: hue-rotate(170deg);
}
:global(.setting:nth-child(17n + 10) .color) {
filter: hue-rotate(190deg);
}
:global(.setting:nth-child(17n + 11) .color) {
filter: hue-rotate(210deg);
}
:global(.setting:nth-child(17n + 12) .color) {
filter: hue-rotate(230deg);
}
:global(.setting:nth-child(17n + 13) .color) {
filter: hue-rotate(250deg);
}
:global(.setting:nth-child(17n + 14) .color) {
filter: hue-rotate(270deg);
}
:global(.setting:nth-child(17n + 15) .color) {
filter: hue-rotate(290deg);
}
:global(.setting:nth-child(17n + 16) .color) {
filter: hue-rotate(310deg);
}
:global(.setting:nth-child(17n + 17) .color) {
filter: hue-rotate(330deg);
}
</style>