Files
BroCodeJS/MiniProjects/RockPaperScissors/game.html
2024-10-24 13:05:05 +02:00

105 lines
2.7 KiB
HTML

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<style>
body {
background-color: grey;
}
.title {
text-align: center;
margin-bottom: 10vh;
text-decoration: underline;
color: aqua;
font-family: 'Lucida Sans', 'Lucida Sans Regular', 'Lucida Grande', 'Lucida Sans Unicode', Geneva, Verdana, sans-serif;
font-size: 8ch;
text-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
text-transform: uppercase;
}
#images {
width: fit-content;
height: 150px;
margin: auto;
}
img {
width: 150px;
height: 150px;
border-radius: 50%;
margin: 10px;
display: inline-block;
box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
transition: transform 0.3s;
float: left;
}
img:hover {
transform: scale(1.1);
cursor: pointer;
}
#choises, #scores {
width: fit-content;
margin: 5vh auto;
}
h2 {
color: aqua;
display: inline-block;
}
.score {
font-weight: bold;
color: yellow;
font-size: 1.2em;
margin-left: 10px;
margin-right: 20px;
}
#winner h1{
font-size: 7ch;
color: gold;
text-align: center;
font-family: 'Arial Black', sans-serif;
text-shadow: 0 0 20px rgba(255, 223, 0, 0.8), 0 0 30px rgba(255, 165, 0, 0.6);
animation: glow 3s ease-in-out infinite alternate;
margin-top: 1vh;
margin-bottom: 0;
}
@keyframes glow {
from {
text-shadow: 0 0 20px rgba(255, 223, 0, 0.8), 0 0 30px rgba(255, 165, 0, 0.6);
}
to {
text-shadow: 0 0 50px rgba(255, 223, 0, 1), 0 0 60px rgba(255, 165, 0, 1);
}
}
</style>
<body>
<h1 class="title">Rock Paper Scissors</h1>
<div id="images">
<img src="rock.jpg" onclick="play('0')" alt="Rock">
<img src="paper.jpg" onclick="play('1')" alt="Paper">
<img src="scissors.jpg" onclick="play('2')" alt="Scissors">
</div>
<div id="choises">
<h2 id="">Your Choice:</h2>
<h2 id="yourchoice" class="score">-</h2><br>
<h2 id="">Computer Choice:</h2>
<h2 id="computerchoice" class="score">-</h2>
</div>
<div id="winner">
<h1 id="winnertext"></h1>
</div>
<div id="scores">
<h2 id="">Your Score:</h2>
<h2 id="yourscore" class="score">0</h2>
<h2 id="">Computer Score:</h2>
<h2 id="computerscore" class="score">0</h2>
</div>
<script src="script.js"></script>
</body>
</html>