diff --git a/resources/js/components/Display/LedDisplay.tsx b/resources/js/components/Display/LedDisplay.tsx index 822242f..77d24a8 100644 --- a/resources/js/components/Display/LedDisplay.tsx +++ b/resources/js/components/Display/LedDisplay.tsx @@ -8,97 +8,53 @@ interface LedDisplayProps { onClick?: () => void; } -export default function LedDisplay({ - value, - className, - animate = true, +export default function LedDisplay({ + value, + className, onClick }: LedDisplayProps) { const [displayValue, setDisplayValue] = useState(0); // Animate number changes useEffect(() => { - if (!animate) { - setDisplayValue(value); - return; - } + setDisplayValue(value); + return; + }, [value]); - const duration = 1000; // 1 second animation - const steps = 60; // 60fps - const stepValue = (value - displayValue) / steps; - - if (Math.abs(stepValue) < 0.01) { - setDisplayValue(value); - return; - } - - const timer = setInterval(() => { - setDisplayValue(prev => { - const next = prev + stepValue; - if (Math.abs(next - value) < Math.abs(stepValue)) { - clearInterval(timer); - return value; - } - return next; - }); - }, duration / steps); - - return () => clearInterval(timer); - }, [value, displayValue, animate]); - - // Format number appropriately for shares + // Format number with zero-padding for consistent width const formatValue = (value: number) => { - // If it's a whole number, show it as integer - if (value % 1 === 0) { - return value.toString(); - } - // Otherwise show up to 6 decimal places, removing trailing zeros - return value.toFixed(6).replace(/\.?0+$/, ''); + // Always pad to 5 digits for consistent display width + const integerPart = Math.floor(value); + return integerPart.toString().padStart(5, '0'); }; - + const formattedValue = formatValue(displayValue); return ( -
-
- {/* Background glow effect */} -
- {formattedValue} -
- - {/* Main LED text */} +
+ "filter brightness-110", + "leading-none", + "transition-all duration-300" + )} + style={{ letterSpacing: '0.15em' }}> {formattedValue}
- - {/* Subtle scan line effect */} -
-
-
-
- - {/* Label */} -
- total shares
); -} \ No newline at end of file +} diff --git a/resources/js/pages/dashboard.tsx b/resources/js/pages/dashboard.tsx index c9c3c1d..6a295a2 100644 --- a/resources/js/pages/dashboard.tsx +++ b/resources/js/pages/dashboard.tsx @@ -128,16 +128,18 @@ export default function Dashboard() { {/* Stacked Layout */} -
-
- {/* Box 1: LED Number Display */} - +
+
+ {/* Box 1: LED Number Display - Fixed position from top */} +
+ +
{/* Box 2: Progress Bar (toggleable) */} -
+
{/* Box 3: Stats Box (toggleable) */} -
+
setActiveForm('purchase')} @@ -154,7 +156,7 @@ export default function Dashboard() {
{/* Box 4: Forms (only when active form is set) */} -
+
setActiveForm(null)}