Initial commit

This commit is contained in:
2026-02-02 22:47:52 +03:00
committed by GitHub
commit f53016aeda
239 changed files with 84360 additions and 0 deletions

View File

@@ -0,0 +1,22 @@
/**
* Width breakpoints
* Dynamically read from src/styles/main.css @theme configuration
*/
const getBreakpoint = (name: string, fallback: number): number => {
if (typeof window === "undefined") return fallback;
// Tailwind v4 exports @theme variables as standard CSS variables
const value = getComputedStyle(document.documentElement)
.getPropertyValue(`--breakpoint-${name}`)
.trim();
// Remove 'px' unit and convert to number
const parsed = parseInt(value, 10);
return isNaN(parsed) ? fallback : parsed;
};
export const BREAKPOINT_SM = getBreakpoint("sm", 512); // Tailwind sm
export const BREAKPOINT_MD = getBreakpoint("md", 768); // Tailwind md
export const BREAKPOINT_LG = getBreakpoint("lg", 1280); // Tailwind lg
export const BREAKPOINT_XL = getBreakpoint("xl", 1920); // Tailwind xl

View File

@@ -0,0 +1,26 @@
export const PAGE_SIZE = 8;
export const LIGHT_MODE = "light",
DARK_MODE = "dark",
SYSTEM_MODE = "system";
export const WALLPAPER_FULLSCREEN = "fullscreen",
WALLPAPER_BANNER = "banner",
WALLPAPER_NONE = "none";
// Navbar height (px)
export const NAVBAR_HEIGHT = 88;
// Banner height unit (vh)
export const BANNER_HEIGHT = 30;
export const BANNER_HEIGHT_EXTEND = 36;
export const BANNER_HEIGHT_HOME = BANNER_HEIGHT + BANNER_HEIGHT_EXTEND;
// The height the main panel overlaps the banner (rem)
export const MAIN_PANEL_OVERLAPS_BANNER_HEIGHT = 0;
// Page width (rem)
export const PAGE_WIDTH = 90;
// Category constants
export const UNCATEGORIZED = "uncategorized";

15
src/constants/icon.ts Normal file
View File

@@ -0,0 +1,15 @@
import type { Favicon } from "@/types/config.ts";
export const defaultFavicons: Favicon[] = [
{
src: "/favicon/icon-light.ico",
theme: "light",
sizes: "96x96",
},
{
src: "/favicon/icon-dark.ico",
theme: "dark",
sizes: "96x96",
},
];

View File

@@ -0,0 +1,67 @@
import { LinkPreset, type NavbarLink } from "@/types/config";
import { i18n } from "@i18n/translation";
import I18nKey from "@i18n/i18nKey";
export const LinkPresets: { [key in LinkPreset]: NavbarLink } = {
[LinkPreset.Home]: {
name: i18n(I18nKey.home),
url: "/",
icon: "material-symbols:home",
description: "Twilight - A simple, clean, and beautiful blog theme.",
},
[LinkPreset.Archive]: {
name: i18n(I18nKey.archive),
url: "/archive/",
icon: "material-symbols:archive",
description: "A chronological list of all published posts.",
},
[LinkPreset.Projects]: {
name: i18n(I18nKey.projects),
url: "/projects/",
icon: "material-symbols:work",
description: i18n(I18nKey.projectsSubtitle),
},
[LinkPreset.Skills]: {
name: i18n(I18nKey.skills),
url: "/skills/",
icon: "material-symbols:psychology",
description: i18n(I18nKey.skillsSubtitle),
},
[LinkPreset.Timeline]: {
name: i18n(I18nKey.timeline),
url: "/timeline/",
icon: "material-symbols:timeline",
description: i18n(I18nKey.timelineSubtitle),
},
[LinkPreset.Diary]: {
name: i18n(I18nKey.diary),
url: "/diary/",
icon: "material-symbols:book",
description: i18n(I18nKey.diarySubtitle),
},
[LinkPreset.Albums]: {
name: i18n(I18nKey.albums),
url: "/albums/",
icon: "material-symbols:photo-library",
description: i18n(I18nKey.albumsSubtitle),
},
[LinkPreset.Anime]: {
name: i18n(I18nKey.anime),
url: "/anime/",
icon: "material-symbols:movie",
description: "A list of anime I have watched.",
},
[LinkPreset.Friends]: {
name: i18n(I18nKey.friends),
url: "/friends/",
icon: "material-symbols:group",
description: "A curated list of friend sites.",
},
[LinkPreset.About]: {
name: i18n(I18nKey.about),
url: "/about/",
icon: "material-symbols:info",
description: i18n(I18nKey.about),
},
};