Spaces:
Sleeping
Sleeping
File size: 14,838 Bytes
4b2adab |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 |
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Spin the Wheel - MysteryMart</title>
<script src="https://cdn.tailwindcss.com"></script>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
<style>
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600;700;800&display=swap');
* {
font-family: 'Poppins', sans-serif;
}
.wheel-container {
position: relative;
width: 400px;
height: 400px;
margin: 0 auto;
}
#wheel {
width: 100%;
height: 100%;
border-radius: 50%;
position: relative;
overflow: hidden;
box-shadow: 0 0 0 10px #FFD700, 0 0 20px rgba(255, 215, 0, 0.5);
transform: rotate(0deg);
transition: transform 4s cubic-bezier(.17,.67,.83,.67);
background: #1f003a;
}
.segment {
position: absolute;
width: 50%;
height: 50%;
top: 50%;
left: 50%;
transform-origin: 0% 0%;
display: flex;
align-items: center;
justify-content: flex-end;
padding-right: 30px;
font-size: 1rem;
font-weight: bold;
color: #fff;
text-shadow: 1px 1px 3px rgba(0,0,0,0.7);
}
.pointer-container {
position: absolute;
top: -25px;
left: 50%;
transform: translateX(-50%);
z-index: 20;
display: flex;
flex-direction: column;
align-items: center;
}
#pointer {
width: 0;
height: 0;
border-left: 25px solid transparent;
border-right: 25px solid transparent;
border-top: 40px solid #FFD700;
filter: drop-shadow(0px 2px 3px rgba(0,0,0,0.3));
}
.pointer-base {
width: 50px;
height: 25px;
background: #FFD700;
border-radius: 50% 50% 0 0;
}
.confetti {
position: absolute;
width: 15px;
height: 15px;
opacity: 0;
z-index: 100;
}
@keyframes pulse {
0% { transform: scale(1); }
50% { transform: scale(1.05); }
100% { transform: scale(1); }
}
.pulse {
animation: pulse 0.5s infinite;
}
.stop-pulse {
animation: none;
}
.segment-icon {
font-size: 1.5rem;
margin-right: 5px;
}
</style>
</head>
<body class="bg-gradient-to-br from-purple-900 via-indigo-900 to-blue-900 min-h-screen flex flex-col items-center justify-start py-10 px-4">
<!-- Header -->
<header class="w-full max-w-4xl flex justify-between items-center mb-8">
<div class="flex items-center space-x-2">
<div class="w-10 h-10 rounded-full bg-yellow-400 flex items-center justify-center">
<i class="fas fa-gift text-purple-900 text-xl"></i>
</div>
<h1 class="text-2xl font-bold text-white">MysteryMart</h1>
</div>
<div class="flex space-x-4">
<button class="bg-purple-700 hover:bg-purple-600 text-white px-4 py-2 rounded-lg transition-all">
<i class="fas fa-user mr-2"></i>Login
</button>
<button class="bg-yellow-400 hover:bg-yellow-300 text-purple-900 px-4 py-2 rounded-lg transition-all">
<i class="fas fa-star mr-2"></i>Rewards
</button>
</div>
</header>
<!-- Main Content -->
<main class="flex flex-col items-center w-full max-w-6xl">
<!-- Heading -->
<div class="text-center mb-10">
<h1 class="text-4xl md:text-5xl font-extrabold text-transparent bg-clip-text bg-gradient-to-r from-yellow-300 via-yellow-400 to-yellow-500 mb-4">
🎡 Spin & Win Rewards!
</h1>
<p class="text-lg text-purple-100 text-center max-w-2xl mb-6">
Test your luck! Spin the wheel and grab amazing rewards.
Every user gets <span class="font-bold text-yellow-300">1 free spin per day</span>!
</p>
<div class="bg-purple-800 bg-opacity-50 rounded-xl p-4 inline-flex items-center space-x-2">
<div class="w-8 h-8 rounded-full bg-yellow-400 flex items-center justify-center">
<i class="fas fa-coins text-purple-900"></i>
</div>
<p class="text-white">Your spins: <span class="font-bold text-yellow-400">1</span></p>
</div>
</div>
<div class="flex flex-col md:flex-row items-center justify-center w-full gap-10">
<!-- Wheel Container -->
<div class="wheel-container">
<div class="pointer-container">
<div id="pointer"></div>
<div class="pointer-base"></div>
</div>
<div id="wheel">
<!-- Segments -->
<div class="segment bg-gradient-to-br from-yellow-500 to-yellow-600 rotate-[0deg]">
<i class="segment-icon fas fa-tag"></i> ₹100 OFF
</div>
<div class="segment bg-gradient-to-br from-pink-500 to-pink-600 rotate-[60deg]">
<i class="segment-icon fas fa-gift"></i> Free Box
</div>
<div class="segment bg-gradient-to-br from-blue-500 to-blue-600 rotate-[120deg]">
<i class="segment-icon fas fa-percent"></i> 5% OFF
</div>
<div class="segment bg-gradient-to-br from-gray-500 to-gray-600 rotate-[180deg]">
<i class="segment-icon fas fa-redo"></i> Try Again
</div>
<div class="segment bg-gradient-to-br from-orange-500 to-orange-600 rotate-[240deg]">
<i class="segment-icon fas fa-percent"></i> 10% OFF
</div>
<div class="segment bg-gradient-to-br from-red-500 to-red-600 rotate-[300deg]">
<i class="segment-icon fas fa-tag"></i> ₹200 OFF
</div>
</div>
<!-- Decorative outer circle -->
<div class="absolute -inset-4 border-4 border-yellow-400 border-opacity-40 rounded-full z-0"></div>
<div class="absolute -inset-6 border-4 border-yellow-400 border-opacity-20 rounded-full z-0"></div>
</div>
<!-- Rewards Panel -->
<div class="bg-gradient-to-b from-purple-800 to-indigo-900 rounded-2xl p-6 shadow-xl w-full max-w-md">
<h2 class="text-2xl font-bold text-yellow-300 mb-6 text-center">Your Rewards</h2>
<div class="space-y-4 mb-8">
<div class="flex items-center justify-between p-4 bg-purple-700 bg-opacity-50 rounded-xl">
<div class="flex items-center space-x-3">
<div class="w-10 h-10 rounded-full bg-yellow-400 flex items-center justify-center">
<i class="fas fa-tag text-purple-900"></i>
</div>
<div>
<p class="text-white font-medium">Discount Coupons</p>
<p class="text-purple-200 text-sm">3 active</p>
</div>
</div>
<button class="text-yellow-400 hover:text-yellow-300">
<i class="fas fa-chevron-right"></i>
</button>
</div>
<div class="flex items-center justify-between p-4 bg-purple-700 bg-opacity-50 rounded-xl">
<div class="flex items-center space-x-3">
<div class="w-10 h-10 rounded-full bg-green-400 flex items-center justify-center">
<i class="fas fa-gift text-purple-900"></i>
</div>
<div>
<p class="text-white font-medium">Free Mystery Boxes</p>
<p class="text-purple-200 text-sm">1 available</p>
</div>
</div>
<button class="text-yellow-400 hover:text-yellow-300">
<i class="fas fa-chevron-right"></i>
</button>
</div>
</div>
<div class="bg-purple-900 bg-opacity-60 rounded-xl p-4">
<h3 class="text-yellow-400 font-bold mb-2">Today's Special</h3>
<p class="text-purple-200 text-sm">Spin now for double rewards chance!</p>
</div>
</div>
</div>
<!-- Spin Button -->
<button id="spinBtn"
class="mt-12 px-12 py-5 bg-gradient-to-r from-yellow-400 to-yellow-500 hover:from-yellow-500 hover:to-yellow-600 text-purple-900 text-xl font-extrabold rounded-full shadow-lg transform hover:scale-105 transition-all duration-300 pulse">
<i class="fas fa-sync-alt mr-3"></i> SPIN NOW
</button>
<!-- Result -->
<div id="result" class="mt-8 p-6 bg-gradient-to-r from-purple-700 to-indigo-800 rounded-2xl shadow-xl max-w-md text-center hidden">
<div class="w-16 h-16 rounded-full bg-green-400 flex items-center justify-center mx-auto mb-4">
<i class="fas fa-trophy text-white text-2xl"></i>
</div>
<h3 class="text-2xl font-bold text-white mb-2">Congratulations!</h3>
<p class="text-purple-100">You've won: <span id="prizeText" class="text-yellow-400 font-bold text-xl"></span></p>
<button class="mt-4 px-6 py-2 bg-white bg-opacity-20 text-white rounded-full hover:bg-opacity-30 transition">
Claim Reward
</button>
</div>
</main>
<!-- Info / FAQ -->
<div class="mt-16 max-w-3xl text-center text-white/80">
<h2 class="text-2xl font-bold text-yellow-300 mb-6">✨ How it works</h2>
<div class="grid grid-cols-1 md:grid-cols-2 gap-6 text-left">
<div class="bg-purple-800 bg-opacity-40 p-5 rounded-xl">
<div class="w-12 h-12 rounded-full bg-yellow-400 flex items-center justify-center mb-3 mx-auto">
<i class="fas fa-sign-in-alt text-purple-900"></i>
</div>
<h3 class="font-semibold text-white mb-2 text-center">Login Daily</h3>
<p class="text-purple-200 text-sm">Log in to your MysteryMart account to get your free daily spin</p>
</div>
<div class="bg-purple-800 bg-opacity-40 p-5 rounded-xl">
<div class="w-12 h-12 rounded-full bg-yellow-400 flex items-center justify-center mb-3 mx-auto">
<i class="fas fa-ticket-alt text-purple-900"></i>
</div>
<h3 class="font-semibold text-white mb-2 text-center">Instant Rewards</h3>
<p class="text-purple-200 text-sm">Your reward will be automatically added to your wallet or coupons</p>
</div>
<div class="bg-purple-800 bg-opacity-40 p-5 rounded-xl">
<div class="w-12 h-12 rounded-full bg-yellow-400 flex items-center justify-center mb-3 mx-auto">
<i class="fas fa-share-alt text-purple-900"></i>
</div>
<h3 class="font-semibold text-white mb-2 text-center">Share & Earn</h3>
<p class="text-purple-200 text-sm">Share your win with friends to earn extra spins</p>
</div>
<div class="bg-purple-800 bg-opacity-40 p-5 rounded-xl">
<div class="w-12 h-12 rounded-full bg-yellow-400 flex items-center justify-center mb-3 mx-auto">
<i class="fas fa-calendar-alt text-purple-900"></i>
</div>
<h3 class="font-semibold text-white mb-2 text-center">Daily Bonuses</h3>
<p class="text-purple-200 text-sm">Come back every day for bigger rewards and special bonuses</p>
</div>
</div>
</div>
<!-- Confetti elements -->
<div id="confetti-container" class="fixed inset-0 pointer-events-none z-50 overflow-hidden"></div>
<script>
const wheel = document.getElementById("wheel");
const btn = document.getElementById("spinBtn");
const result = document.getElementById("result");
const prizeText = document.getElementById("prizeText");
const confettiContainer = document.getElementById("confetti-container");
let currentRotation = 0;
let isSpinning = false;
// Create confetti elements
function createConfetti() {
confettiContainer.innerHTML = '';
const colors = ['#FFD700', '#FF4136', '#0074D9', '#2ECC40', '#B10DC9', '#FF851B'];
for (let i = 0; i < 100; i++) {
const confetti = document.createElement('div');
confetti.className = 'confetti';
confetti.style.left = Math.random() * 100 + 'vw';
confetti.style.top = '-20px';
confetti.style.backgroundColor = colors[Math.floor(Math.random() * colors.length)];
confetti.style.width = (Math.random() * 15 + 5) + 'px';
confetti.style.height = (Math.random() * 15 + 5) + 'px';
confetti.style.borderRadius = Math.random() > 0.5 ? '50%' : '0';
confettiContainer.appendChild(confetti);
// Animate confetti
setTimeout(() => {
confetti.style.transition = `top ${Math.random() * 2 + 2}s linear, left ${Math.random() * 1 + 1}s ease-in-out, opacity ${Math.random() * 1 + 1}s ease-in`;
confetti.style.opacity = '1';
confetti.style.top = '100vh';
confetti.style.left = (parseFloat(confetti.style.left) + (Math.random() * 200 - 100)) + 'px';
setTimeout(() => {
confetti.style.opacity = '0';
}, 2000);
}, i * 30);
}
}
btn.addEventListener("click", () => {
if (isSpinning) return;
isSpinning = true;
// Remove pulse animation during spin
btn.classList.remove('pulse');
// Hide previous result
result.classList.add('hidden');
// Spin at least 3 turns (1080 deg) + random within 360
const spinDegrees = 1080 + Math.floor(Math.random() * 360);
currentRotation += spinDegrees;
wheel.style.transition = "transform 4s cubic-bezier(.17,.67,.83,.67)";
wheel.style.transform = `rotate(${currentRotation}deg)`;
setTimeout(() => {
// Get where we landed (0-360)
const normalized = currentRotation % 360;
let prize = "";
if (normalized >= 0 && normalized < 60) prize = "₹100 OFF";
else if (normalized >= 60 && normalized < 120) prize = "Free Box 🎁";
else if (normalized >= 120 && normalized < 180) prize = "5% OFF";
else if (normalized >= 180 && normalized < 240) prize = "Try Again 😢";
else if (normalized >= 240 && normalized < 300) prize = "10% OFF";
else prize = "₹200 OFF";
// Show result
prizeText.innerText = prize;
result.classList.remove('hidden');
// Add celebration for wins (not for Try Again)
if (!prize.includes("Try Again")) {
createConfetti();
}
// Restore pulse animation
setTimeout(() => {
btn.classList.add('pulse');
}, 500);
isSpinning = false;
}, 4200);
});
</script>
</body>
</html> |