2024-06-29 20:23:56 +02:00
|
|
|
<script lang="ts">
|
2024-07-23 13:42:13 +02:00
|
|
|
import { onMount } from "svelte";
|
2024-07-21 11:42:48 +02:00
|
|
|
|
2024-07-29 10:46:10 +02:00
|
|
|
import type { Optional } from "$lib/types/generic";
|
|
|
|
|
|
|
|
import Skeleton from "$components/misc/Skeleton.svelte";
|
|
|
|
|
2024-06-29 20:23:56 +02:00
|
|
|
export let version: string;
|
|
|
|
export let title: string;
|
2024-07-21 13:30:06 +02:00
|
|
|
export let date: string;
|
2024-07-21 19:26:21 +02:00
|
|
|
export let banner: Optional<{ file: string; alt: string }>;
|
2024-07-17 11:07:25 +02:00
|
|
|
|
2024-07-21 11:42:48 +02:00
|
|
|
let bannerLoaded = false;
|
|
|
|
|
2024-07-17 11:07:25 +02:00
|
|
|
const formatDate = (dateString: string) => {
|
|
|
|
const date = new Date(dateString);
|
|
|
|
|
|
|
|
const months = ['January', 'February', 'March', 'April', 'May',
|
|
|
|
'June', 'July', 'August', 'September', 'October',
|
|
|
|
'November', 'December'];
|
|
|
|
|
|
|
|
return [
|
|
|
|
months[date.getUTCMonth()],
|
|
|
|
(date.getUTCDate() + 1) + ',',
|
|
|
|
date.getUTCFullYear()
|
|
|
|
].join(' ');
|
|
|
|
}
|
2024-07-23 13:42:13 +02:00
|
|
|
|
|
|
|
onMount(() => {
|
|
|
|
const to_focus: HTMLElement | null =
|
|
|
|
document.querySelector("[data-first-focus]");
|
|
|
|
to_focus?.focus();
|
|
|
|
});
|
2024-06-29 20:23:56 +02:00
|
|
|
</script>
|
2024-07-17 09:32:07 +02:00
|
|
|
|
2024-07-29 10:46:10 +02:00
|
|
|
<main id="changelog-parent">
|
2024-07-21 10:45:24 +02:00
|
|
|
<div id="changelog-header" class:no-padding={!banner}>
|
2024-07-17 10:04:53 +02:00
|
|
|
<div class="changelog-info">
|
2024-07-23 14:18:18 +02:00
|
|
|
<div
|
|
|
|
class="changelog-version"
|
|
|
|
data-first-focus
|
|
|
|
data-focus-ring-hidden
|
|
|
|
tabindex="-1"
|
|
|
|
>{version}</div>
|
2024-07-21 13:31:55 +02:00
|
|
|
<div class="changelog-date">{formatDate(date)}</div>
|
2024-07-17 10:04:53 +02:00
|
|
|
</div>
|
|
|
|
<h1 class="changelog-title">{title}</h1>
|
|
|
|
</div>
|
2024-07-17 09:32:07 +02:00
|
|
|
<div class="changelog-content">
|
|
|
|
{#if banner}
|
|
|
|
<img
|
|
|
|
src={`/update-banners/${banner.file}`}
|
|
|
|
alt={banner.alt}
|
2024-07-21 11:42:48 +02:00
|
|
|
class:loading={!bannerLoaded}
|
|
|
|
on:load={() => bannerLoaded = true}
|
2024-07-17 09:32:07 +02:00
|
|
|
class="changelog-banner"
|
|
|
|
/>
|
2024-07-21 11:42:48 +02:00
|
|
|
|
|
|
|
<Skeleton
|
|
|
|
class="big changelog-banner"
|
|
|
|
hidden={bannerLoaded}
|
|
|
|
/>
|
2024-07-17 09:32:07 +02:00
|
|
|
{/if}
|
2024-07-29 10:46:10 +02:00
|
|
|
<div class="changelog-body">
|
2024-07-17 09:32:07 +02:00
|
|
|
<slot></slot>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</main>
|
|
|
|
|
2024-07-29 10:46:10 +02:00
|
|
|
<style>
|
|
|
|
/* all styles are global because of skeleton */
|
|
|
|
|
|
|
|
:global(#changelog-parent) {
|
|
|
|
overflow-x: hidden;
|
|
|
|
}
|
|
|
|
|
|
|
|
:global(#changelog-header) {
|
|
|
|
display: flex;
|
|
|
|
flex-direction: column;
|
|
|
|
align-items: start;
|
|
|
|
gap: calc(var(--padding) / 2);
|
|
|
|
padding-bottom: 1em; /* match default <p> padding */
|
|
|
|
}
|
|
|
|
|
|
|
|
:global(#changelog-header.no-padding) {
|
|
|
|
padding-bottom: 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
:global(.changelog-info) {
|
|
|
|
display: flex;
|
|
|
|
flex-direction: row;
|
|
|
|
align-items: center;
|
|
|
|
gap: 14px;
|
|
|
|
}
|
|
|
|
|
|
|
|
:global(.changelog-version) {
|
|
|
|
padding: 3px 8px;
|
|
|
|
border-radius: 6px;
|
|
|
|
background-color: var(--secondary);
|
|
|
|
color: var(--primary);
|
|
|
|
font-size: 18px;
|
|
|
|
font-weight: 500;
|
|
|
|
}
|
|
|
|
|
|
|
|
:global(.changelog-date) {
|
|
|
|
font-size: 13px;
|
|
|
|
font-weight: 500;
|
|
|
|
color: var(--gray);
|
|
|
|
}
|
|
|
|
|
|
|
|
:global(.changelog-title) {
|
|
|
|
padding: 0;
|
|
|
|
line-height: 1.2;
|
|
|
|
font-size: 23px;
|
|
|
|
user-select: text;
|
|
|
|
-webkit-user-select: text
|
|
|
|
}
|
|
|
|
|
|
|
|
:global(.changelog-banner) {
|
|
|
|
display: block;
|
|
|
|
object-fit: cover;
|
|
|
|
max-height: 320pt;
|
|
|
|
min-height: 210pt;
|
|
|
|
width: 100%;
|
|
|
|
aspect-ratio: 16/9;
|
|
|
|
border-radius: var(--padding);
|
|
|
|
}
|
|
|
|
|
|
|
|
:global(.changelog-banner.loading) {
|
|
|
|
display: none;
|
|
|
|
}
|
|
|
|
|
|
|
|
:global(.changelog-content) {
|
|
|
|
display: flex;
|
|
|
|
flex-direction: column;
|
|
|
|
align-items: center;
|
|
|
|
}
|
|
|
|
|
|
|
|
:global(.changelog-body) {
|
|
|
|
width: 100%;
|
|
|
|
}
|
|
|
|
|
|
|
|
:global(.changelog-body),
|
|
|
|
:global(.changelog-body) :global(*) {
|
|
|
|
line-height: 1.7;
|
|
|
|
font-size: 14.5px;
|
|
|
|
font-weight: 410;
|
|
|
|
font-family: "Noto Sans Mono Variable", "Noto Sans Mono", monospace;
|
|
|
|
user-select: text;
|
|
|
|
-webkit-user-select: text;
|
|
|
|
}
|
|
|
|
|
|
|
|
:global(.changelog-body ul) {
|
|
|
|
padding-inline-start: 30px;
|
|
|
|
}
|
|
|
|
|
|
|
|
:global(.changelog-body li) {
|
|
|
|
padding-left: 3px;
|
|
|
|
}
|
|
|
|
|
|
|
|
@media screen and (max-width: 535px) {
|
|
|
|
:global(.changelog-body),
|
|
|
|
:global(.changelog-body) :global(*) {
|
|
|
|
font-size: 14px;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
</style>
|