From 9efd446d4eb127ba54f9fd6039004268d4721a95 Mon Sep 17 00:00:00 2001 From: Dmitriy Petrov Date: Sat, 11 Jul 2026 16:02:49 +0300 Subject: [PATCH] Refine Harbor brand mode hover animation --- src/web/components/ClientOverviewPage.jsx | 27 ++++++++++++++++++++++- src/web/styles.css | 18 +++++---------- 2 files changed, 32 insertions(+), 13 deletions(-) diff --git a/src/web/components/ClientOverviewPage.jsx b/src/web/components/ClientOverviewPage.jsx index e79bae0..d59ca1c 100644 --- a/src/web/components/ClientOverviewPage.jsx +++ b/src/web/components/ClientOverviewPage.jsx @@ -74,12 +74,27 @@ function DurationPart({ name, children }) { } function HarborBrand({ isGateway, gatewayAvailable, gatewayDirect, busy, onSetGatewayAuto }) { + const [modeAnimating, setModeAnimating] = useState(false); + const stopModeAnimationRef = useRef(false); const product = isGateway ? 'Gateway' : 'Connect'; const switchable = !isGateway && gatewayAvailable; const label = gatewayDirect ? 'Игнорировать Harbor Gateway и использовать локальный VPN' : 'Использовать обнаруженный Harbor Gateway'; + function startModeAnimation() { + stopModeAnimationRef.current = false; + setModeAnimating(true); + } + + function finishModeAnimation() { + if (matchMedia('(prefers-reduced-motion: reduce)').matches) { + setModeAnimating(false); + return; + } + stopModeAnimationRef.current = true; + } + const content =
{switchable ?