From 453a596eaf6f8adbdbe8617c50dbcdabb0d77076 Mon Sep 17 00:00:00 2001 From: Usman Baig Date: Fri, 13 Mar 2026 13:05:24 +0100 Subject: [PATCH] style: replace animated grid with subtle horizontal lines in chart Simple repeating horizontal lines at 40px intervals with 50% opacity, faded at top/bottom edges via CSS mask. No extra components needed. --- CHANGELOG.md | 2 +- components/dashboard/Chart.tsx | 20 ++-- components/ui/animated-grid-pattern.tsx | 148 ------------------------ 3 files changed, 10 insertions(+), 160 deletions(-) delete mode 100644 components/ui/animated-grid-pattern.tsx diff --git a/CHANGELOG.md b/CHANGELOG.md index 8d3a0d6..d1060f7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,7 +8,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), ### Improved -- **Refreshed chart background.** The dashboard chart now has an animated grid pattern instead of the old dotted background. Subtle squares gently fade in and out across the chart area, with soft edges at the top and bottom for a polished look. +- **Refreshed chart background.** The dashboard chart now has subtle horizontal lines instead of the old dotted background, giving the chart area a cleaner look with soft faded edges. - **Smoother loading transitions.** When your data finishes loading, the page now fades in smoothly instead of appearing all at once. This applies across Dashboard, Journeys, Funnels, Uptime, Settings, Notifications, and shared dashboards. If your data was already cached from a previous visit, it still loads instantly with no animation — the fade only kicks in when you're actually waiting for fresh data. - **Faster tab switching across the board.** Switching between Settings, Funnels, Uptime, and other tabs now shows your data instantly instead of flashing a loading skeleton every time. Previously visited tabs remember their data and show it right away, while quietly refreshing in the background so you always see the latest numbers without the wait. - **Smoother loading on the Journeys page.** The Journeys tab now shows a polished skeleton placeholder while data loads, matching the loading experience on other tabs. diff --git a/components/dashboard/Chart.tsx b/components/dashboard/Chart.tsx index bfbb889..5305cc0 100644 --- a/components/dashboard/Chart.tsx +++ b/components/dashboard/Chart.tsx @@ -11,7 +11,6 @@ import { Checkbox } from '@ciphera-net/ui' import { ArrowUpRight, ArrowDownRight } from '@phosphor-icons/react' import { motion } from 'framer-motion' import { cn } from '@/lib/utils' -import { AnimatedGridPattern } from '@/components/ui/animated-grid-pattern' const ANNOTATION_COLORS: Record = { deploy: '#3b82f6', @@ -386,16 +385,15 @@ export default function Chart({ - {/* Toolbar */}
diff --git a/components/ui/animated-grid-pattern.tsx b/components/ui/animated-grid-pattern.tsx deleted file mode 100644 index f10fdfa..0000000 --- a/components/ui/animated-grid-pattern.tsx +++ /dev/null @@ -1,148 +0,0 @@ -"use client"; - -import { useEffect, useId, useRef, useState } from "react"; -import { motion } from "framer-motion"; - -import { cn } from "@/lib/utils"; - -interface AnimatedGridPatternProps { - width?: number; - height?: number; - x?: number; - y?: number; - strokeDasharray?: any; - numSquares?: number; - className?: string; - maxOpacity?: number; - duration?: number; - repeatDelay?: number; -} - -export function AnimatedGridPattern({ - width = 40, - height = 40, - x = -1, - y = -1, - strokeDasharray = 0, - numSquares = 50, - className, - maxOpacity = 0.5, - duration = 4, - repeatDelay = 0.5, - ...props -}: AnimatedGridPatternProps) { - const id = useId(); - const containerRef = useRef(null); - const [dimensions, setDimensions] = useState({ width: 0, height: 0 }); - const [squares, setSquares] = useState(() => generateSquares(numSquares)); - - function getPos() { - return [ - Math.floor((Math.random() * dimensions.width) / width), - Math.floor((Math.random() * dimensions.height) / height), - ]; - } - - // Adjust the generateSquares function to return objects with an id, x, and y - function generateSquares(count: number) { - return Array.from({ length: count }, (_, i) => ({ - id: i, - pos: getPos(), - })); - } - - // Function to update a single square's position - const updateSquarePosition = (id: number) => { - setSquares((currentSquares) => - currentSquares.map((sq) => - sq.id === id - ? { - ...sq, - pos: getPos(), - } - : sq, - ), - ); - }; - - // Update squares to animate in - useEffect(() => { - if (dimensions.width && dimensions.height) { - setSquares(generateSquares(numSquares)); - } - }, [dimensions, numSquares]); - - // Resize observer to update container dimensions - useEffect(() => { - const resizeObserver = new ResizeObserver((entries) => { - for (let entry of entries) { - setDimensions({ - width: entry.contentRect.width, - height: entry.contentRect.height, - }); - } - }); - - if (containerRef.current) { - resizeObserver.observe(containerRef.current); - } - - return () => { - if (containerRef.current) { - resizeObserver.unobserve(containerRef.current); - } - }; - }, [containerRef]); - - return ( - - ); -}