Spaces:
Running
<!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
- README.md +7 -4
- components/footer.js +43 -0
- components/header.js +37 -0
- index.html +90 -19
- script.js +152 -0
- style.css +79 -18
|
@@ -1,10 +1,13 @@
|
|
| 1 |
---
|
| 2 |
-
title: Loot Spin Royale
|
| 3 |
-
emoji: 🦀
|
| 4 |
colorFrom: red
|
| 5 |
-
colorTo:
|
|
|
|
| 6 |
sdk: static
|
| 7 |
pinned: false
|
|
|
|
|
|
|
| 8 |
---
|
| 9 |
|
| 10 |
-
|
|
|
|
|
|
| 1 |
---
|
| 2 |
+
title: Loot Spin Royale 🎰
|
|
|
|
| 3 |
colorFrom: red
|
| 4 |
+
colorTo: blue
|
| 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).
|
|
@@ -0,0 +1,43 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
class CustomFooter extends HTMLElement {
|
| 2 |
+
connectedCallback() {
|
| 3 |
+
this.attachShadow({ mode: 'open' });
|
| 4 |
+
this.shadowRoot.innerHTML = `
|
| 5 |
+
<style>
|
| 6 |
+
footer {
|
| 7 |
+
background: rgba(10, 10, 10, 0.8);
|
| 8 |
+
backdrop-filter: blur(10px);
|
| 9 |
+
border-top: 1px solid rgba(255, 255, 255, 0.1);
|
| 10 |
+
}
|
| 11 |
+
|
| 12 |
+
.social-icon {
|
| 13 |
+
transition: all 0.3s ease;
|
| 14 |
+
}
|
| 15 |
+
|
| 16 |
+
.social-icon:hover {
|
| 17 |
+
color: #ff8c00;
|
| 18 |
+
transform: translateY(-2px);
|
| 19 |
+
}
|
| 20 |
+
</style>
|
| 21 |
+
<footer class="py-6 px-6 mt-12">
|
| 22 |
+
<div class="container mx-auto">
|
| 23 |
+
<div class="flex flex-col md:flex-row justify-between items-center">
|
| 24 |
+
<div class="text-gray-400 text-sm mb-4 md:mb-0">
|
| 25 |
+
© 2023 Loot Spin Royale. All rights reserved.
|
| 26 |
+
</div>
|
| 27 |
+
<div class="flex gap-4">
|
| 28 |
+
<a href="#" class="social-icon text-gray-400">
|
| 29 |
+
<i data-feather="twitter"></i>
|
| 30 |
+
</a>
|
| 31 |
+
<a href="#" class="social-icon text-gray-400">
|
| 32 |
+
<i data-feather="instagram"></i>
|
| 33 |
+
</a>
|
| 34 |
+
<a href="#" class="social-icon text-gray-400">
|
| 35 |
+
<i data-feather="facebook"></i>
|
| 36 |
+
</a>
|
| 37 |
+
</div>
|
| 38 |
+
</div>
|
| 39 |
+
<div class="text-center text-xs text-gray-500 mt-4">
|
| 40 |
+
This is a demo game. No real money is involved.
|
| 41 |
+
</div>
|
| 42 |
+
</div>
|
| 43 |
+
</
|
|
@@ -0,0 +1,37 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
class CustomHeader extends HTMLElement {
|
| 2 |
+
connectedCallback() {
|
| 3 |
+
this.attachShadow({ mode: 'open' });
|
| 4 |
+
this.shadowRoot.innerHTML = `
|
| 5 |
+
<style>
|
| 6 |
+
header {
|
| 7 |
+
background: rgba(10, 10, 10, 0.8);
|
| 8 |
+
backdrop-filter: blur(10px);
|
| 9 |
+
border-bottom: 1px solid rgba(255, 255, 255, 0.1);
|
| 10 |
+
}
|
| 11 |
+
|
| 12 |
+
.logo {
|
| 13 |
+
background: linear-gradient(135deg, #ff8c00, #ffcc00);
|
| 14 |
+
-webkit-background-clip: text;
|
| 15 |
+
background-clip: text;
|
| 16 |
+
color: transparent;
|
| 17 |
+
}
|
| 18 |
+
|
| 19 |
+
nav a:hover {
|
| 20 |
+
color: #ff8c00;
|
| 21 |
+
}
|
| 22 |
+
</style>
|
| 23 |
+
<header class="py-4 px-6">
|
| 24 |
+
<div class="container mx-auto flex justify-between items-center">
|
| 25 |
+
<div class="logo text-2xl font-bold">Loot Spin Royale 🎰</div>
|
| 26 |
+
<nav class="flex gap-6">
|
| 27 |
+
<a href="#" class="text-gray-300 hover:text-orange-400 transition-colors">Home</a>
|
| 28 |
+
<a href="#" class="text-gray-300 hover:text-orange-400 transition-colors">Prizes</a>
|
| 29 |
+
<a href="#" class="text-gray-300 hover:text-orange-400 transition-colors">About</a>
|
| 30 |
+
</nav>
|
| 31 |
+
</div>
|
| 32 |
+
</header>
|
| 33 |
+
`;
|
| 34 |
+
}
|
| 35 |
+
}
|
| 36 |
+
|
| 37 |
+
customElements.define('custom-header', CustomHeader);
|
|
@@ -1,19 +1,90 @@
|
|
| 1 |
-
<!
|
| 2 |
-
<html>
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
</
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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 Royale 🎰</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 |
+
<!-- Game Module -->
|
| 18 |
+
<div class="p-8">
|
| 19 |
+
<h1 class="text-3xl font-bold text-center mb-8 text-orange-400">Loot Spin Royale</h1>
|
| 20 |
+
|
| 21 |
+
<!-- Loot Box Section -->
|
| 22 |
+
<div class="mb-12">
|
| 23 |
+
<h2 class="text-xl font-semibold mb-4 text-gray-300">LOOT BOX SPIN <i data-feather="gift" class="inline"></i></h2>
|
| 24 |
+
<div class="relative bg-gray-900 rounded-xl p-6 shadow-inner">
|
| 25 |
+
<div class="overflow-hidden">
|
| 26 |
+
<div class="flex gap-6 transition-transform duration-1000" id="lootTrack">
|
| 27 |
+
<!-- Loot boxes will be generated by JS -->
|
| 28 |
+
</div>
|
| 29 |
+
</div>
|
| 30 |
+
<div class="absolute inset-0 flex items-center justify-center pointer-events-none">
|
| 31 |
+
<div class="w-24 h-24 border-2 border-orange-400 rounded-xl shadow-lg shadow-orange-500/20"></div>
|
| 32 |
+
</div>
|
| 33 |
+
</div>
|
| 34 |
+
</div>
|
| 35 |
+
|
| 36 |
+
<!-- Multiplier Section -->
|
| 37 |
+
<div class="mb-12">
|
| 38 |
+
<h2 class="text-xl font-semibold mb-4 text-gray-300">MULTIPLIER <i data-feather="zap" class="inline"></i></h2>
|
| 39 |
+
<div class="relative bg-gray-900 rounded-xl p-6 shadow-inner">
|
| 40 |
+
<div class="overflow-hidden">
|
| 41 |
+
<div class="flex gap-4 transition-transform duration-1000" id="multiTrack">
|
| 42 |
+
<!-- Multipliers will be generated by JS -->
|
| 43 |
+
</div>
|
| 44 |
+
</div>
|
| 45 |
+
<div class="absolute inset-0 flex items-center justify-center pointer-events-none">
|
| 46 |
+
<div class="w-20 h-12 border-2 border-orange-400 rounded-full shadow-lg shadow-orange-500/20"></div>
|
| 47 |
+
</div>
|
| 48 |
+
</div>
|
| 49 |
+
</div>
|
| 50 |
+
|
| 51 |
+
<!-- Spin Button -->
|
| 52 |
+
<div class="text-center">
|
| 53 |
+
<button id="spinBtn" class="bg-gradient-to-br from-orange-400 to-orange-600 hover:from-orange-500 hover:to-orange-700 text-gray-900 font-bold py-3 px-8 rounded-full shadow-lg hover:shadow-xl transition-all duration-300 transform hover:scale-105 focus:outline-none focus:ring-2 focus:ring-orange-500 focus:ring-opacity-50">
|
| 54 |
+
SPIN NOW <i data-feather="rotate-cw" class="inline ml-2"></i>
|
| 55 |
+
</button>
|
| 56 |
+
</div>
|
| 57 |
+
</div>
|
| 58 |
+
</div>
|
| 59 |
+
</main>
|
| 60 |
+
|
| 61 |
+
<!-- Result Modal -->
|
| 62 |
+
<div id="resultModal" class="fixed inset-0 bg-black bg-opacity-80 flex items-center justify-center z-50 hidden">
|
| 63 |
+
<div class="bg-gray-800 rounded-2xl p-8 max-w-md w-full mx-4 shadow-2xl border border-orange-400">
|
| 64 |
+
<div class="text-center">
|
| 65 |
+
<h2 class="text-2xl font-bold mb-2 text-orange-400">YOU WON!</h2>
|
| 66 |
+
<div id="resultAmount" class="text-5xl font-extrabold my-6 text-white">0 SC</div>
|
| 67 |
+
<div id="resultDetails" class="text-gray-300 mb-6">
|
| 68 |
+
<p>Base: <span id="baseAmount">0</span> SC</p>
|
| 69 |
+
<p>Multiplier: ×<span id="multiplier">1</span></p>
|
| 70 |
+
</div>
|
| 71 |
+
<button id="closeModal" class="bg-orange-500 hover:bg-orange-600 text-white font-bold py-2 px-6 rounded-full transition-colors duration-300">
|
| 72 |
+
CLAIM PRIZE <i data-feather="check" class="inline ml-2"></i>
|
| 73 |
+
</button>
|
| 74 |
+
</div>
|
| 75 |
+
</div>
|
| 76 |
+
</div>
|
| 77 |
+
|
| 78 |
+
<custom-footer></custom-footer>
|
| 79 |
+
|
| 80 |
+
<!-- Web Components -->
|
| 81 |
+
<script src="components/header.js"></script>
|
| 82 |
+
<script src="components/footer.js"></script>
|
| 83 |
+
|
| 84 |
+
<script src="script.js"></script>
|
| 85 |
+
<script>
|
| 86 |
+
feather.replace();
|
| 87 |
+
</script>
|
| 88 |
+
<script src="https://huggingface.co/deepsite/deepsite-badge.js"></script>
|
| 89 |
+
</body>
|
| 90 |
+
</html>
|
|
@@ -0,0 +1,152 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
document.addEventListener('DOMContentLoaded', function() {
|
| 2 |
+
// Generate loot boxes
|
| 3 |
+
const lootTrack = document.getElementById('lootTrack');
|
| 4 |
+
const lootBoxes = [
|
| 5 |
+
{ prize: 10, rarity: 'green' },
|
| 6 |
+
{ prize: 15, rarity: 'blue' },
|
| 7 |
+
{ prize: 20, rarity: 'blue' },
|
| 8 |
+
{ prize: 25, rarity: 'green' },
|
| 9 |
+
{ prize: 30, rarity: 'purple' },
|
| 10 |
+
{ prize: 35, rarity: 'purple' },
|
| 11 |
+
{ prize: 40, rarity: 'green' },
|
| 12 |
+
{ prize: 45, rarity: 'blue' },
|
| 13 |
+
{ prize: 50, rarity: 'purple' },
|
| 14 |
+
{ prize: 100, rarity: 'gold' }
|
| 15 |
+
];
|
| 16 |
+
|
| 17 |
+
lootBoxes.forEach(box => {
|
| 18 |
+
const boxElement = document.createElement('div');
|
| 19 |
+
boxElement.className = 'loot-box flex-shrink-0';
|
| 20 |
+
boxElement.dataset.prize = box.prize;
|
| 21 |
+
boxElement.dataset.rarity = box.rarity;
|
| 22 |
+
|
| 23 |
+
const inner = document.createElement('div');
|
| 24 |
+
inner.className = 'loot-box-inner';
|
| 25 |
+
inner.innerHTML = `<span class="text-xs font-bold">${box.prize} SC</span>`;
|
| 26 |
+
|
| 27 |
+
boxElement.appendChild(inner);
|
| 28 |
+
lootTrack.appendChild(boxElement);
|
| 29 |
+
|
| 30 |
+
// Add rarity glow
|
| 31 |
+
if (box.rarity === 'green') {
|
| 32 |
+
boxElement.style.boxShadow += ', 0 0 15px rgba(0, 200, 120, 0.7)';
|
| 33 |
+
} else if (box.rarity === 'blue') {
|
| 34 |
+
boxElement.style.boxShadow += ', 0 0 15px rgba(80, 160, 255, 0.8)';
|
| 35 |
+
} else if (box.rarity === 'purple') {
|
| 36 |
+
boxElement.style.boxShadow += ', 0 0 18px rgba(160, 80, 255, 0.9)';
|
| 37 |
+
} else if (box.rarity === 'gold') {
|
| 38 |
+
boxElement.style.boxShadow += ', 0 0 20px rgba(255, 190, 70, 1)';
|
| 39 |
+
}
|
| 40 |
+
});
|
| 41 |
+
|
| 42 |
+
// Generate multipliers
|
| 43 |
+
const multiTrack = document.getElementById('multiTrack');
|
| 44 |
+
const multipliers = [1, 1.25, 1.5, 2, 3, 5, 1, 1.25, 1.5, 2, 3, 5];
|
| 45 |
+
|
| 46 |
+
multipliers.forEach(m => {
|
| 47 |
+
const multiElement = document.createElement('div');
|
| 48 |
+
multiElement.className = 'multiplier flex-shrink-0';
|
| 49 |
+
multiElement.textContent = `×${m}`;
|
| 50 |
+
multiElement.dataset.multiplier = m;
|
| 51 |
+
multiTrack.appendChild(multiElement);
|
| 52 |
+
});
|
| 53 |
+
|
| 54 |
+
// Spin functionality
|
| 55 |
+
const spinBtn = document.getElementById('spinBtn');
|
| 56 |
+
const resultModal = document.getElementById('resultModal');
|
| 57 |
+
const resultAmount = document.getElementById('resultAmount');
|
| 58 |
+
const baseAmount = document.getElementById('baseAmount');
|
| 59 |
+
const multiplier = document.getElementById('multiplier');
|
| 60 |
+
const closeModal = document.getElementById('closeModal');
|
| 61 |
+
|
| 62 |
+
spinBtn.addEventListener('click', async function() {
|
| 63 |
+
if (spinBtn.classList.contains('disabled')) return;
|
| 64 |
+
spinBtn.classList.add('disabled');
|
| 65 |
+
|
| 66 |
+
// Add loading state
|
| 67 |
+
spinBtn.innerHTML = 'SPINNING <i data-feather="loader" class="inline ml-2 animate-spin"></i>';
|
| 68 |
+
feather.replace();
|
| 69 |
+
|
| 70 |
+
// Simulate spinning animation
|
| 71 |
+
const lootBoxes = document.querySelectorAll('.loot-box');
|
| 72 |
+
const multipliers = document.querySelectorAll('.multiplier');
|
| 73 |
+
|
| 74 |
+
// Reset previous selections
|
| 75 |
+
lootBoxes.forEach(box => box.classList.remove('selected'));
|
| 76 |
+
multipliers.forEach(m => m.classList.remove('selected'));
|
| 77 |
+
|
| 78 |
+
// Randomly select loot box and multiplier
|
| 79 |
+
const randomLootIndex = Math.floor(Math.random() * lootBoxes.length);
|
| 80 |
+
const randomMultiIndex = Math.floor(Math.random() * multipliers.length);
|
| 81 |
+
|
| 82 |
+
// Simulate spinning animation
|
| 83 |
+
await spinAnimation(lootTrack, randomLootIndex, 1500);
|
| 84 |
+
await spinAnimation(multiTrack, randomMultiIndex, 1200);
|
| 85 |
+
|
| 86 |
+
// Select the winners
|
| 87 |
+
const selectedBox = lootBoxes[randomLootIndex];
|
| 88 |
+
const selectedMulti = multipliers[randomMultiIndex];
|
| 89 |
+
|
| 90 |
+
selectedBox.classList.add('selected');
|
| 91 |
+
selectedMulti.classList.add('selected');
|
| 92 |
+
|
| 93 |
+
// Calculate prize
|
| 94 |
+
const prize = parseFloat(selectedBox.dataset.prize);
|
| 95 |
+
const multi = parseFloat(selectedMulti.dataset.multiplier);
|
| 96 |
+
const total = prize * multi;
|
| 97 |
+
|
| 98 |
+
// Show result
|
| 99 |
+
resultAmount.textContent = `${total.toFixed(2)} SC`;
|
| 100 |
+
baseAmount.textContent = prize;
|
| 101 |
+
multiplier.textContent = multi;
|
| 102 |
+
|
| 103 |
+
// Show modal with slight delay
|
| 104 |
+
setTimeout(() => {
|
| 105 |
+
resultModal.classList.remove('hidden');
|
| 106 |
+
resultModal.classList.add('flex', 'fade-in');
|
| 107 |
+
}, 500);
|
| 108 |
+
|
| 109 |
+
// Reset button
|
| 110 |
+
spinBtn.classList.remove('disabled');
|
| 111 |
+
spinBtn.innerHTML = 'SPIN AGAIN <i data-feather="rotate-cw" class="inline ml-2"></i>';
|
| 112 |
+
feather.replace();
|
| 113 |
+
});
|
| 114 |
+
|
| 115 |
+
closeModal.addEventListener('click', function() {
|
| 116 |
+
resultModal.classList.add('hidden');
|
| 117 |
+
resultModal.classList.remove('flex', 'fade-in');
|
| 118 |
+
});
|
| 119 |
+
|
| 120 |
+
// Helper function for spinning animation
|
| 121 |
+
function spinAnimation(track, targetIndex, duration) {
|
| 122 |
+
return new Promise(resolve => {
|
| 123 |
+
const items = track.querySelectorAll('div');
|
| 124 |
+
const itemWidth = items[0].offsetWidth + 24; // width + gap
|
| 125 |
+
|
| 126 |
+
// Calculate final position to center the target item
|
| 127 |
+
const wrapperWidth = track.parentElement.offsetWidth;
|
| 128 |
+
const targetPosition = -((targetIndex * itemWidth) - (wrapperWidth / 2) + (itemWidth / 2));
|
| 129 |
+
|
| 130 |
+
// Add some extra spins
|
| 131 |
+
const extraSpins = 3 + Math.floor(Math.random() * 3);
|
| 132 |
+
const extraDistance = extraSpins * items.length * itemWidth;
|
| 133 |
+
const direction = Math.random() > 0.5 ? 1 : -1;
|
| 134 |
+
const startPosition = targetPosition - (extraDistance * direction);
|
| 135 |
+
|
| 136 |
+
// Set initial position
|
| 137 |
+
track.style.transition = 'none';
|
| 138 |
+
track.style.transform = `translateX(${startPosition}px)`;
|
| 139 |
+
|
| 140 |
+
// Force reflow
|
| 141 |
+
track.offsetHeight;
|
| 142 |
+
|
| 143 |
+
// Animate to final position
|
| 144 |
+
track.style.transition = `transform ${duration}ms cubic-bezier(0.25, 0.1, 0.25, 1)`;
|
| 145 |
+
track.style.transform = `translateX(${targetPosition}px)`;
|
| 146 |
+
|
| 147 |
+
setTimeout(() => {
|
| 148 |
+
resolve();
|
| 149 |
+
}, duration);
|
| 150 |
+
});
|
| 151 |
+
}
|
| 152 |
+
});
|
|
@@ -1,28 +1,89 @@
|
|
|
|
|
|
|
|
| 1 |
body {
|
| 2 |
-
|
| 3 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 4 |
}
|
| 5 |
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 9 |
}
|
| 10 |
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
margin-top: 5px;
|
| 16 |
}
|
| 17 |
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
padding: 16px;
|
| 22 |
-
border: 1px solid lightgray;
|
| 23 |
-
border-radius: 16px;
|
| 24 |
}
|
| 25 |
|
| 26 |
-
|
| 27 |
-
|
|
|
|
| 28 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600;700&display=swap');
|
| 2 |
+
|
| 3 |
body {
|
| 4 |
+
font-family: 'Poppins', sans-serif;
|
| 5 |
+
background: radial-gradient(circle at top, #1a0d00 0%, #000 55%);
|
| 6 |
+
min-height: 100vh;
|
| 7 |
+
}
|
| 8 |
+
|
| 9 |
+
/* Loot Box Styles */
|
| 10 |
+
.loot-box {
|
| 11 |
+
width: 90px;
|
| 12 |
+
height: 90px;
|
| 13 |
+
border-radius: 18px;
|
| 14 |
+
background: linear-gradient(145deg, #1e1e1e, #0a0a0a);
|
| 15 |
+
display: flex;
|
| 16 |
+
align-items: center;
|
| 17 |
+
justify-content: center;
|
| 18 |
+
box-shadow: 0 8px 18px rgba(0, 0, 0, 0.85);
|
| 19 |
+
transition: all 0.3s ease;
|
| 20 |
+
position: relative;
|
| 21 |
+
overflow: hidden;
|
| 22 |
+
}
|
| 23 |
+
|
| 24 |
+
.loot-box::before {
|
| 25 |
+
content: '';
|
| 26 |
+
position: absolute;
|
| 27 |
+
inset: 0;
|
| 28 |
+
border-radius: 16px;
|
| 29 |
+
padding: 2px;
|
| 30 |
+
background: linear-gradient(135deg, rgba(255, 140, 0, 0.5), rgba(255, 140, 0, 0.1));
|
| 31 |
+
-webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
|
| 32 |
+
-webkit-mask-composite: xor;
|
| 33 |
+
mask-composite: exclude;
|
| 34 |
+
pointer-events: none;
|
| 35 |
+
}
|
| 36 |
+
|
| 37 |
+
.loot-box.selected {
|
| 38 |
+
transform: scale(1.1);
|
| 39 |
+
box-shadow: 0 0 20px rgba(255, 140, 0, 0.7);
|
| 40 |
+
}
|
| 41 |
+
|
| 42 |
+
.loot-box-inner {
|
| 43 |
+
width: 60px;
|
| 44 |
+
height: 60px;
|
| 45 |
+
border-radius: 12px;
|
| 46 |
+
background: linear-gradient(145deg, #222, #111);
|
| 47 |
+
display: flex;
|
| 48 |
+
align-items: center;
|
| 49 |
+
justify-content: center;
|
| 50 |
+
box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.5);
|
| 51 |
}
|
| 52 |
|
| 53 |
+
/* Multiplier Styles */
|
| 54 |
+
.multiplier {
|
| 55 |
+
min-width: 80px;
|
| 56 |
+
height: 40px;
|
| 57 |
+
border-radius: 999px;
|
| 58 |
+
background: rgba(255, 255, 255, 0.1);
|
| 59 |
+
display: flex;
|
| 60 |
+
align-items: center;
|
| 61 |
+
justify-content: center;
|
| 62 |
+
font-weight: 600;
|
| 63 |
+
transition: all 0.3s ease;
|
| 64 |
}
|
| 65 |
|
| 66 |
+
.multiplier.selected {
|
| 67 |
+
background: rgba(255, 140, 0, 0.2);
|
| 68 |
+
color: #ff8c00;
|
| 69 |
+
transform: scale(1.1);
|
|
|
|
| 70 |
}
|
| 71 |
|
| 72 |
+
/* Animation Classes */
|
| 73 |
+
.animate-spin {
|
| 74 |
+
animation: spin 0.5s linear infinite;
|
|
|
|
|
|
|
|
|
|
| 75 |
}
|
| 76 |
|
| 77 |
+
@keyframes spin {
|
| 78 |
+
from { transform: rotate(0deg); }
|
| 79 |
+
to { transform: rotate(360deg); }
|
| 80 |
}
|
| 81 |
+
|
| 82 |
+
.fade-in {
|
| 83 |
+
animation: fadeIn 0.3s ease-in-out;
|
| 84 |
+
}
|
| 85 |
+
|
| 86 |
+
@keyframes fadeIn {
|
| 87 |
+
from { opacity: 0; }
|
| 88 |
+
to { opacity: 1; }
|
| 89 |
+
}
|