diff --git a/.forgejo/workflows/deploy.yml b/.forgejo/workflows/deploy.yml index b403634..ec2bdd3 100644 --- a/.forgejo/workflows/deploy.yml +++ b/.forgejo/workflows/deploy.yml @@ -1,8 +1,8 @@ name: Deploy on: - push: - branches: [main] + schedule: + - cron: '0 6 * * *' workflow_dispatch: jobs: diff --git a/src/components/Header.astro b/src/components/Header.astro index 8e28250..bfba4f7 100644 --- a/src/components/Header.astro +++ b/src/components/Header.astro @@ -60,20 +60,6 @@ const switchHref = await resolveSwitchHref(); {t(locale, 'nav.tags')}
- navigate(href), 280); }); } - function wireThemeToggle() { - const btn = document.querySelector('.theme-toggle'); - if (!btn || btn.dataset.wired) return; - btn.dataset.wired = '1'; - btn.addEventListener('click', () => { - const next = document.documentElement.dataset.theme === 'dark' ? 'light' : 'dark'; - document.documentElement.dataset.theme = next; - localStorage.setItem('theme', next); - }); - } function wireMenuToggle() { const btn = document.querySelector('.menu-toggle'); const menu = document.getElementById('mobile-menu'); @@ -162,11 +138,9 @@ const switchHref = await resolveSwitchHref(); document.addEventListener('astro:after-swap', close); } wireLangToggle(); - wireThemeToggle(); wireMenuToggle(); document.addEventListener('astro:page-load', () => { wireLangToggle(); - wireThemeToggle(); wireMenuToggle(); }); @@ -293,63 +267,6 @@ const switchHref = await resolveSwitchHref(); align-items: center; gap: 0.6em; } - .theme-toggle { - position: relative; - display: inline-flex; - align-items: stretch; - padding: 3px; - margin: 0; - border: 0; - background: rgba(var(--gray-light), 0.7); - border-radius: 999px; - cursor: pointer; - line-height: 1; - user-select: none; - font: inherit; - } - .theme-toggle:hover { - background: rgba(var(--gray-light), 1); - } - .theme-toggle__thumb { - position: absolute; - top: 3px; - bottom: 3px; - left: 3px; - width: calc(50% - 3px); - border-radius: 999px; - background: var(--accent); - box-shadow: 0 1px 3px rgba(var(--black), 0.18); - } - :global(:root[data-theme-ready]) .theme-toggle__thumb { - transition: transform 280ms cubic-bezier(0.4, 0, 0.2, 1); - } - :global(:root[data-theme='dark']) .theme-toggle__thumb { - transform: translateX(100%); - } - .theme-toggle__icon { - position: relative; - z-index: 1; - display: flex; - align-items: center; - justify-content: center; - width: 1.8em; - height: 1.8em; - font-size: 0.9em; - color: rgb(var(--gray)); - } - :global(:root[data-theme-ready]) .theme-toggle__icon { - transition: color 280ms ease; - } - :global(:root:not([data-theme='dark'])) .theme-toggle__icon--sun, - :global(:root[data-theme='dark']) .theme-toggle__icon--moon { - color: white; - } - @media (prefers-reduced-motion: reduce) { - .theme-toggle__thumb, - .theme-toggle__icon { - transition: none; - } - } .menu-toggle { display: none; margin-left: 0.8em; diff --git a/src/layouts/BaseLayout.astro b/src/layouts/BaseLayout.astro index ce7227c..10d2fca 100644 --- a/src/layouts/BaseLayout.astro +++ b/src/layouts/BaseLayout.astro @@ -32,19 +32,6 @@ const { - diff --git a/src/styles/global.css b/src/styles/global.css index 2343ff8..098a690 100644 --- a/src/styles/global.css +++ b/src/styles/global.css @@ -18,22 +18,8 @@ 0 16px 32px rgba(var(--gray), 33%); color-scheme: light; } -:root[data-theme='dark'] { - --accent: #8c96ff; - --accent-dark: #c2c8ff; - --black: 230, 233, 240; - --gray: 150, 160, 190; - --gray-light: 38, 42, 56; - --gray-dark: 220, 225, 235; - --surface: 17, 20, 28; - --gray-gradient: rgba(var(--gray-light), 50%), rgb(var(--surface)); - color-scheme: dark; -} html { background: rgb(var(--surface)); - transition: - background-color 300ms ease, - color 300ms ease; } body { font-family: var(--font-atkinson);