ProjectGenesis commited on
Commit
6d7a5d2
·
verified ·
1 Parent(s): 4dc3c9d

<!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 (6) hide show
  1. README.md +8 -5
  2. components/footer.js +57 -0
  3. components/header.js +83 -0
  4. index.html +86 -19
  5. script.js +110 -0
  6. style.css +76 -18
README.md CHANGED
@@ -1,10 +1,13 @@
1
  ---
2
- title: Loot Spin Deluxe Extravaganza
3
- emoji: 🦀
4
- colorFrom: red
5
- colorTo: yellow
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 Deluxe Extravaganza 🎰
3
+ colorFrom: pink
4
+ colorTo: green
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).
components/footer.js ADDED
@@ -0,0 +1,57 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ class CustomFooter extends HTMLElement {
2
+ connectedCallback() {
3
+ this.attachShadow({ mode: 'open' });
4
+ this.shadowRoot.innerHTML = `
5
+ <style>
6
+ footer {
7
+ background: linear-gradient(90deg, rgba(17, 24, 39, 0.9), rgba(31, 41, 55, 0.9));
8
+ padding: 2rem;
9
+ margin-top: auto;
10
+ }
11
+
12
+ .container {
13
+ max-width: 1200px;
14
+ margin: 0 auto;
15
+ display: flex;
16
+ flex-direction: column;
17
+ align-items: center;
18
+ gap: 1.5rem;
19
+ }
20
+
21
+ .social-links {
22
+ display: flex;
23
+ gap: 1.5rem;
24
+ }
25
+
26
+ .social-links a {
27
+ color: #9ca3af;
28
+ transition: color 0.2s;
29
+ }
30
+
31
+ .social-links a:hover {
32
+ color: white;
33
+ }
34
+
35
+ .copyright {
36
+ color: #6b7280;
37
+ font-size: 0.875rem;
38
+ text-align: center;
39
+ }
40
+ </style>
41
+ <footer>
42
+ <div class="container">
43
+ <div class="social-links">
44
+ <a href="#" aria-label="Twitter"><i data-feather="twitter"></i></a>
45
+ <a href="#" aria-label="Discord"><i data-feather="message-circle"></i></a>
46
+ <a href="#" aria-label="GitHub"><i data-feather="github"></i></a>
47
+ </div>
48
+ <div class="copyright">
49
+ &copy; ${new Date().getFullYear()} Loot Spin Deluxe. All rights reserved.
50
+ </div>
51
+ </div>
52
+ </footer>
53
+ `;
54
+ }
55
+ }
56
+
57
+ customElements.define('custom-footer', CustomFooter);
components/header.js ADDED
@@ -0,0 +1,83 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ class CustomHeader extends HTMLElement {
2
+ connectedCallback() {
3
+ this.attachShadow({ mode: 'open' });
4
+ this.shadowRoot.innerHTML = `
5
+ <style>
6
+ header {
7
+ background: linear-gradient(90deg, rgba(31, 41, 55, 0.9), rgba(17, 24, 39, 0.9));
8
+ backdrop-filter: blur(10px);
9
+ padding: 1rem 2rem;
10
+ box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
11
+ }
12
+
13
+ .container {
14
+ max-width: 1200px;
15
+ margin: 0 auto;
16
+ display: flex;
17
+ justify-content: space-between;
18
+ align-items: center;
19
+ }
20
+
21
+ .logo {
22
+ font-size: 1.5rem;
23
+ font-weight: 700;
24
+ background: linear-gradient(45deg, #f97316, #eab308);
25
+ -webkit-background-clip: text;
26
+ background-clip: text;
27
+ color: transparent;
28
+ display: flex;
29
+ align-items: center;
30
+ gap: 0.5rem;
31
+ }
32
+
33
+ nav ul {
34
+ display: flex;
35
+ gap: 1.5rem;
36
+ list-style: none;
37
+ }
38
+
39
+ nav a {
40
+ color: #d1d5db;
41
+ text-decoration: none;
42
+ font-weight: 500;
43
+ transition: color 0.2s;
44
+ display: flex;
45
+ align-items: center;
46
+ gap: 0.25rem;
47
+ }
48
+
49
+ nav a:hover {
50
+ color: white;
51
+ }
52
+
53
+ @media (max-width: 768px) {
54
+ .container {
55
+ flex-direction: column;
56
+ gap: 1rem;
57
+ }
58
+
59
+ nav ul {
60
+ gap: 1rem;
61
+ }
62
+ }
63
+ </style>
64
+ <header>
65
+ <div class="container">
66
+ <a href="/" class="logo">
67
+ <i data-feather="diamond"></i>
68
+ <span>Loot Spin</span>
69
+ </a>
70
+ <nav>
71
+ <ul>
72
+ <li><a href="/"><i data-feather="home"></i> Home</a></li>
73
+ <li><a href="/about"><i data-feather="info"></i> About</a></li>
74
+ <li><a href="/leaderboard"><i data-feather="award"></i> Leaderboard</a></li>
75
+ </ul>
76
+ </nav>
77
+ </div>
78
+ </header>
79
+ `;
80
+ }
81
+ }
82
+
83
+ customElements.define('custom-header', CustomHeader);
index.html CHANGED
@@ -1,19 +1,86 @@
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 Deluxe</title>
7
+ <script src="https://cdn.tailwindcss.com"></script>
8
+ <script src="https://unpkg.com/feather-icons"></script>
9
+ <script src="https://cdn.jsdelivr.net/npm/feather-icons/dist/feather.min.js"></script>
10
+ <link rel="stylesheet" href="style.css">
11
+ </head>
12
+ <body class="bg-gray-900 text-white">
13
+ <custom-header></custom-header>
14
+
15
+ <main class="container mx-auto px-4 py-12">
16
+ <div class="max-w-4xl mx-auto bg-gray-800 rounded-2xl shadow-2xl overflow-hidden">
17
+ <!-- Loot Box Section -->
18
+ <section class="p-8 border-b border-gray-700">
19
+ <h2 class="text-xl font-bold mb-6 flex items-center gap-2">
20
+ <i data-feather="gift" class="text-orange-400"></i>
21
+ <span>Loot Box Spin</span>
22
+ </h2>
23
+ <div class="relative h-48 bg-gray-900 rounded-xl overflow-hidden">
24
+ <div class="absolute inset-0 flex items-center justify-center">
25
+ <div class="h-24 w-24 border-4 border-orange-400 rounded-xl shadow-lg shadow-orange-400/30 z-10"></div>
26
+ </div>
27
+ <div id="lootTrack" class="h-full flex items-center gap-8 px-16">
28
+ <!-- Loot boxes will be generated by JS -->
29
+ </div>
30
+ </div>
31
+ </section>
32
+
33
+ <!-- Multiplier Section -->
34
+ <section class="p-8 border-b border-gray-700">
35
+ <h2 class="text-xl font-bold mb-6 flex items-center gap-2">
36
+ <i data-feather="zap" class="text-yellow-400"></i>
37
+ <span>Multiplier</span>
38
+ </h2>
39
+ <div class="relative h-20 bg-gray-900 rounded-xl overflow-hidden">
40
+ <div class="absolute inset-0 flex items-center justify-center">
41
+ <div class="h-12 w-24 border-2 border-yellow-400 rounded-full shadow-lg shadow-yellow-400/30 z-10"></div>
42
+ </div>
43
+ <div id="multiTrack" class="h-full flex items-center gap-6 px-16">
44
+ <!-- Multipliers will be generated by JS -->
45
+ </div>
46
+ </div>
47
+ </section>
48
+
49
+ <!-- Spin Button -->
50
+ <section class="p-8">
51
+ <button id="spinBtn" class="w-full py-4 bg-gradient-to-r from-orange-500 to-yellow-500 rounded-xl font-bold text-lg shadow-lg hover:shadow-orange-500/30 transition-all duration-300 flex items-center justify-center gap-2">
52
+ <i data-feather="rotate-cw"></i>
53
+ <span>SPIN TO WIN</span>
54
+ </button>
55
+ </section>
56
+ </div>
57
+ </main>
58
+
59
+ <!-- Result Modal -->
60
+ <div id="resultModal" class="fixed inset-0 bg-black bg-opacity-80 hidden items-center justify-center z-50">
61
+ <div class="bg-gray-800 rounded-2xl p-8 max-w-md w-full mx-4 relative overflow-hidden">
62
+ <div class="absolute inset-0 bg-gradient-to-br from-orange-500/10 to-yellow-500/10"></div>
63
+ <div class="relative z-10">
64
+ <h3 class="text-2xl font-bold mb-6 text-center">YOU WON!</h3>
65
+ <div class="text-center mb-8">
66
+ <div id="resultAmount" class="text-5xl font-bold bg-gradient-to-r from-orange-400 to-yellow-400 bg-clip-text text-transparent mb-2">0 SC</div>
67
+ <div id="resultDetails" class="text-gray-400"></div>
68
+ </div>
69
+ <button id="closeModal" class="w-full py-3 bg-orange-500 rounded-lg font-bold hover:bg-orange-600 transition-colors">
70
+ CLAIM PRIZE
71
+ </button>
72
+ </div>
73
+ </div>
74
+ </div>
75
+
76
+ <custom-footer></custom-footer>
77
+
78
+ <script src="components/header.js"></script>
79
+ <script src="components/footer.js"></script>
80
+ <script src="script.js"></script>
81
+ <script>
82
+ feather.replace();
83
+ </script>
84
+ <script src="https://huggingface.co/deepsite/deepsite-badge.js"></script>
85
+ </body>
86
+ </html>
script.js ADDED
@@ -0,0 +1,110 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ document.addEventListener('DOMContentLoaded', function() {
2
+ // Initialize loot boxes
3
+ const lootTrack = document.getElementById('lootTrack');
4
+ const lootBoxes = [
5
+ { value: 10, rarity: 'common' },
6
+ { value: 25, rarity: 'uncommon' },
7
+ { value: 50, rarity: 'rare' },
8
+ { value: 100, rarity: 'epic' },
9
+ { value: 250, rarity: 'legendary' },
10
+ { value: 500, rarity: 'mythic' },
11
+ { value: 1000, rarity: 'divine' }
12
+ ];
13
+
14
+ lootBoxes.forEach((box, index) => {
15
+ const boxElement = document.createElement('div');
16
+ boxElement.className = 'loot-box flex-shrink-0';
17
+ boxElement.dataset.value = box.value;
18
+ boxElement.dataset.rarity = box.rarity;
19
+
20
+ const icon = document.createElement('i');
21
+ icon.setAttribute('data-feather', 'box');
22
+ icon.className = 'text-white';
23
+
24
+ boxElement.appendChild(icon);
25
+ lootTrack.appendChild(boxElement);
26
+
27
+ // Add duplicate boxes for infinite scroll effect
28
+ if (index < 3) {
29
+ const clone = boxElement.cloneNode(true);
30
+ lootTrack.appendChild(clone);
31
+ }
32
+ });
33
+
34
+ // Initialize multipliers
35
+ const multiTrack = document.getElementById('multiTrack');
36
+ const multipliers = [1, 1.5, 2, 2.5, 3, 5, 10];
37
+
38
+ multipliers.forEach((mult, index) => {
39
+ const multElement = document.createElement('div');
40
+ multElement.className = 'multiplier flex-shrink-0';
41
+ multElement.textContent = `×${mult}`;
42
+ multElement.dataset.multiplier = mult;
43
+
44
+ multiTrack.appendChild(multElement);
45
+
46
+ // Add duplicate multipliers for infinite scroll effect
47
+ if (index < 3) {
48
+ const clone = multElement.cloneNode(true);
49
+ multiTrack.appendChild(clone);
50
+ }
51
+ });
52
+
53
+ // Spin functionality
54
+ const spinBtn = document.getElementById('spinBtn');
55
+ const resultModal = document.getElementById('resultModal');
56
+ const resultAmount = document.getElementById('resultAmount');
57
+ const resultDetails = document.getElementById('resultDetails');
58
+ const closeModal = document.getElementById('closeModal');
59
+
60
+ spinBtn.addEventListener('click', function() {
61
+ // Disable button during spin
62
+ spinBtn.disabled = true;
63
+ spinBtn.classList.add('opacity-50', 'cursor-not-allowed');
64
+ spinBtn.innerHTML = '<i data-feather="loader" class="animate-spin"></i><span>SPINNING...</span>';
65
+ feather.replace();
66
+
67
+ // Simulate spinning animation
68
+ lootTrack.style.transition = 'transform 4s cubic-bezier(0.1, 0.7, 0.1, 1)';
69
+ multiTrack.style.transition = 'transform 3.5s cubic-bezier(0.1, 0.7, 0.1, 1)';
70
+
71
+ // Random final positions
72
+ const lootPosition = -Math.floor(Math.random() * lootBoxes.length) * 108 - 54;
73
+ const multiPosition = -Math.floor(Math.random() * multipliers.length) * 86 - 43;
74
+
75
+ lootTrack.style.transform = `translateX(${lootPosition}px)`;
76
+ multiTrack.style.transform = `translateX(${multiPosition}px)`;
77
+
78
+ // After spin completes
79
+ setTimeout(() => {
80
+ // Get results
81
+ const lootResult = Math.floor(Math.random() * lootBoxes.length);
82
+ const multiResult = Math.floor(Math.random() * multipliers.length);
83
+
84
+ const prize = lootBoxes[lootResult].value;
85
+ const multiplier = multipliers[multiResult];
86
+ const total = prize * multiplier;
87
+
88
+ // Show result
89
+ resultAmount.textContent = `${total} SC`;
90
+ resultDetails.innerHTML = `
91
+ <div>Base: ${prize} SC</div>
92
+ <div>Multiplier: ×${multiplier}</div>
93
+ `;
94
+ resultModal.classList.remove('hidden');
95
+
96
+ // Reset button
97
+ spinBtn.disabled = false;
98
+ spinBtn.classList.remove('opacity-50', 'cursor-not-allowed');
99
+ spinBtn.innerHTML = '<i data-feather="rotate-cw"></i><span>SPIN AGAIN</span>';
100
+ feather.replace();
101
+ }, 4000);
102
+ });
103
+
104
+ closeModal.addEventListener('click', function() {
105
+ resultModal.classList.add('hidden');
106
+ });
107
+
108
+ // Replace icons again after dynamic content
109
+ feather.replace();
110
+ });
style.css CHANGED
@@ -1,28 +1,86 @@
 
 
 
 
 
 
 
 
 
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
+ @import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');
2
+
3
+ :root {
4
+ --primary: #f97316;
5
+ --secondary: #eab308;
6
+ --dark: #1f2937;
7
+ --darker: #111827;
8
+ }
9
+
10
  body {
11
+ font-family: 'Inter', sans-serif;
12
+ background-color: var(--darker);
13
+ min-height: 100vh;
14
+ display: flex;
15
+ flex-direction: column;
16
+ }
17
+
18
+ .loot-box {
19
+ min-width: 100px;
20
+ height: 100px;
21
+ background: linear-gradient(145deg, #1f2937, #111827);
22
+ border-radius: 16px;
23
+ display: flex;
24
+ align-items: center;
25
+ justify-content: center;
26
+ box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
27
+ transition: all 0.3s ease;
28
+ position: relative;
29
+ overflow: hidden;
30
+ }
31
+
32
+ .loot-box::before {
33
+ content: '';
34
+ position: absolute;
35
+ inset: 0;
36
+ border-radius: 16px;
37
+ padding: 2px;
38
+ background: linear-gradient(45deg, var(--primary), var(--secondary));
39
+ -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
40
+ -webkit-mask-composite: xor;
41
+ mask-composite: exclude;
42
+ pointer-events: none;
43
+ }
44
+
45
+ .loot-box.selected {
46
+ transform: scale(1.1);
47
+ box-shadow: 0 0 20px rgba(249, 115, 22, 0.5);
48
  }
49
 
50
+ .multiplier {
51
+ min-width: 80px;
52
+ height: 40px;
53
+ background: rgba(31, 41, 55, 0.7);
54
+ border-radius: 20px;
55
+ display: flex;
56
+ align-items: center;
57
+ justify-content: center;
58
+ font-weight: 600;
59
+ transition: all 0.3s ease;
60
  }
61
 
62
+ .multiplier.selected {
63
+ background: linear-gradient(45deg, var(--primary), var(--secondary));
64
+ color: white;
65
+ box-shadow: 0 0 15px rgba(234, 179, 8, 0.5);
 
66
  }
67
 
68
+ /* Animation classes */
69
+ .animate-spin {
70
+ animation: spin 0.5s linear infinite;
 
 
 
71
  }
72
 
73
+ @keyframes spin {
74
+ from { transform: rotate(0deg); }
75
+ to { transform: rotate(360deg); }
76
  }
77
+
78
+ .scale-pulse {
79
+ animation: pulse 1.5s infinite;
80
+ }
81
+
82
+ @keyframes pulse {
83
+ 0% { transform: scale(1); }
84
+ 50% { transform: scale(1.05); }
85
+ 100% { transform: scale(1); }
86
+ }