From ae453d9c9407ab939bf041c56aaacda71c9c65f2 Mon Sep 17 00:00:00 2001 From: arthur Date: Fri, 12 Dec 2025 20:00:46 +0700 Subject: [PATCH] fix size and add sparkle effect --- src/App.jsx | 14 +++++++------- src/components/HistoryPanel.jsx | 18 +++++++++--------- src/components/SlotMachine.jsx | 16 ++++++++-------- src/components/SparkleEffect.jsx | 12 ++++++------ 4 files changed, 30 insertions(+), 30 deletions(-) diff --git a/src/App.jsx b/src/App.jsx index 6d97cc2..7ae727e 100644 --- a/src/App.jsx +++ b/src/App.jsx @@ -76,11 +76,11 @@ function App() {
{/* Company Logo */} -
+
Company Logo {/* Golden Ticket Title - Background Layer */} -
+
Golden Ticket {/* Slot Machine - Foreground Layer */} -
+
{/* Left Sparkles - Absolute positioned next to slot machine */} -
+
{/* Right Sparkles - Absolute positioned next to slot machine */} -
+
@@ -133,7 +133,7 @@ function App() { )} {/* Winners Panel - Below Draw Button */} -
+
{/* Header with Title and Controls */} -
+

+
No winners yet - click the lottery machine to start!
) : ( -
+
{reversedHistory.map((num, idx) => { const rank = idx + 1; const isTop3 = rank <= 3; return (
{/* Decorative separator */} -
+
{/* Number - center, LARGE with metallic effect */}
{ // Responsive slot heights based on screen size const getSlotHeight = () => { - if (typeof window === 'undefined') return 320; + if (typeof window === 'undefined') return 240; const width = window.innerWidth; - if (width < 640) return 96; // mobile (h-24) - if (width < 768) return 128; // sm (h-32) - if (width < 1024) return 176; // md (h-44) - if (width < 1280) return 224; // lg (h-56) - if (width < 1536) return 288; // xl (h-72) - return 320; // 2xl (h-80) + if (width < 640) return 80; // mobile (h-20) + if (width < 768) return 112; // sm (h-28) + if (width < 1024) return 144; // md (h-36) + if (width < 1280) return 176; // lg (h-44) + if (width < 1536) return 208; // xl (h-52) + return 240; // 2xl (h-60) }; export function SlotMachine({ winner, isSpinning, onAnimationComplete, onDraw, poolLength }) { @@ -178,7 +178,7 @@ export function SlotMachine({ winner, isSpinning, onAnimationComplete, onDraw, p const SlotBox = ({ children }) => (
{ // Generate Stars (The big cross flares) - spread across entire area - const starCount = 40; // Increased from 25 + const starCount = 30; // Reduced for smaller screens const newStars = Array.from({ length: starCount }).map((_, i) => { return { id: i, style: { left: `${random(0, 100)}%`, top: `${random(0, 100)}%`, - width: `${random(50, 150)}px`, - height: `${random(50, 150)}px`, + width: `${random(40, 120)}px`, + height: `${random(40, 120)}px`, animationDuration: `${random(1.5, 4)}s`, animationDelay: `${random(0, 4)}s`, opacity: random(0.6, 1), @@ -78,15 +78,15 @@ export function SparkleEffect() { }); // Generate Particles (The small bokeh dots) - spread across entire area - const particleCount = 100; // Increased from 60 + const particleCount = 70; // Reduced for smaller screens const newParticles = Array.from({ length: particleCount }).map((_, i) => { return { id: i, style: { left: `${random(0, 100)}%`, top: `${random(0, 100)}%`, - width: `${random(2, 5)}px`, - height: `${random(2, 5)}px`, + width: `${random(2, 4)}px`, + height: `${random(2, 4)}px`, opacity: random(0.3, 0.8), boxShadow: `0 0 ${random(3, 6)}px rgba(255, 255, 220, 0.8)`, animationDuration: `${random(1, 3)}s`,