mirror of
https://github.com/LukeHagar/website.git
synced 2025-12-06 04:22:07 +00:00
update formatting
This commit is contained in:
@@ -42,7 +42,7 @@
|
||||
<div class="group light flex w-fit gap-4">
|
||||
{#each Array.from({ length: 4 }) as _, i}
|
||||
<div
|
||||
class="animate-scroll flex items-center gap-8 group-hover:[animation-play-state:paused;]"
|
||||
class="animate-scroll group-hover:[animation-play-state:paused;] flex items-center gap-8"
|
||||
aria-hidden={i !== 0}
|
||||
>
|
||||
{#each testimonials as testimonial}
|
||||
|
||||
@@ -1,2 +1,2 @@
|
||||
export { default as GithubStats} from './github-stats.svelte';
|
||||
export { default as GithubStats } from './github-stats.svelte';
|
||||
export { default as DiscordLink } from './discord-link.svelte';
|
||||
|
||||
@@ -1,42 +1,42 @@
|
||||
import { MEDIA } from './constants';
|
||||
|
||||
export const getTheme = (key: string, fallback?: string): string | undefined => {
|
||||
if (typeof window === 'undefined') return undefined;
|
||||
let theme: string | undefined = undefined;
|
||||
try {
|
||||
theme = localStorage.getItem(key) as string || undefined;
|
||||
} catch (e) {
|
||||
// Unsupported
|
||||
}
|
||||
return theme || fallback as string;
|
||||
if (typeof window === 'undefined') return undefined;
|
||||
let theme: string | undefined = undefined;
|
||||
try {
|
||||
theme = (localStorage.getItem(key) as string) || undefined;
|
||||
} catch (e) {
|
||||
// Unsupported
|
||||
}
|
||||
return theme || (fallback as string);
|
||||
};
|
||||
|
||||
export const disableAnimation = () => {
|
||||
const css = document.createElement('style');
|
||||
css.appendChild(
|
||||
document.createTextNode(
|
||||
`*{-webkit-transition:none!important;-moz-transition:none!important;-o-transition:none!important;-ms-transition:none!important;transition:none!important}`
|
||||
)
|
||||
);
|
||||
document.head.appendChild(css);
|
||||
const css = document.createElement('style');
|
||||
css.appendChild(
|
||||
document.createTextNode(
|
||||
`*{-webkit-transition:none!important;-moz-transition:none!important;-o-transition:none!important;-ms-transition:none!important;transition:none!important}`
|
||||
)
|
||||
);
|
||||
document.head.appendChild(css);
|
||||
|
||||
return () => {
|
||||
// Force restyle
|
||||
(() => window.getComputedStyle(document.body))();
|
||||
return () => {
|
||||
// Force restyle
|
||||
(() => window.getComputedStyle(document.body))();
|
||||
|
||||
// Wait for next tick before removing
|
||||
setTimeout(() => {
|
||||
document.head.removeChild(css);
|
||||
}, 1);
|
||||
};
|
||||
// Wait for next tick before removing
|
||||
setTimeout(() => {
|
||||
document.head.removeChild(css);
|
||||
}, 1);
|
||||
};
|
||||
};
|
||||
|
||||
export const getSystemTheme = (e?: MediaQueryList): string => {
|
||||
if (!e && typeof window !== 'undefined') {
|
||||
e = window.matchMedia(MEDIA);
|
||||
}
|
||||
if (!e && typeof window !== 'undefined') {
|
||||
e = window.matchMedia(MEDIA);
|
||||
}
|
||||
|
||||
const isDark = e?.matches;
|
||||
const systemTheme = isDark ? 'dark' : 'light';
|
||||
return systemTheme;
|
||||
const isDark = e?.matches;
|
||||
const systemTheme = isDark ? 'dark' : 'light';
|
||||
return systemTheme;
|
||||
};
|
||||
|
||||
@@ -1,34 +1,30 @@
|
||||
import { writable } from 'svelte/store';
|
||||
|
||||
import { writable } from 'svelte/store';
|
||||
|
||||
export interface ThemeStore {
|
||||
export interface ThemeStore {
|
||||
themes: string[];
|
||||
forcedTheme?: string;
|
||||
theme?: string;
|
||||
resolvedTheme?: string;
|
||||
systemTheme?: string;
|
||||
}
|
||||
}
|
||||
|
||||
// Create the theme store
|
||||
export const themeStore = writable<ThemeStore>({
|
||||
// Create the theme store
|
||||
export const themeStore = writable<ThemeStore>({
|
||||
themes: ['light', 'dark'],
|
||||
forcedTheme: undefined,
|
||||
theme: undefined,
|
||||
resolvedTheme: undefined,
|
||||
systemTheme: undefined
|
||||
});
|
||||
});
|
||||
|
||||
export const setTheme = (theme?: string) => themeStore.update((store) => ({ ...store, theme }));
|
||||
|
||||
export const setTheme = (theme?: string) =>
|
||||
themeStore.update((store) => ({ ...store, theme }));
|
||||
|
||||
export const setResolvedTheme = (resolvedTheme?: string) =>
|
||||
export const setResolvedTheme = (resolvedTheme?: string) =>
|
||||
themeStore.update((store) => ({ ...store, resolvedTheme }));
|
||||
|
||||
export const setSystemTheme = (systemTheme?: string) =>
|
||||
export const setSystemTheme = (systemTheme?: string) =>
|
||||
themeStore.update((store) => ({ ...store, systemTheme }));
|
||||
|
||||
export const setThemes = (themes: string[]) =>
|
||||
themeStore.update((store) => ({ ...store, themes }));
|
||||
export const setThemes = (themes: string[]) => themeStore.update((store) => ({ ...store, themes }));
|
||||
|
||||
export { default as ThemeProvider } from './theme.svelte';
|
||||
export { default as ThemeProvider } from './theme.svelte';
|
||||
|
||||
@@ -200,7 +200,7 @@
|
||||
</svelte:head>
|
||||
|
||||
<a
|
||||
class="bg-mint-500 focus:pointer-events-all z-9999 focus:opacity-1 pointer-events-none absolute inset-y-0 block px-5 py-3 text-black underline opacity-0 focus:relative"
|
||||
class="bg-mint-500 focus:pointer-events-all pointer-events-none absolute inset-y-0 z-9999 block px-5 py-3 text-black underline opacity-0 focus:relative focus:opacity-1"
|
||||
href="#main">Skip to content</a
|
||||
>
|
||||
|
||||
|
||||
@@ -32,7 +32,7 @@
|
||||
<div
|
||||
class={classNames(
|
||||
'container mb-10 overflow-clip',
|
||||
'[filter:brightness(1.5)] [mask-image:linear-gradient(to_right,rgba(0,0,0,0)_0%,_rgba(255,255,255,1)_50%,_rgba(0,0,0,0)_100%)] [mask-mode:alpha]'
|
||||
'[mask-image:linear-gradient(to_right,rgba(0,0,0,0)_0%,_rgba(255,255,255,1)_50%,_rgba(0,0,0,0)_100%)] [mask-mode:alpha] [filter:brightness(1.5)]'
|
||||
)}
|
||||
>
|
||||
<div class="animate-marquee flex w-max gap-4 pl-4 md:[animation-play-state:paused]">
|
||||
|
||||
Reference in New Issue
Block a user