点击主题按钮时,新主题从按钮位置以圆形向外展开覆盖全屏。 JS 同步 toggle dark class 拍快照 + CSS clip-path circle keyframes; Rust theme.set 事后对齐状态(use_effect 幂等)。 reduced-motion 与不支持 VT 的浏览器自动降级为瞬切。
16 lines
415 B
TypeScript
16 lines
415 B
TypeScript
import { initPostContent } from './post-content';
|
|
import { startThemeTransition } from './theme-transition';
|
|
import './style.css';
|
|
|
|
declare global {
|
|
interface Window {
|
|
__initPostContent: (selector: string) => void;
|
|
__startThemeTransition: (x: number, y: number, isDark: boolean) => void;
|
|
}
|
|
}
|
|
|
|
window.__initPostContent = initPostContent;
|
|
window.__startThemeTransition = startThemeTransition;
|
|
|
|
export {};
|