2024-06-24 15:42:31 +02:00
|
|
|
<script lang="ts">
|
2024-07-07 17:51:46 +02:00
|
|
|
import { page } from "$app/stores";
|
2024-09-17 16:05:25 +02:00
|
|
|
import { copyURL as _copyURL } from "$lib/download";
|
2024-09-18 11:28:09 +02:00
|
|
|
|
|
|
|
import SectionHeading from "$components/misc/SectionHeading.svelte";
|
2024-07-07 17:51:46 +02:00
|
|
|
|
2024-06-24 19:05:51 +02:00
|
|
|
export let title: string;
|
2024-08-30 13:15:05 +02:00
|
|
|
export let sectionId: string;
|
|
|
|
|
|
|
|
export let disabled = false;
|
2024-08-31 11:32:02 +02:00
|
|
|
export let beta = false;
|
2024-07-07 17:51:46 +02:00
|
|
|
|
2024-09-08 20:10:53 +02:00
|
|
|
let focus = false;
|
2024-09-17 16:05:25 +02:00
|
|
|
let copied = false;
|
2024-07-07 17:51:46 +02:00
|
|
|
|
|
|
|
$: hash = $page.url.hash.replace("#", "");
|
|
|
|
|
|
|
|
$: if (hash === sectionId) {
|
2024-09-08 20:10:53 +02:00
|
|
|
focus = true;
|
2024-07-07 17:51:46 +02:00
|
|
|
}
|
2024-09-17 16:05:25 +02:00
|
|
|
|
|
|
|
$: if (copied) {
|
|
|
|
setTimeout(() => {
|
|
|
|
copied = false;
|
|
|
|
}, 1500);
|
|
|
|
}
|
2024-06-24 15:42:31 +02:00
|
|
|
</script>
|
|
|
|
|
2024-07-07 17:51:46 +02:00
|
|
|
<section
|
|
|
|
id={sectionId}
|
|
|
|
class="settings-content"
|
2024-09-08 20:10:53 +02:00
|
|
|
class:focus
|
2024-08-30 13:15:05 +02:00
|
|
|
class:disabled
|
|
|
|
aria-hidden={disabled}
|
2024-07-07 17:51:46 +02:00
|
|
|
>
|
2024-09-18 11:28:09 +02:00
|
|
|
<SectionHeading {title} {sectionId} {beta} />
|
2024-06-24 19:05:51 +02:00
|
|
|
<slot></slot>
|
2024-07-07 15:14:49 +02:00
|
|
|
</section>
|
2024-06-24 15:42:31 +02:00
|
|
|
|
2024-06-24 19:05:51 +02:00
|
|
|
<style>
|
|
|
|
.settings-content {
|
2024-06-24 15:42:31 +02:00
|
|
|
display: flex;
|
2024-06-24 19:05:51 +02:00
|
|
|
flex-direction: column;
|
2024-07-10 15:35:23 +02:00
|
|
|
gap: var(--padding);
|
2024-09-04 13:50:47 +02:00
|
|
|
padding: calc(var(--subnav-padding) / 2);
|
2024-07-07 17:51:46 +02:00
|
|
|
border-radius: 18px;
|
2024-08-30 13:15:05 +02:00
|
|
|
transition: opacity 0.2s;
|
|
|
|
}
|
|
|
|
|
|
|
|
.settings-content.disabled {
|
|
|
|
opacity: 0.5;
|
2024-10-05 17:42:02 +02:00
|
|
|
pointer-events: none;
|
2024-07-07 17:51:46 +02:00
|
|
|
}
|
|
|
|
|
2024-09-08 20:10:53 +02:00
|
|
|
.settings-content.focus {
|
2024-07-07 17:51:46 +02:00
|
|
|
animation: highlight 2s;
|
|
|
|
}
|
|
|
|
|
2024-09-08 20:10:53 +02:00
|
|
|
:global([data-reduce-motion="true"]) .settings-content.focus {
|
2024-07-12 14:49:29 +02:00
|
|
|
animation: highlight-lite 2s !important;
|
|
|
|
}
|
|
|
|
|
2024-07-07 17:51:46 +02:00
|
|
|
@keyframes highlight {
|
|
|
|
0% {
|
|
|
|
box-shadow: none;
|
|
|
|
}
|
|
|
|
10% {
|
|
|
|
box-shadow: 0 0 0 3.5px var(--blue) inset;
|
|
|
|
}
|
|
|
|
20%, 50% {
|
|
|
|
box-shadow: 0 0 0 3px var(--blue) inset;
|
|
|
|
}
|
|
|
|
100% {
|
|
|
|
box-shadow: none;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2024-07-12 14:49:29 +02:00
|
|
|
@keyframes highlight-lite {
|
|
|
|
0% {
|
|
|
|
box-shadow: none;
|
|
|
|
}
|
|
|
|
10%, 50% {
|
|
|
|
box-shadow: 0 0 0 3px var(--blue) inset;
|
|
|
|
}
|
|
|
|
100% {
|
|
|
|
box-shadow: none;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2024-07-07 17:51:46 +02:00
|
|
|
@media screen and (max-width: 750px) {
|
|
|
|
.settings-content {
|
|
|
|
padding: var(--padding);
|
|
|
|
}
|
2024-06-24 15:42:31 +02:00
|
|
|
}
|
|
|
|
</style>
|