fix(header): 深浅色切换扩散动画改为从屏幕中心扩散
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
@@ -22,12 +22,10 @@ const { learnStep } = useLearnProgress()
|
|||||||
|
|
||||||
const isDark = useDark()
|
const isDark = useDark()
|
||||||
|
|
||||||
function toggleDark(event: MouseEvent) {
|
function toggleDark() {
|
||||||
const { clientX: x, clientY: y } = event
|
const x = window.innerWidth / 2
|
||||||
const radius = Math.hypot(
|
const y = window.innerHeight / 2
|
||||||
Math.max(x, window.innerWidth - x),
|
const radius = Math.hypot(x, y)
|
||||||
Math.max(y, window.innerHeight - y),
|
|
||||||
)
|
|
||||||
if (!document.startViewTransition) {
|
if (!document.startViewTransition) {
|
||||||
isDark.value = !isDark.value
|
isDark.value = !isDark.value
|
||||||
return
|
return
|
||||||
|
|||||||
Reference in New Issue
Block a user