diff --git a/src/components/common/ToggleTheme.vue b/src/components/common/ToggleTheme.vue new file mode 100644 index 0000000..6ed6611 --- /dev/null +++ b/src/components/common/ToggleTheme.vue @@ -0,0 +1,34 @@ + + + diff --git a/src/styles/global.scss b/src/styles/global.scss index 17bc2c3..18b6798 100644 --- a/src/styles/global.scss +++ b/src/styles/global.scss @@ -72,3 +72,23 @@ body { } } } + +/* 切换主题的动画效果 */ +::view-transition-old(root) { + animation: none; + mix-blend-mode: normal; +} + +::view-transition-new(root) { + animation: 0.5s ease-in circle-animation; + mix-blend-mode: normal; +} + +@keyframes circle-animation { + from { + clip-path: circle(0 at var(--circle-x) var(--circle-y)); + } + to { + clip-path: circle(var(--circle-r) at var(--circle-x) var(--circle-y)); + } +}