diff --git a/src/renderer/src/modules/feed-column/auto-updater.tsx b/src/renderer/src/modules/feed-column/auto-updater.tsx index c6bc6dcee..807ff844e 100644 --- a/src/renderer/src/modules/feed-column/auto-updater.tsx +++ b/src/renderer/src/modules/feed-column/auto-updater.tsx @@ -1,8 +1,10 @@ +import { usePlayerAtomSelector } from "@renderer/atoms/player" import { setUpdaterStatus, useUpdaterStatus } from "@renderer/atoms/updater" import { softBouncePreset } from "@renderer/components/ui/constants/spring" import { tipcClient } from "@renderer/lib/client" +import { cn } from "@renderer/lib/utils" import { handlers } from "@renderer/tipc" -import { m } from "framer-motion" +import { m, useMotionTemplate, useMotionValue } from "framer-motion" import { useCallback, useEffect } from "react" export const AutoUpdater = () => { @@ -22,16 +24,47 @@ export const AutoUpdater = () => { tipcClient?.quitAndInstall() }, []) + const playerIsShow = usePlayerAtomSelector((s) => s.show) + + const mouseX = useMotionValue(0) + const mouseY = useMotionValue(0) + const radius = useMotionValue(0) + const handleMouseMove = useCallback( + ({ clientX, clientY, currentTarget }: React.MouseEvent) => { + const bounds = currentTarget.getBoundingClientRect() + mouseX.set(clientX - bounds.left) + mouseY.set(clientY - bounds.top) + radius.set(Math.hypot(bounds.width, bounds.height) * 1.3) + }, + [mouseX, mouseY, radius], + ) + + const background = useMotionTemplate`radial-gradient(${radius}px circle at ${mouseX}px ${mouseY}px, var(--a) 0%, transparent 65%)` + if (!updaterStatus) return null return ( +
{APP_NAME} {" "} diff --git a/src/renderer/src/styles/tailwind.css b/src/renderer/src/styles/tailwind.css index fe2c7a1d2..7167bd61f 100644 --- a/src/renderer/src/styles/tailwind.css +++ b/src/renderer/src/styles/tailwind.css @@ -50,6 +50,10 @@ } } +:root { + --a: theme("colors.theme.accent.DEFAULT"); +} + @layer base { * { @apply border-border;