<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Roulette Game - My Casino</title>
<style>
body {
font-family: Arial, sans-serif;
}
#roulette-container {
text-align: center;
margin-top: 20px;
}
#roulette-wheel {
width: 200px;
height: 200px;
background-image: url('roulette-wheel.png');
background-size: cover;
margin: 0 auto;
transition: transform 4s ease-out;
}
#result {
font-size: 24px;
margin-top: 10px;
}
#spin-button {
padding: 10px;
font-size: 16px;
cursor: pointer;
}
</style>
</head>
<body>
<header>
<h1>Welcome to My Casino</h1>
</header>
<nav>
<a href="#">Home</a>
<a href="#" onclick="showGames()">Games</a>
<a href="#">Promotions</a>
<a href="#">Contact</a>
</nav>
<section id="games-section" style="display: none;">
<h2>Choose a Game</h2>
<ul class="game-list">
<li onclick="playGame('Slot Machine')">Slot Machine</li>
<li onclick="playGame('Blackjack')">Blackjack</li>
<li onclick="playRoulette()">Roulette</li>
</ul>
</section>
<section id="roulette-container" style="display: none;">
<h2>Roulette Game</h2>
<div id="roulette-wheel"></div>
<button id="spin-button" onclick="spinRoulette()">Spin</button>
<p id="result"></p>
</section>
<footer>
© 2023 My Casino. All rights reserved.
</footer>
<script>
function showGames() {
var gamesSection = document.getElementById('games-section');
gamesSection.style.display = (gamesSection.style.display === 'none') ? 'block' : 'none';
}
function playGame(gameName) {
alert('Launching ' + gameName + '!');
}
function playRoulette() {
var rouletteContainer = document.getElementById('roulette-container');
rouletteContainer.style.display = 'block';
}
function spinRoulette() {
var resultElement = document.getElementById('result');
var rouletteWheel = document.getElementById('roulette-wheel');
var randomRotation = Math.floor(Math.random() * 360) + 720;
resultElement.textContent = '';
rouletteWheel.style.transition = 'transform 4s ease-out';
rouletteWheel.style.transform = 'rotate(' + randomRotation + 'deg)';
setTimeout(function () {
rouletteWheel.style.transition = 'none';
var result = Math.floor(randomRotation % 360 / 10);
resultElement.textContent = 'Result: ' + result;
}, 4000);
}
</script>
</body>
</html>