Skip to content

Instantly share code, notes, and snippets.

View ninjakuro's full-sized avatar
🏠
Working from home

Viktor ninjakuro

🏠
Working from home
View GitHub Profile
@ninjakuro
ninjakuro / theme.ts
Created February 4, 2024 23:39
ts theme
export enum Theme {
LIGHT = 'light',
DARK = 'dark',
}
const colorScheme = window.matchMedia(`(prefers-color-scheme: ${Theme.DARK})`);
export const setTheme = (theme: Theme) => {
document.documentElement.setAttribute('data-theme', theme);
localStorage.setItem('theme', theme);
@ninjakuro
ninjakuro / loader.css
Last active February 4, 2024 13:12
css loader
.loader {
--loader-color: #197AFF;
--loader-size: 160px;
width: var(--loader-size);
height: var(--loader-size);
position: relative;
clip-path: circle(50%);
}