Skip to content

Commit 386fd2b

Browse files
committed
format
1 parent 51b45b8 commit 386fd2b

7 files changed

Lines changed: 32 additions & 20 deletions

File tree

src/components/LightDarkSwitch.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<script lang="ts">
2-
import { SYSTEM_MODE, DARK_MODE, LIGHT_MODE } from "@constants/constants.ts";
2+
import { DARK_MODE, LIGHT_MODE, SYSTEM_MODE } from "@constants/constants.ts";
33
import I18nKey from "@i18n/i18nKey";
44
import { i18n } from "@i18n/translation";
55
import Icon from "@iconify/svelte";

src/components/NoteList.astro

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,9 @@ function getMonthLabel(monthNumber: number): string {
3939
if (!Number.isFinite(monthNumber) || monthNumber < 1 || monthNumber > 12) {
4040
return monthNumber.toString();
4141
}
42-
return monthNames[Math.max(0, Math.min(monthNames.length - 1, monthNumber - 1))];
42+
return monthNames[
43+
Math.max(0, Math.min(monthNames.length - 1, monthNumber - 1))
44+
];
4345
}
4446
4547
const notes = await Promise.all(

src/components/widget/TranslateButton.svelte

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
11
<script lang="ts">
2-
import { LANGUAGE_CHANGE_EVENT, getCurrentLanguage, setCurrentLanguage } from "@/i18n/translation";
32
import Icon from "@iconify/svelte";
43
import { onDestroy, onMount } from "svelte";
4+
import {
5+
getCurrentLanguage,
6+
LANGUAGE_CHANGE_EVENT,
7+
setCurrentLanguage,
8+
} from "@/i18n/translation";
59
610
type LanguageOption = {
711
code: string;
@@ -47,7 +51,10 @@ function selectLanguage(code: string) {
4751
function handleClickOutside(event: MouseEvent) {
4852
if (!isOpen || !translatePanel) return;
4953
const target = event.target as HTMLElement;
50-
if (!translatePanel.contains(target) && !target.closest("#translate-switch")) {
54+
if (
55+
!translatePanel.contains(target) &&
56+
!target.closest("#translate-switch")
57+
) {
5158
isOpen = false;
5259
translatePanel.classList.add("float-panel-closed");
5360
}

src/constants/constants.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,5 +21,3 @@ export const MAIN_PANEL_OVERLAPS_BANNER_HEIGHT = 3;
2121

2222
// Page width: rem
2323
export const PAGE_WIDTH = 90;
24-
25-

src/global.d.ts

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
import type { AstroIntegration } from "@swup/astro";
22

33
declare global {
4-
interface Window {
5-
// type from '@swup/astro' is incorrect
6-
swup: AstroIntegration;
7-
pagefind: {
8-
search: (query: string) => Promise<{
9-
results: Array<{
10-
data: () => Promise<SearchResult>;
4+
interface Window {
5+
// type from '@swup/astro' is incorrect
6+
swup: AstroIntegration;
7+
pagefind: {
8+
search: (query: string) => Promise<{
9+
results: Array<{
10+
data: () => Promise<SearchResult>;
11+
}>;
1112
}>;
12-
}>;
13-
};
14-
}
13+
};
14+
}
1515
}
1616

1717
interface SearchResult {

src/layouts/Layout.astro

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ import {
1212
DARK_MODE,
1313
DEFAULT_THEME,
1414
LIGHT_MODE,
15-
SYSTEM_MODE,
1615
PAGE_WIDTH,
16+
SYSTEM_MODE,
1717
} from "../constants/constants";
1818
import { defaultFavicons } from "../constants/icon";
1919
import type { Favicon } from "../types/config";

src/layouts/MainGridLayout.astro

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,10 @@ const resolveBannerImages = () => {
6262
};
6363
6464
const bannerImages = resolveBannerImages();
65-
const carouselConfig = siteConfig.wallpaper.carousel || { enable: false, interval: 6 };
65+
const carouselConfig = siteConfig.wallpaper.carousel || {
66+
enable: false,
67+
interval: 6,
68+
};
6669
6770
const {
6871
title,
@@ -77,8 +80,10 @@ const hasBannerCredit =
7780
isBannerMode && !!siteConfig.wallpaper.banner?.credit?.enable;
7881
const hasBannerLink = !!siteConfig.wallpaper.banner?.credit?.url;
7982
80-
const mainPanelOverlap =
81-
Math.max(MAIN_PANEL_OVERLAPS_BANNER_HEIGHT - BANNER_WAVE_HEIGHT, 0);
83+
const mainPanelOverlap = Math.max(
84+
MAIN_PANEL_OVERLAPS_BANNER_HEIGHT - BANNER_WAVE_HEIGHT,
85+
0,
86+
);
8287
8388
const mainPanelTop = isBannerMode
8489
? `calc(${BANNER_HEIGHT}vh - ${mainPanelOverlap}rem)`

0 commit comments

Comments
 (0)