2024-06-24 19:05:51 +02:00
|
|
|
<script lang="ts">
|
|
|
|
import { page } from "$app/stores";
|
|
|
|
|
2024-06-25 10:50:59 +02:00
|
|
|
import IconChevronRight from "@tabler/icons-svelte/IconChevronRight.svelte";
|
|
|
|
|
2024-06-24 19:46:37 +02:00
|
|
|
export let tabName: string;
|
|
|
|
export let tabLink: string;
|
2024-06-24 19:05:51 +02:00
|
|
|
export let iconColor: "gray" | "blue" | "green" = "gray";
|
|
|
|
|
2024-06-24 19:46:37 +02:00
|
|
|
$: isActive = $page.url.pathname === `/settings/${tabLink}`;
|
2024-06-24 19:05:51 +02:00
|
|
|
</script>
|
|
|
|
|
|
|
|
<a
|
2024-06-24 19:46:37 +02:00
|
|
|
class="settings-tab"
|
|
|
|
href="/settings/{tabLink}"
|
2024-06-24 19:05:51 +02:00
|
|
|
class:active={isActive}
|
2024-06-25 10:50:59 +02:00
|
|
|
>
|
|
|
|
<div class="settings-tab-left">
|
|
|
|
<div class="tab-icon" style="background: var(--{iconColor})">
|
|
|
|
<slot></slot>
|
|
|
|
</div>
|
|
|
|
<span>{tabName}</span>
|
2024-06-24 19:05:51 +02:00
|
|
|
</div>
|
2024-06-25 11:44:06 +02:00
|
|
|
<div class="settings-tab-chevron">
|
|
|
|
<IconChevronRight />
|
|
|
|
</div>
|
2024-06-24 19:05:51 +02:00
|
|
|
</a>
|
|
|
|
|
|
|
|
<style>
|
2024-06-24 19:46:37 +02:00
|
|
|
.settings-tab {
|
2024-06-25 09:07:43 +02:00
|
|
|
--small-padding: 4px;
|
2024-06-30 11:58:40 +02:00
|
|
|
--big-padding: 7px;
|
2024-06-24 19:05:51 +02:00
|
|
|
display: flex;
|
|
|
|
flex-direction: row;
|
|
|
|
align-items: center;
|
2024-06-25 10:50:59 +02:00
|
|
|
justify-content: space-between;
|
2024-06-25 09:07:43 +02:00
|
|
|
gap: calc(var(--small-padding) * 2);
|
2024-06-30 11:58:40 +02:00
|
|
|
padding: var(--big-padding);
|
2024-06-24 19:05:51 +02:00
|
|
|
font-weight: 500;
|
|
|
|
background: var(--primary);
|
|
|
|
color: var(--button-text);
|
|
|
|
border-radius: var(--border-radius);
|
2024-06-25 11:44:06 +02:00
|
|
|
overflow: hidden;
|
2024-06-24 19:05:51 +02:00
|
|
|
}
|
|
|
|
|
2024-06-25 10:50:59 +02:00
|
|
|
.settings-tab-left {
|
|
|
|
display: flex;
|
|
|
|
flex-direction: row;
|
|
|
|
align-items: center;
|
2024-06-30 11:58:40 +02:00
|
|
|
gap: calc(var(--big-padding) * 1.5);
|
2024-06-25 10:50:59 +02:00
|
|
|
font-weight: 500;
|
|
|
|
}
|
|
|
|
|
2024-06-24 19:46:37 +02:00
|
|
|
.settings-tab :global(svg) {
|
|
|
|
stroke-width: 1.5px;
|
2024-06-30 11:58:40 +02:00
|
|
|
height: 20px;
|
|
|
|
width: 20px;
|
2024-06-24 19:46:37 +02:00
|
|
|
}
|
|
|
|
|
2024-06-25 10:50:59 +02:00
|
|
|
.settings-tab .tab-icon :global(svg) {
|
|
|
|
stroke: var(--white);
|
|
|
|
}
|
|
|
|
|
2024-06-25 11:44:06 +02:00
|
|
|
.settings-tab-chevron :global(svg) {
|
2024-06-25 10:50:59 +02:00
|
|
|
display: none;
|
|
|
|
stroke: var(--secondary);
|
|
|
|
}
|
|
|
|
|
|
|
|
@media (hover: hover) {
|
|
|
|
.settings-tab:hover {
|
|
|
|
background: var(--button-hover-transparent);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
.settings-tab:active {
|
2024-06-24 19:05:51 +02:00
|
|
|
background: var(--button-hover-transparent);
|
|
|
|
}
|
|
|
|
|
2024-06-24 19:46:37 +02:00
|
|
|
.settings-tab.active {
|
2024-06-24 19:22:30 +02:00
|
|
|
background: var(--secondary);
|
|
|
|
color: var(--primary);
|
|
|
|
}
|
|
|
|
|
2024-06-24 19:46:37 +02:00
|
|
|
.settings-tab span {
|
2024-06-24 19:05:51 +02:00
|
|
|
font-size: 14.5px;
|
|
|
|
}
|
|
|
|
|
2024-06-24 19:46:37 +02:00
|
|
|
.tab-icon {
|
2024-06-24 19:05:51 +02:00
|
|
|
display: flex;
|
|
|
|
justify-content: center;
|
|
|
|
align-items: center;
|
2024-06-25 09:07:43 +02:00
|
|
|
padding: var(--small-padding);
|
|
|
|
border-radius: var(--small-padding);
|
2024-06-24 19:05:51 +02:00
|
|
|
}
|
2024-06-25 10:50:59 +02:00
|
|
|
|
|
|
|
@media screen and (max-width: 750px) {
|
|
|
|
.settings-tab {
|
|
|
|
background: none;
|
2024-06-30 11:58:40 +02:00
|
|
|
padding: var(--big-padding) calc(var(--big-padding) * 1.5);
|
|
|
|
}
|
|
|
|
|
|
|
|
.settings-tab-left {
|
|
|
|
gap: calc(var(--big-padding) * 1.5);
|
|
|
|
}
|
|
|
|
|
|
|
|
.settings-tab:not(:last-child) {
|
|
|
|
border-bottom-left-radius: 0;
|
|
|
|
border-bottom-right-radius: 0;
|
|
|
|
box-shadow: 0 3px 0px -1.7px var(--button-stroke);
|
2024-06-25 10:50:59 +02:00
|
|
|
}
|
|
|
|
|
2024-06-30 11:58:40 +02:00
|
|
|
.settings-tab:not(:first-child) {
|
|
|
|
border-top-left-radius: 0;
|
|
|
|
border-top-right-radius: 0;
|
2024-06-25 10:50:59 +02:00
|
|
|
}
|
|
|
|
|
2024-06-25 11:44:06 +02:00
|
|
|
.settings-tab-chevron :global(svg) {
|
2024-06-25 10:50:59 +02:00
|
|
|
display: block;
|
|
|
|
}
|
|
|
|
}
|
2024-06-24 19:05:51 +02:00
|
|
|
</style>
|