ProjectGenesis commited on
Commit
0b2de52
·
verified ·
1 Parent(s): a10d9a2

<!DOCTYPE html>

Browse files

<html lang="en">
<head>
<meta charset="UTF-8" />
<title>Nioplay Loot Box + Multiplier Demo</title>
<style>
:root {
--bg: #050505;
--accent: #ff8c00;
--accent-soft: rgba(255, 140, 0, 0.3);
--gold: #ffcc66;
--text-main: #f7f7f7;
--text-dim: #a7a7a7;
--loot-box-size: 90px;
--pill-width: 90px;
--pill-height: 40px;
--gap: 18px;
--transition-duration: 1100ms;
}

* {
box-sizing: border-box;
margin: 0;
padding: 0;
}

body {
min-height: 100vh;
display: flex;
align-items: center;
justify-content: center;
padding: 24px;
background: radial-gradient(circle at top, #1a0d00 0%, #000 55%);
font-family: system-ui, -apple-system, BlinkMacSystemFont, "SF Pro Text",
"Segoe UI", sans-serif;
color: var(--text-main);
}

.module {
width: 1100px;
max-width: 100%;
border-radius: 24px;
padding: 28px 32px 36px;
background:
radial-gradient(circle at top, rgba(255, 140, 0, 0.16), transparent 65%),
linear-gradient(135deg, rgba(255, 255, 255, 0.06), rgba(10, 10, 10, 0.95));
box-shadow:
0 0 40px rgba(0, 0, 0, 0.9),
0 0 60px rgba(255, 140, 0, 0.35);
border: 1px solid rgba(255, 255, 255, 0.08);
backdrop-filter: blur(18px);
}

.label {
font-size: 12px;
letter-spacing: 0.24em;
text-transform: uppercase;
color: var(--text-dim);
margin-bottom: 6px;
}

.section {
margin-bottom: 24px;
}

.track-shell {
position: relative;
padding: 22px 0;
border-radius: 18px;
background:
radial-gradient(circle at top, rgba(255, 140, 0, 0.18), transparent 60%),
linear-gradient(to bottom, rgba(10, 10, 10, 0.98), rgba(5, 5, 5, 0.98));
box-shadow:
0 12px 30px rgba(0, 0, 0, 0.85),
inset 0 0 0 1px rgba(255, 255, 255, 0.04);
overflow: hidden;
}

.track-wrapper {
overflow: hidden;
padding: 0 70px;
}

.track {
display: flex;
align-items: center;
gap: var(--gap);
transform: translateX(0px);
will-change: transform;
}

.selection-window {
position: absolute;
top: 16px;
left: 50%;
transform: translateX(-50%);
border-radius: 16px;
border: 2px solid var(--accent);
box-shadow:
0 0 18px rgba(255, 140, 0, 0.9),
0 0 40px rgba(255, 140, 0, 0.4);
pointer-events: none;
z-index: 4;
}

.selection-window--loot {
width: var(--loot-box-size);
height: var(--loot-box-size) + 20px;
}

.selection-window--multi {
width: var(--pill-width);
height: var(--pill-height) + 12px;
}

.selection-window::before {
content: "";
position: absolute;
inset: -16px;
border-radius: inherit;
background: radial-gradient(
circle at center,
rgba(255, 140, 0, 0.14),
transparent 60%
);
opacity: 0.8;
}

/* Loot boxes */

.loot-box {
width: var(--loot-box-size);
height: var(--loot-box-size);
border-radius: 18px;
position: relative;
display: flex;
align-items: center;
justify-content: center;
border: 1px solid rgba(255, 255, 255, 0.08);
background: radial-gradient(circle at top, #171717, #050505);
box-shadow:
0 8px 18px rgba(0, 0, 0, 0.85),
0 0 18px rgba(0, 0, 0, 0.7);
overflow: hidden;
transition:
transform 160ms ease-out,
box-shadow 160ms ease-out,
border-color 160ms ease-out,
filter 160ms ease-out;
}

.loot-box::before {
content: "";
position: absolute;
inset: 8px;
border-radius: 14px;
border: 2px solid rgba(255, 255, 255, 0.16);
box-shadow: inset 0 0 14px rgba(0, 0, 0, 0.9);
z-index: 1;
}

.loot-box-inner {
position: relative;
z-index: 2;
width: 48px;
height: 48px;
border-radius: 14px;
background: radial-gradient(circle at top, #222, #000);
display: flex;
align-items: center;
justify-content: center;
box-shadow: 0 0 14px rgba(0, 0, 0, 0.8);
}

.loot-box-inner::before {
content: "";
width: 22px;
height: 22px;
border-radius: 6px;
border: 2px solid rgba(255, 255, 255, 0.6);
box-shadow: 0 0 10px rgba(255, 255, 255, 0.3);
}

.loot-box[data-rarity="green"] {
box-shadow: 0 0 18px rgba(0, 200, 120, 0.7);
}

.loot-box[data-rarity="blue"] {
box-shadow: 0 0 18px rgba(80, 160, 255, 0.8);
}

.loot-box[data-rarity="purple"] {
box-shadow: 0 0 20px rgba(160, 80, 255, 0.85);
}

.loot-box[data-rarity="gold"] {
box-shadow: 0 0 22px rgba(255, 190, 70, 0.95);
}

.loot-box.selected {
transform: scale(1.12);
border-color: rgba(255, 140, 0, 0.95);
filter: brightness(1.1);
box-shadow:
0 0 26px rgba(255, 140, 0, 0.95),
0 0 60px rgba(255, 140, 0, 0.75);
}

.loot-box.motion-blur {
filter: blur(1px) brightness(0.9);
opacity: 0.9;
}

/* Multiplier pills */

.multi-pill {
min-width: var(--pill-width);
height: var(--pill-height);
border-radius: 999px;
display: flex;
align-items: center;
justify-content: center;
font-size: 17px;
font-weight: 700;
color: #ffd8a0;
background: rgba(255, 255, 255, 0.08);
backdrop-filter: blur(6px);
box-shadow:
0 0 8px rgba(0, 0, 0, 0.6),
inset 0 0 6px rgba(255, 255, 255, 0.1);
transition:
transform 140ms ease-out,
color 140ms ease-out,
box-shadow 140ms ease-out,
filter 140ms ease-out;
}

.multi-pill.selected {
transform: scale(1.18);
color: #fff2cc;
box-shadow:
0 0 20px rgba(255, 140, 0, 0.95),
0 0 50px rgba(255, 140, 0, 0.6);
}

.multi-pill.motion-blur {
filter: blur(1px) brightness(0.95);
opacity: 0.9;
}

/* Spin button */

.actions {
display: flex;
justify-content: center;
margin-top: 10px;
}

.spin-btn {
min-width: 220px;
border: none;
border-radius: 999px;
padding: 12px 32px;
font-size: 14px;
font-weight: 700;
letter-spacing: 0.16em;
text-transform: uppercase;
cursor: pointer;
background: radial-gradient(circle at top, #ffe5a8, #ff8c00);
color: #1a0900;
box-shadow:
0 0 30px rgba(255, 140, 0, 0.95),
0 14px 26px rgba(0, 0, 0, 0.9);
position: relative;
overflow: hidden;
transition:
transform 120ms ease-out,
box-shadow 120ms ease-out,
filter 120ms ease-out;
}

.spin-btn::before {
content: "";
position: absolute;
inset: 0;
background: radial-gradient(circle at 20% 0%, rgba(255, 255, 255, 0.35), transparent 60%);
opacity: 0.8;
pointer-events: none;
mix-blend-mode: screen;
}

.spin-btn:active {
transform: translateY(1px) scale(0.98);
box-shadow:
0 0 18px rgba(255, 140, 0, 0.8),
0 6px 10px rgba(0, 0, 0, 0.9);
filter: brightness(0.96);
}

.spin-btn.disabled {
cursor: wait;
filter: grayscale(0.1) brightness(0.9);
box-shadow:
0 0 14px rgba(255, 140, 0, 0.6),
0 8px 18px rgba(0, 0, 0, 0.9);
}

/* Popup */

.popup-backdrop {
position: fixed;
inset: 0;
display: none;
align-items: center;
justify-content: center;
background: radial-gradient(circle at center, rgba(0, 0, 0, 0.8), rgba(0, 0, 0, 0.95));
z-index: 50;
}

.popup-backdrop.visible {
display: flex;
}

.popup {
width: 360px;
max-width: 90%;
padding: 22px 22px 20px;
border-radius: 20px;
background:
radial-gradient(circle at top, rgba(255, 140, 0, 0.22), transparent 60%),
linear-gradient(135deg, rgba(25, 25, 25, 0.98), rgba(5, 5, 5, 0.98));
border: 1px solid rgba(255, 255, 255, 0.12);
box-shadow:
0 0 40px rgba(0, 0, 0, 1),
0 0 50px rgba(255, 140, 0, 0.85);
text-align: center;
position: relative;
overflow: hidden;
}

.popup::before {
content: "";
position: absolute;
inset: -40%;
background: radial-gradient(circle at center, rgba(255, 140, 0, 0.25), transparent 70%);
opacity: 0.7;
pointer-events: none;
}

.popup-title {
position: relative;
z-index: 1;
font-size: 14px;
letter-spacing: 0.25em;
text-transform: uppercase;
color: var(--text-dim);
margin-bottom: 8px;
}

.popup-total {
position: relative;
z-index: 1;
font-size: 30px;
font-weight: 800;
color: var(--gold);
text-shadow:
0 0 18px rgba(255, 204, 102, 0.9),
0 0 40px rgba(255, 140, 0, 0.85);
margin-bottom: 6px;
}

.popup-line {
position: relative;
z-index: 1;
font-size: 13px;
color: var(--text-dim);
margin-bottom: 3px;
}

.popup-close {
position: relative;
z-index: 1;
margin-top: 12px;
border: none;
border-radius: 999px;
padding: 8px 20px;
font-size: 13px;
font-weight: 600;
letter-spacing: 0.16em;
text-transform: uppercase;
cursor: pointer;
background: radial-gradient(circle at top, #ffe0a0, #ff8c00);
color: #1a0900;
box-shadow:
0 0 20px rgba(255, 140, 0, 0.9),
0 8px 16px rgba(0, 0, 0, 0.9);
}



@media
(max-width: 900px) {
.module {
padding: 20px 16px 24px;
}
.track-wrapper {
padding: 0 40px;
}
}
</style>
</head>
<body>
<div class="module">
<!-- Loot box carousel -->
<div class="section">
<div class="label">LOOT BOX SPIN</div>
<div class="track-shell">
<div class="selection-window selection-window--loot"></div>
<div class="track-wrapper" id="lootWrapper">
<div cl

Files changed (4) hide show
  1. README.md +8 -5
  2. index.html +98 -19
  3. script.js +144 -0
  4. style.css +111 -19
README.md CHANGED
@@ -1,10 +1,13 @@
1
  ---
2
- title: Loot Spin Bonanza
3
- emoji: 😻
4
- colorFrom: pink
5
- colorTo: red
6
  sdk: static
7
  pinned: false
 
 
8
  ---
9
 
10
- Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
 
 
1
  ---
2
+ title: Loot Spin Bonanza 🎰
3
+ colorFrom: blue
4
+ colorTo: purple
5
+ emoji: 🐳
6
  sdk: static
7
  pinned: false
8
+ tags:
9
+ - deepsite-v3
10
  ---
11
 
12
+ # Welcome to your new DeepSite project!
13
+ This project was created with [DeepSite](https://huggingface.co/deepsite).
index.html CHANGED
@@ -1,19 +1,98 @@
1
- <!doctype html>
2
- <html>
3
- <head>
4
- <meta charset="utf-8" />
5
- <meta name="viewport" content="width=device-width" />
6
- <title>My static Space</title>
7
- <link rel="stylesheet" href="style.css" />
8
- </head>
9
- <body>
10
- <div class="card">
11
- <h1>Welcome to your static Space!</h1>
12
- <p>You can modify this app directly by editing <i>index.html</i> in the Files and versions tab.</p>
13
- <p>
14
- Also don't forget to check the
15
- <a href="https://huggingface.co/docs/hub/spaces" target="_blank">Spaces documentation</a>.
16
- </p>
17
- </div>
18
- </body>
19
- </html>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="UTF-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
+ <title>Loot Spin Bonanza</title>
7
+ <link rel="stylesheet" href="style.css">
8
+ <script src="https://cdn.tailwindcss.com"></script>
9
+ <script src="https://unpkg.com/feather-icons"></script>
10
+ <script src="https://cdn.jsdelivr.net/npm/feather-icons/dist/feather.min.js"></script>
11
+ <script>
12
+ tailwind.config = {
13
+ theme: {
14
+ extend: {
15
+ colors: {
16
+ primary: '#ff8c00',
17
+ secondary: '#ffcc66',
18
+ dark: '#050505',
19
+ light: '#f7f7f7',
20
+ dim: '#a7a7a7',
21
+ green: '#00c878',
22
+ blue: '#50a0ff',
23
+ purple: '#a050ff',
24
+ gold: '#ffcc66'
25
+ }
26
+ }
27
+ }
28
+ }
29
+ </script>
30
+ </head>
31
+ <body class="min-h-screen flex items-center justify-center p-6 bg-gradient-to-b from-primary/10 to-dark">
32
+ <div class="w-full max-w-4xl rounded-3xl p-8 bg-gradient-to-br from-white/5 to-dark/95 backdrop-blur-lg shadow-xl shadow-primary/20 border border-white/10">
33
+ <!-- Header -->
34
+ <header class="flex items-center justify-between mb-8">
35
+ <div class="flex items-center gap-2">
36
+ <i data-feather="gift" class="text-primary"></i>
37
+ <h1 class="text-2xl font-bold text-light">Loot Spin Bonanza</h1>
38
+ </div>
39
+ <div class="flex items-center gap-2 text-dim">
40
+ <i data-feather="user" class="w-5 h-5"></i>
41
+ <span>Player</span>
42
+ </div>
43
+ </header>
44
+
45
+ <!-- Loot Box Section -->
46
+ <section class="mb-8">
47
+ <h2 class="text-xs uppercase tracking-widest text-dim mb-2">Loot Box Spin</h2>
48
+ <div class="relative py-6 px-4 rounded-2xl bg-gradient-to-b from-dark/95 to-dark shadow-inner shadow-black/50 border border-white/5 overflow-hidden">
49
+ <div id="lootSelectionWindow" class="absolute top-6 left-1/2 -translate-x-1/2 w-24 h-32 rounded-xl border-2 border-primary shadow-lg shadow-primary/50 z-10 pointer-events-none"></div>
50
+ <div id="lootWrapper" class="overflow-hidden px-12">
51
+ <div id="lootTrack" class="flex gap-4">
52
+ <!-- Loot boxes will be inserted here by JavaScript -->
53
+ </div>
54
+ </div>
55
+ </div>
56
+ </section>
57
+
58
+ <!-- Multiplier Section -->
59
+ <section class="mb-8">
60
+ <h2 class="text-xs uppercase tracking-widest text-dim mb-2">Multiplier</h2>
61
+ <div class="relative py-6 px-4 rounded-2xl bg-gradient-to-b from-dark/95 to-dark shadow-inner shadow-black/50 border border-white/5 overflow-hidden">
62
+ <div id="multiSelectionWindow" class="absolute top-6 left-1/2 -translate-x-1/2 w-24 h-14 rounded-full border-2 border-primary shadow-lg shadow-primary/50 z-10 pointer-events-none"></div>
63
+ <div id="multiWrapper" class="overflow-hidden px-12">
64
+ <div id="multiTrack" class="flex gap-4">
65
+ <!-- Multiplier pills will be inserted here by JavaScript -->
66
+ </div>
67
+ </div>
68
+ </div>
69
+ </section>
70
+
71
+ <!-- Spin Button -->
72
+ <div class="flex justify-center">
73
+ <button id="spinBtn" class="px-12 py-4 rounded-full bg-gradient-to-b from-primary to-primary-dark text-dark font-bold uppercase tracking-wider shadow-lg shadow-primary/30 hover:shadow-primary/40 transition-all duration-200 hover:scale-105 active:scale-95">
74
+ Spin Now
75
+ </button>
76
+ </div>
77
+ </div>
78
+
79
+ <!-- Result Popup -->
80
+ <div id="popupBackdrop" class="fixed inset-0 bg-black/80 flex items-center justify-center hidden z-50">
81
+ <div class="w-80 max-w-full rounded-2xl p-6 bg-gradient-to-br from-dark/95 to-dark/90 backdrop-blur-lg border border-primary/30 shadow-2xl shadow-primary/30 text-center">
82
+ <h3 class="text-xs uppercase tracking-widest text-dim mb-2">Result</h3>
83
+ <div id="popupTotal" class="text-4xl font-bold text-secondary mb-4">0 SC</div>
84
+ <div id="popupBase" class="text-sm text-dim mb-1">Base: 0 SC</div>
85
+ <div id="popupMulti" class="text-sm text-dim mb-6">Multiplier: ×1</div>
86
+ <button id="popupClose" class="px-6 py-2 rounded-full bg-gradient-to-b from-primary to-primary-dark text-dark font-medium text-sm uppercase tracking-wider shadow-md shadow-primary/20">
87
+ Collect
88
+ </button>
89
+ </div>
90
+ </div>
91
+
92
+ <script src="script.js"></script>
93
+ <script>
94
+ feather.replace();
95
+ </script>
96
+ <script src="https://huggingface.co/deepsite/deepsite-badge.js"></script>
97
+ </body>
98
+ </html>
script.js ADDED
@@ -0,0 +1,144 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ document.addEventListener('DOMContentLoaded', () => {
2
+ // DOM Elements
3
+ const lootTrack = document.getElementById('lootTrack');
4
+ const lootWrapper = document.getElementById('lootWrapper');
5
+ const multiTrack = document.getElementById('multiTrack');
6
+ const multiWrapper = document.getElementById('multiWrapper');
7
+ const spinBtn = document.getElementById('spinBtn');
8
+ const popupBackdrop = document.getElementById('popupBackdrop');
9
+ const popupTotal = document.getElementById('popupTotal');
10
+ const popupBase = document.getElementById('popupBase');
11
+ const popupMulti = document.getElementById('popupMulti');
12
+ const popupClose = document.getElementById('popupClose');
13
+
14
+ // Loot Box Data
15
+ const lootBoxesData = [
16
+ { prize: 10, rarity: 'green' },
17
+ { prize: 15, rarity: 'blue' },
18
+ { prize: 20, rarity: 'blue' },
19
+ { prize: 25, rarity: 'green' },
20
+ { prize: 30, rarity: 'purple' },
21
+ { prize: 35, rarity: 'purple' },
22
+ { prize: 40, rarity: 'green' },
23
+ { prize: 45, rarity: 'blue' },
24
+ { prize: 50, rarity: 'purple' },
25
+ { prize: 100, rarity: 'gold' }
26
+ ];
27
+
28
+ // Multiplier Data
29
+ const multipliers = [1, 1.25, 1.5, 2, 3, 5, 1, 1.25, 1.5, 2, 3, 5];
30
+
31
+ // Initialize tracks
32
+ function initializeTracks() {
33
+ // Create loot boxes
34
+ lootBoxesData.forEach(box => {
35
+ const boxElement = document.createElement('div');
36
+ boxElement.className = 'loot-box';
37
+ boxElement.dataset.prize = box.prize;
38
+ boxElement.dataset.rarity = box.rarity;
39
+
40
+ const inner = document.createElement('div');
41
+ inner.className = 'loot-box-inner';
42
+ boxElement.appendChild(inner);
43
+
44
+ lootTrack.appendChild(boxElement);
45
+ });
46
+
47
+ // Create multiplier pills
48
+ multipliers.forEach(m => {
49
+ const pill = document.createElement('div');
50
+ pill.className = 'multi-pill';
51
+ pill.dataset.m = m;
52
+ pill.textContent = `×${m}`;
53
+ multiTrack.appendChild(pill);
54
+ });
55
+ }
56
+
57
+ // Spin animation function
58
+ async function spinTrack(track, items, wrapper, extraMinSteps, extraMaxSteps, duration) {
59
+ return new Promise(resolve => {
60
+ // Reset classes
61
+ items.forEach(el => {
62
+ el.classList.remove('selected', 'motion-blur');
63
+ });
64
+
65
+ const targetIndex = Math.floor(Math.random() * items.length);
66
+ const wrapperRect = wrapper.getBoundingClientRect();
67
+ const centerX = wrapperRect.left + wrapperRect.width / 2;
68
+ const targetRect = items[targetIndex].getBoundingClientRect();
69
+ const targetCenter = targetRect.left + targetRect.width / 2;
70
+ const deltaToCenter = centerX - targetCenter;
71
+
72
+ // Calculate step size
73
+ let step = 0;
74
+ if (items.length > 1) {
75
+ const r0 = items[0].getBoundingClientRect();
76
+ const r1 = items[1].getBoundingClientRect();
77
+ step = Math.abs((r1.left + r1.width / 2) - (r0.left + r0.width / 2));
78
+ } else {
79
+ step = targetRect.width + 18;
80
+ }
81
+
82
+ const extraSteps = extraMinSteps + Math.floor(Math.random() * (extraMaxSteps - extraMinSteps + 1));
83
+ const direction = Math.random() > 0.5 ? 1 : -1;
84
+ const extraDistance = extraSteps * step * direction;
85
+ const currentTranslate = parseFloat(track.style.transform?.replace('translateX(', '').replace('px)', '') || '0');
86
+ const finalTranslate = currentTranslate + deltaToCenter + extraDistance;
87
+
88
+ // Apply motion blur
89
+ items.forEach((el, i) => {
90
+ if (i !== targetIndex) el.classList.add('motion-blur');
91
+ });
92
+
93
+ // Start animation
94
+ track.style.transition = `transform ${duration}ms cubic-bezier(0.1, 0.9, 0.24, 1)`;
95
+ track.style.transform = `translateX(${finalTranslate}px)`;
96
+
97
+ setTimeout(() => {
98
+ track.style.transition = '';
99
+ items.forEach(el => el.classList.remove('motion-blur'));
100
+ items[targetIndex].classList.add('selected');
101
+ resolve({ index: targetIndex, element: items[targetIndex] });
102
+ }, duration + 40);
103
+ });
104
+ }
105
+
106
+ // Handle spin button click
107
+ async function handleSpin() {
108
+ if (spinBtn.disabled) return;
109
+ spinBtn.disabled = true;
110
+
111
+ // Spin loot boxes
112
+ const lootResult = await spinTrack(lootTrack, [...lootTrack.children], lootWrapper, 3, 6, 1100);
113
+ const basePrize = parseFloat(lootResult.element.dataset.prize);
114
+
115
+ // Spin multiplier
116
+ const multiResult = await spinTrack(multiTrack, [...multiTrack.children], multiWrapper, 4, 7, 1000);
117
+ const multiplier = parseFloat(multiResult.element.dataset.m);
118
+
119
+ // Calculate total
120
+ const total = Math.round(basePrize * multiplier * 100) / 100;
121
+
122
+ // Show result
123
+ popupTotal.textContent = `${total} SC`;
124
+ popupBase.textContent = `Base: ${basePrize} SC`;
125
+ popupMulti.textContent = `Multiplier: ×${multiplier}`;
126
+ popupBackdrop.classList.remove('hidden');
127
+
128
+ spinBtn.disabled = false;
129
+ }
130
+
131
+ // Event listeners
132
+ spinBtn.addEventListener('click', handleSpin);
133
+ popupClose.addEventListener('click', () => {
134
+ popupBackdrop.classList.add('hidden');
135
+ });
136
+ popupBackdrop.addEventListener('click', (e) => {
137
+ if (e.target === popupBackdrop) {
138
+ popupBackdrop.classList.add('hidden');
139
+ }
140
+ });
141
+
142
+ // Initialize
143
+ initializeTracks();
144
+ });
style.css CHANGED
@@ -1,28 +1,120 @@
1
- body {
2
- padding: 2rem;
3
- font-family: -apple-system, BlinkMacSystemFont, "Arial", sans-serif;
4
  }
5
 
6
- h1 {
7
- font-size: 16px;
8
- margin-top: 0;
 
 
 
 
 
 
 
 
 
9
  }
10
 
11
- p {
12
- color: rgb(107, 114, 128);
13
- font-size: 15px;
14
- margin-bottom: 10px;
15
- margin-top: 5px;
 
 
 
16
  }
17
 
18
- .card {
19
- max-width: 620px;
20
- margin: 0 auto;
21
- padding: 16px;
22
- border: 1px solid lightgray;
23
- border-radius: 16px;
 
 
 
 
 
24
  }
25
 
26
- .card p:last-child {
27
- margin-bottom: 0;
 
 
 
 
 
28
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ @keyframes pulse {
2
+ 0%, 100% { opacity: 0.8; }
3
+ 50% { opacity: 1; }
4
  }
5
 
6
+ .loot-box {
7
+ width: 90px;
8
+ height: 90px;
9
+ border-radius: 18px;
10
+ position: relative;
11
+ display: flex;
12
+ align-items: center;
13
+ justify-content: center;
14
+ border: 1px solid rgba(255, 255, 255, 0.08);
15
+ background: radial-gradient(circle at top, #171717, #050505);
16
+ box-shadow: 0 8px 18px rgba(0, 0, 0, 0.85), 0 0 18px rgba(0, 0, 0, 0.7);
17
+ transition: all 160ms ease-out;
18
  }
19
 
20
+ .loot-box::before {
21
+ content: "";
22
+ position: absolute;
23
+ inset: 8px;
24
+ border-radius: 14px;
25
+ border: 2px solid rgba(255, 255, 255, 0.16);
26
+ box-shadow: inset 0 0 14px rgba(0, 0, 0, 0.9);
27
+ z-index: 1;
28
  }
29
 
30
+ .loot-box-inner {
31
+ position: relative;
32
+ z-index: 2;
33
+ width: 48px;
34
+ height: 48px;
35
+ border-radius: 14px;
36
+ background: radial-gradient(circle at top, #222, #000);
37
+ display: flex;
38
+ align-items: center;
39
+ justify-content: center;
40
+ box-shadow: 0 0 14px rgba(0, 0, 0, 0.8);
41
  }
42
 
43
+ .loot-box-inner::before {
44
+ content: "";
45
+ width: 22px;
46
+ height: 22px;
47
+ border-radius: 6px;
48
+ border: 2px solid rgba(255, 255, 255, 0.6);
49
+ box-shadow: 0 0 10px rgba(255, 255, 255, 0.3);
50
  }
51
+
52
+ .loot-box[data-rarity="green"] {
53
+ box-shadow: 0 0 18px rgba(0, 200, 120, 0.7);
54
+ }
55
+
56
+ .loot-box[data-rarity="blue"] {
57
+ box-shadow: 0 0 18px rgba(80, 160, 255, 0.8);
58
+ }
59
+
60
+ .loot-box[data-rarity="purple"] {
61
+ box-shadow: 0 0 20px rgba(160, 80, 255, 0.85);
62
+ }
63
+
64
+ .loot-box[data-rarity="gold"] {
65
+ box-shadow: 0 0 22px rgba(255, 190, 70, 0.95);
66
+ }
67
+
68
+ .loot-box.selected {
69
+ transform: scale(1.12);
70
+ border-color: rgba(255, 140, 0, 0.95);
71
+ filter: brightness(1.1);
72
+ box-shadow: 0 0 26px rgba(255, 140, 0, 0.95), 0 0 60px rgba(255, 140, 0, 0.75);
73
+ }
74
+
75
+ .loot-box.motion-blur {
76
+ filter: blur(1px) brightness(0.9);
77
+ opacity: 0.9;
78
+ }
79
+
80
+ .multi-pill {
81
+ min-width: 90px;
82
+ height: 40px;
83
+ border-radius: 999px;
84
+ display: flex;
85
+ align-items: center;
86
+ justify-content: center;
87
+ font-size: 17px;
88
+ font-weight: 700;
89
+ color: #ffd8a0;
90
+ background: rgba(255, 255, 255, 0.08);
91
+ backdrop-filter: blur(6px);
92
+ box-shadow: 0 0 8px rgba(0, 0, 0, 0.6), inset 0 0 6px rgba(255, 255, 255, 0.1);
93
+ transition: all 140ms ease-out;
94
+ }
95
+
96
+ .multi-pill.selected {
97
+ transform: scale(1.18);
98
+ color: #fff2cc;
99
+ box-shadow: 0 0 20px rgba(255, 140, 0, 0.95), 0 0 50px rgba(255, 140, 0, 0.6);
100
+ }
101
+
102
+ .multi-pill.motion-blur {
103
+ filter: blur(1px) brightness(0.95);
104
+ opacity: 0.9;
105
+ }
106
+
107
+ #spinBtn:disabled {
108
+ opacity: 0.7;
109
+ cursor: not-allowed;
110
+ transform: none !important;
111
+ }
112
+
113
+ #popupBackdrop {
114
+ animation: fadeIn 0.3s ease-out;
115
+ }
116
+
117
+ @keyframes fadeIn {
118
+ from { opacity: 0; }
119
+ to { opacity: 1; }
120
+ }