feat: circular reveal animation for theme switching (#905)

This commit is contained in:
funnytime
2026-02-06 22:14:29 +08:00
committed by GitHub
parent 87b80c66b2
commit b8538a6996
4 changed files with 71 additions and 10 deletions
+3 -3
View File
@@ -7,13 +7,13 @@ export function ModeToggle() {
const { theme, setTheme } = useTheme();
const { t } = useTranslation();
const toggleTheme = () => {
const toggleTheme = (event: React.MouseEvent) => {
// 如果当前是 dark 或 system(且系统是暗色),切换到 light
// 否则切换到 dark
if (theme === "dark") {
setTheme("light");
setTheme("light", event);
} else {
setTheme("dark");
setTheme("dark", event);
}
};