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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<!DOCTYPE html>
|
2 |
+
<html>
|
3 |
+
<head>
|
4 |
+
<title>Colorful Lucky Roulette</title>
|
5 |
+
<style>
|
6 |
+
body {
|
7 |
+
background: #1c1c1c;
|
8 |
+
display: flex;
|
9 |
+
justify-content: center;
|
10 |
+
align-items: center;
|
11 |
+
min-height: 100vh;
|
12 |
+
margin: 0;
|
13 |
+
font-family: 'Arial', sans-serif;
|
14 |
+
}
|
15 |
+
|
16 |
+
#roulette-container {
|
17 |
+
position: relative;
|
18 |
+
width: 500px;
|
19 |
+
height: 500px;
|
20 |
+
perspective: 1000px;
|
21 |
+
}
|
22 |
+
|
23 |
+
.roulette {
|
24 |
+
width: 100%;
|
25 |
+
height: 100%;
|
26 |
+
border-radius: 50%;
|
27 |
+
position: relative;
|
28 |
+
border: 15px solid #ffd700;
|
29 |
+
box-shadow:
|
30 |
+
0 0 30px rgba(255, 215, 0, 0.3),
|
31 |
+
inset 0 0 50px rgba(0,0,0,0.5);
|
32 |
+
transition: transform 4s cubic-bezier(0.17, 0.67, 0.12, 0.99);
|
33 |
+
background: conic-gradient(
|
34 |
+
#ff6b6b, #4ecdc4, #45b7d1, #96c93d,
|
35 |
+
#e056fd, #f7d794, #ff7675, #74b9ff,
|
36 |
+
#a8e6cf, #fdcb6e, #4834d4, #6c5ce7
|
37 |
+
);
|
38 |
+
}
|
39 |
+
|
40 |
+
.segment {
|
41 |
+
position: absolute;
|
42 |
+
width: 50%;
|
43 |
+
height: 2px;
|
44 |
+
top: 50%;
|
45 |
+
left: 50%;
|
46 |
+
transform-origin: left;
|
47 |
+
background: rgba(255,255,255,0.8);
|
48 |
+
box-shadow: 0 0 5px rgba(255,255,255,0.5);
|
49 |
+
}
|
50 |
+
|
51 |
+
.number {
|
52 |
+
position: absolute;
|
53 |
+
width: 45px;
|
54 |
+
height: 45px;
|
55 |
+
background: rgba(255,255,255,0.95);
|
56 |
+
border-radius: 50%;
|
57 |
+
display: flex;
|
58 |
+
align-items: center;
|
59 |
+
justify-content: center;
|
60 |
+
font-weight: bold;
|
61 |
+
font-size: 18px;
|
62 |
+
transform-origin: center;
|
63 |
+
border: 2px solid #ffd700;
|
64 |
+
box-shadow: 0 0 10px rgba(0,0,0,0.3);
|
65 |
+
color: #222;
|
66 |
+
}
|
67 |
+
|
68 |
+
.prize {
|
69 |
+
position: absolute;
|
70 |
+
color: #fff;
|
71 |
+
transform-origin: center;
|
72 |
+
font-size: 14px;
|
73 |
+
font-weight: bold;
|
74 |
+
text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
|
75 |
+
white-space: nowrap;
|
76 |
+
background: rgba(0,0,0,0.4);
|
77 |
+
padding: 3px 8px;
|
78 |
+
border-radius: 15px;
|
79 |
+
}
|
80 |
+
|
81 |
+
.arrow {
|
82 |
+
position: absolute;
|
83 |
+
top: -40px;
|
84 |
+
left: 50%;
|
85 |
+
transform: translateX(-50%);
|
86 |
+
width: 0;
|
87 |
+
height: 0;
|
88 |
+
border-left: 25px solid transparent;
|
89 |
+
border-right: 25px solid transparent;
|
90 |
+
border-top: 40px solid #ffd700;
|
91 |
+
filter: drop-shadow(0 0 10px rgba(255,215,0,0.5));
|
92 |
+
}
|
93 |
+
|
94 |
+
#shoot-btn {
|
95 |
+
position: absolute;
|
96 |
+
bottom: -80px;
|
97 |
+
left: 50%;
|
98 |
+
transform: translateX(-50%);
|
99 |
+
padding: 15px 40px;
|
100 |
+
font-size: 22px;
|
101 |
+
background: linear-gradient(45deg, #ffd700, #ffeb3b);
|
102 |
+
color: #222;
|
103 |
+
border: none;
|
104 |
+
border-radius: 25px;
|
105 |
+
cursor: pointer;
|
106 |
+
transition: all 0.3s;
|
107 |
+
font-weight: bold;
|
108 |
+
box-shadow: 0 5px 15px rgba(255,215,0,0.3);
|
109 |
+
}
|
110 |
+
|
111 |
+
#shoot-btn:hover {
|
112 |
+
transform: translateX(-50%) scale(1.05);
|
113 |
+
box-shadow: 0 7px 20px rgba(255,215,0,0.4);
|
114 |
+
}
|
115 |
+
|
116 |
+
#result {
|
117 |
+
position: absolute;
|
118 |
+
top: -80px;
|
119 |
+
left: 0;
|
120 |
+
width: 100%;
|
121 |
+
text-align: center;
|
122 |
+
color: #ffd700;
|
123 |
+
font-size: 28px;
|
124 |
+
font-weight: bold;
|
125 |
+
opacity: 0;
|
126 |
+
transition: opacity 0.3s;
|
127 |
+
text-shadow: 0 0 10px rgba(255,215,0,0.5);
|
128 |
+
}
|
129 |
+
|
130 |
+
#result.show {
|
131 |
+
opacity: 1;
|
132 |
+
}
|
133 |
+
|
134 |
+
.center-dot {
|
135 |
+
position: absolute;
|
136 |
+
top: 50%;
|
137 |
+
left: 50%;
|
138 |
+
width: 30px;
|
139 |
+
height: 30px;
|
140 |
+
background: #ffd700;
|
141 |
+
border-radius: 50%;
|
142 |
+
transform: translate(-50%, -50%);
|
143 |
+
box-shadow: 0 0 20px rgba(255,215,0,0.5);
|
144 |
+
}
|
145 |
+
|
146 |
+
.glow {
|
147 |
+
position: absolute;
|
148 |
+
top: -10px;
|
149 |
+
left: -10px;
|
150 |
+
right: -10px;
|
151 |
+
bottom: -10px;
|
152 |
+
border-radius: 50%;
|
153 |
+
background: transparent;
|
154 |
+
border: 2px solid rgba(255,215,0,0.3);
|
155 |
+
animation: glowPulse 2s infinite;
|
156 |
+
}
|
157 |
+
|
158 |
+
@keyframes glowPulse {
|
159 |
+
0% { transform: scale(1); opacity: 0.5; }
|
160 |
+
50% { transform: scale(1.05); opacity: 0.8; }
|
161 |
+
100% { transform: scale(1); opacity: 0.5; }
|
162 |
+
}
|
163 |
+
</style>
|
164 |
+
</head>
|
165 |
+
<body>
|
166 |
+
<div id="roulette-container">
|
167 |
+
<div id="result"></div>
|
168 |
+
<div class="arrow"></div>
|
169 |
+
<div class="roulette">
|
170 |
+
<div class="glow"></div>
|
171 |
+
<div class="center-dot"></div>
|
172 |
+
</div>
|
173 |
+
<button id="shoot-btn">SHOOT! π―</button>
|
174 |
+
</div>
|
175 |
+
|
176 |
+
<script>
|
177 |
+
const roulette = document.querySelector('.roulette');
|
178 |
+
const shootBtn = document.getElementById('shoot-btn');
|
179 |
+
const result = document.getElementById('result');
|
180 |
+
|
181 |
+
const numSegments = 12;
|
182 |
+
const prizes = [
|
183 |
+
'κ½ π', '1λ§μ π«', '3λ§μ β¨', '5λ§μ π',
|
184 |
+
'10λ§μ π', '20λ§μ π―', '30λ§μ π¨',
|
185 |
+
'40λ§μ π', '50λ§μ β', '70λ§μ π',
|
186 |
+
'90λ§μ π', '100λ§μ π'
|
187 |
+
];
|
188 |
+
let shuffledPrizes = [...prizes];
|
189 |
+
|
190 |
+
function shufflePrizes() {
|
191 |
+
shuffledPrizes = [...prizes];
|
192 |
+
for (let i = shuffledPrizes.length - 1; i > 0; i--) {
|
193 |
+
const j = Math.floor(Math.random() * (i + 1));
|
194 |
+
[shuffledPrizes[i], shuffledPrizes[j]] = [shuffledPrizes[j], shuffledPrizes[i]];
|
195 |
+
}
|
196 |
+
}
|
197 |
+
|
198 |
+
function createRouletteSegments() {
|
199 |
+
const radius = 220;
|
200 |
+
const angleIncrement = (2 * Math.PI) / numSegments;
|
201 |
+
|
202 |
+
for (let i = 0; i < numSegments; i++) {
|
203 |
+
const segment = document.createElement('div');
|
204 |
+
segment.className = 'segment';
|
205 |
+
segment.style.transform = `rotate(${i * (360 / numSegments)}deg)`;
|
206 |
+
roulette.appendChild(segment);
|
207 |
+
|
208 |
+
const number = document.createElement('div');
|
209 |
+
number.className = 'number';
|
210 |
+
number.textContent = i + 1;
|
211 |
+
const angle = i * angleIncrement;
|
212 |
+
const x = Math.cos(angle) * radius + 230;
|
213 |
+
const y = Math.sin(angle) * radius + 230;
|
214 |
+
number.style.left = `${x}px`;
|
215 |
+
number.style.top = `${y}px`;
|
216 |
+
roulette.appendChild(number);
|
217 |
+
|
218 |
+
const prize = document.createElement('div');
|
219 |
+
prize.className = 'prize';
|
220 |
+
prize.textContent = shuffledPrizes[i];
|
221 |
+
const prizeRadius = radius - 60;
|
222 |
+
const prizeX = Math.cos(angle) * prizeRadius + 230;
|
223 |
+
const prizeY = Math.sin(angle) * prizeRadius + 230;
|
224 |
+
prize.style.left = `${prizeX}px`;
|
225 |
+
prize.style.top = `${prizeY}px`;
|
226 |
+
prize.style.transform = `translate(-50%, -50%) rotate(${i * (360 / numSegments)}deg)`;
|
227 |
+
roulette.appendChild(prize);
|
228 |
+
}
|
229 |
+
}
|
230 |
+
|
231 |
+
let isSpinning = false;
|
232 |
+
let currentRotation = 0;
|
233 |
+
|
234 |
+
shufflePrizes();
|
235 |
+
createRouletteSegments();
|
236 |
+
|
237 |
+
shootBtn.addEventListener('click', () => {
|
238 |
+
if (isSpinning) return;
|
239 |
+
|
240 |
+
isSpinning = true;
|
241 |
+
result.classList.remove('show');
|
242 |
+
shootBtn.style.opacity = '0.5';
|
243 |
+
shootBtn.style.cursor = 'not-allowed';
|
244 |
+
|
245 |
+
const randomSegment = Math.floor(Math.random() * numSegments);
|
246 |
+
const segmentAngle = (360 / numSegments) * randomSegment;
|
247 |
+
const extraSpins = 720 + Math.random() * 720;
|
248 |
+
const totalRotation = extraSpins + segmentAngle;
|
249 |
+
|
250 |
+
currentRotation += totalRotation;
|
251 |
+
roulette.style.transform = `rotate(${currentRotation}deg)`;
|
252 |
+
|
253 |
+
setTimeout(() => {
|
254 |
+
isSpinning = false;
|
255 |
+
result.textContent = `π ${randomSegment + 1}λ²: ${shuffledPrizes[randomSegment]} π`;
|
256 |
+
result.classList.add('show');
|
257 |
+
shootBtn.style.opacity = '1';
|
258 |
+
shootBtn.style.cursor = 'pointer';
|
259 |
+
}, 4000);
|
260 |
+
});
|
261 |
+
|
262 |
+
let baseRotation = 0;
|
263 |
+
function animate() {
|
264 |
+
if (!isSpinning) {
|
265 |
+
baseRotation += 0.2;
|
266 |
+
roulette.style.transform = `rotate(${baseRotation}deg)`;
|
267 |
+
}
|
268 |
+
requestAnimationFrame(animate);
|
269 |
+
}
|
270 |
+
animate();
|
271 |
+
</script>
|
272 |
+
</body>
|
273 |
+
</html>
|