diff --git a/2048.css b/2048.css index c3d840c..16949c8 100644 --- a/2048.css +++ b/2048.css @@ -1,4 +1,3 @@ - * { margin: 0; padding: 0; @@ -6,9 +5,10 @@ } body { - background: radial-gradient(circle at center, #0a0a0a, #000); - background-size: 300% 300%; - animation: bgMove 15s infinite alternate; + background: radial-gradient(circle at 20% 20%, #3b0066, #0c001a 70%); + background-size: 100% 100%; + background-attachment: fixed; + font-family: 'Poppins', sans-serif; color: white; text-align: center; @@ -20,14 +20,63 @@ body { justify-content: center; padding: 10px; overflow: hidden; + position: relative; } -@keyframes bgMove { - 0% { background-position: 0% 30%; } - 50% { background-position: 50% 70%; } - 100% { background-position: 100% 30%; } +/* ADDED: Animated Grid Pattern (optional, bisa dihapus kalau ga suka) */ +body::before { + content: ''; + position: fixed; + top: 0; + left: 0; + width: 100%; + height: 100%; + background-image: + linear-gradient(rgba(0, 234, 255, 0.02) 1px, transparent 1px), + linear-gradient(90deg, rgba(255, 0, 255, 0.02) 1px, transparent 1px); + background-size: 40px 40px; + animation: gridMove 25s linear infinite; + z-index: 0; + pointer-events: none; } +@keyframes gridMove { + 0% { + transform: translate(0, 0); + } + 100% { + transform: translate(40px, 40px); + } +} + +/* ADDED: Floating gradient blobs for depth */ +body::after { + content: ''; + position: fixed; + top: 0; + left: 0; + width: 100%; + height: 100%; + background: + radial-gradient(ellipse at 10% 20%, rgba(0, 234, 255, 0.08), transparent 50%), + radial-gradient(ellipse at 90% 80%, rgba(255, 0, 255, 0.08), transparent 50%), + radial-gradient(ellipse at 50% 50%, rgba(138, 43, 226, 0.05), transparent 60%); + filter: blur(60px); + animation: blobFloat 20s ease-in-out infinite; + z-index: 0; + pointer-events: none; +} + +@keyframes blobFloat { + 0%, 100% { + transform: translate(0, 0) scale(1); + opacity: 0.6; + } + 50% { + transform: translate(30px, -30px) scale(1.1); + opacity: 0.8; + } +} /* ====================== GAME CONTAINER ====================== */ @@ -282,6 +331,18 @@ h1 { transform: scale(1.1); } +/* FORCE tombol sound untuk selalu visible */ +.btn-sound-main { + display: flex !important; + position: relative !important; + z-index: 103 !important; +} + +.volume-panel { + position: relative !important; + z-index: 102 !important; +} + /* Mobile Responsive */ @media (max-width: 768px) { .sound-controls { @@ -1310,6 +1371,85 @@ h1 { will-change: transform, opacity; filter: blur(1px) drop-shadow(0 0 8px rgba(255,255,255,0.1)); } +/* ========================== + ENHANCED BACKGROUND EFFECTS + +/* Update .particles styling */ +.particles { + position: fixed; + inset: 0; + pointer-events: none; + z-index: 0; + background: + radial-gradient(circle at 20% 30%, rgba(0,234,255,0.15), transparent 40%), + radial-gradient(circle at 80% 70%, rgba(255,0,90,0.15), transparent 40%), + radial-gradient(circle at 50% 50%, rgba(140,0,255,0.12), transparent 50%), + radial-gradient(circle at 10% 85%, rgba(0,255,200,0.1), transparent 50%), + radial-gradient(circle at 90% 15%, rgba(255,0,255,0.13), transparent 40%); + filter: blur(50px) brightness(110%); + animation: particlesFloat 18s ease-in-out infinite alternate; +} + +@keyframes particlesFloat { + 0% { + transform: translateY(0px) translateX(0px); + opacity: 0.8; + } + 50% { + transform: translateY(-25px) translateX(15px); + opacity: 1; + } + 100% { + transform: translateY(-40px) translateX(-20px); + opacity: 0.8; + } +} + +/* Enhanced Starfield */ +.starfield { + position: fixed; + inset: 0; + overflow: hidden; + pointer-events: none; + z-index: 1; +} + +.starfield span { + position: absolute; + width: 3px; + height: 3px; + background: rgba(0,255,255,0.7); + border-radius: 50%; + filter: blur(1.5px); + box-shadow: 0 0 8px rgba(0, 234, 255, 0.6); + animation: starMove linear infinite; +} + +@keyframes starMove { + 0% { + transform: translateY(0); + opacity: 0.7; + } + 100% { + transform: translateY(-750px); + opacity: 0; + } +} + +/* Enhanced Cursor Light */ +.cursor-light { + position: absolute; + width: 280px; + height: 280px; + background: radial-gradient(circle, rgba(0,255,255,0.2), rgba(255,0,255,0.15) 50%, transparent 70%); + border-radius: 50%; + pointer-events: none; + transform: translate(-50%, -50%); + filter: blur(50px); + mix-blend-mode: screen; + opacity: 0.5; + transition: opacity 0.3s ease; +} /* ========================== RESPONSIVE DESIGN @@ -1346,7 +1486,26 @@ h1 { position: fixed; top: clamp(10px, 2vh, 20px); left: clamp(10px, 2vw, 20px); - z-index: 100; + z-index: 101; + display: flex; + flex-direction: column; + gap: 12px; + align-items: flex-start; +} + +/* Backdrop Overlay untuk Mobile */ +.volume-backdrop { + display: none; + position: fixed; + inset: 0; + background: rgba(0, 0, 0, 0.75); + backdrop-filter: blur(8px); + z-index: 99; + animation: fadeIn 0.2s ease-out; +} + +.volume-backdrop.active { + display: block; } /* Main Sound Button */ @@ -1418,9 +1577,7 @@ h1 { /* Volume Panel */ .volume-panel { - position: absolute; - top: clamp(46px, 8vh, 60px); - left: 0; + display: none; background: linear-gradient(145deg, rgba(20, 0, 40, 0.98), rgba(30, 0, 50, 0.98)); backdrop-filter: blur(25px); border: 2px solid rgba(0, 217, 255, 0.4); @@ -1432,6 +1589,11 @@ h1 { 0 0 50px rgba(0, 217, 255, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.1); animation: slideDown 0.3s cubic-bezier(0.2, 0.8, 0.2, 1); + z-index: 102; +} + +.volume-panel.active { + display: block; } @keyframes slideDown { @@ -1574,4 +1736,4 @@ h1 { .volume-value { font-size: 11px; } -} \ No newline at end of file +} diff --git a/2048.html b/2048.html index 127733d..52520b3 100644 --- a/2048.html +++ b/2048.html @@ -21,13 +21,12 @@
- - -
@@ -222,12 +209,7 @@