🏆 結果: なし
```html
<!DOCTYPE html>
<html>
<head>
<style>
@keyframes spinAnimation {
from { transform: rotate(0deg); }
to { transform: rotate(360deg); }
}
@keyframes bounce {
0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
40% { transform: translateY(-30px); }
60% { transform: translateY(-15px); }
}
@keyframes glow {
0% { box-shadow: 0 0 5px rgba(255, 255, 0, 0.5); }
50% { box-shadow: 0 0 20px rgba(255, 255, 0, 1); }
100% { box-shadow: 0 0 5px rgba(255, 255, 0, 0.5); }
}
@keyframes tada {
0% { transform: scale(1); }
10% { transform: scale(0.9) rotate(-3deg); }
20% { transform: scale(1.1) rotate(3deg); }
30% { transform: scale(0.9) rotate(-3deg); }
40% { transform: scale(1.1) rotate(3deg); }
50% { transform: scale(1) rotate(0deg); }
100% { transform: scale(1) rotate(0deg); }
}
</style>
</head>
<body>
<div style="width: 400px; height: 400px; margin: 0 auto; position: relative; text-align: center; font-family: Arial, sans-serif;">
<canvas id="roulette" width="400" height="400" style="border: 2px solid #FFD700; border-radius: 50%;"></canvas>
<button id="spinButton" style="position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); padding: 10px 20px; font-size: 24px; cursor: pointer; background-color: #FF69B4; border: none; border-radius: 10px; animation: glow 2s infinite;">
🎰 スピン!
</button>
<div id="result" style="position: absolute; bottom: 10px; width: 100%; text-align: center; font-size: 24px; color: #32CD32;">
🏆 結果: なし
</div>
</div>
<script>
const canvas = document.getElementById('roulette');
const ctx = canvas.getContext('2d');
const spinButton = document.getElementById('spinButton');
const result = document.getElementById('result');
const items = [
'🍎', '🎈', '🚗', '🐶', '🌟', '🍕', '🎉', '🏀', '🎵', '🌈',
'🍩', '🚀', '📚', '🎁', '💡', '🍔', '🎬', '📱', '🕹️', '🎨'
];
const numSlices = items.length;
const sliceAngle = 2 * Math.PI / numSlices;
const colors = ['#FFCCCC','#CCFFCC','#CCCCFF','#FFFFCC','#FFCCFF','#CCFFFF','#FFD1DC','#D1FFFF','#FFC1C1','#C1FFC1','#C1C1FF','#FFF1C1'];
function drawRoulette() {
for(let i = 0; i < numSlices; i++) {
const startAngle = i * sliceAngle;
const endAngle = startAngle + sliceAngle;
ctx.beginPath();
ctx.moveTo(200, 200);
ctx.arc(200, 200, 200, startAngle, endAngle);
ctx.fillStyle = colors[i % colors.length];
ctx.fill();
ctx.strokeStyle = '#FFFFFF';
ctx.lineWidth = 2;
ctx.stroke();
// Draw emojis
ctx.save();
ctx.translate(200, 200);
ctx.rotate(startAngle + sliceAngle / 2);
ctx.textAlign = "right";
ctx.font = "24px Arial";
ctx.fillText(items[i], 180, 10);
ctx.restore();
}
// Pointer
ctx.beginPath();
ctx.moveTo(200, 0);
ctx.lineTo(220, 30);
ctx.lineTo(180, 30);
ctx.fillStyle = '#FF4500';
ctx.fill();
}
drawRoulette();
spinButton.addEventListener('click', () => {
spinButton.style.animation = 'none';
setTimeout(() => {
spinButton.style.animation = 'glow 2s infinite';
}, 10);
const rotation = Math.floor(Math.random() * 360) + 3600;
canvas.style.transition = 'transform 4s cubic-bezier(0.33, 1, 0.68, 1)';
canvas.style.transform = `rotate(${rotation}deg)`;
canvas.addEventListener('transitionend', () => {
const actualRotation = rotation % 360;
const selectedIndex = Math.floor(((360 - actualRotation + (sliceAngle * 180 / Math.PI)) % 360) / (360 / numSlices));
const selectedItem = items[selectedIndex];
result.textContent = `🏆 結果: ${selectedItem}`;
canvas.style.transition = 'none';
canvas.style.transform = `rotate(${actualRotation}deg)`;
}, { once: true });
});
</script>
</body>
</html>
```