JSFiddle - React, Tailwind, and code Playground
by Sergey khorev
HTML
<div class="game-container">
<div class="game-title">Jump game</div>
<div class="game-character"></div>
<div class="platforms">
<div class="platform"></div>
<div class="platform"></div>
<div class="platform"></div>
<div class="platform"></div>
<div class="platform"></div>
</div>
<button class="play-button">Play</button>
</div>
CSS
.game-container {
position: relative;
width: 365px;
height: 146px;
background-color: #1d1d1d;
border-radius: 10px;
padding: 10px;
box-sizing: border-box;
display: flex;
justify-content: space-between;
align-items: center;
}
.game-title {
font-size: 24px;
color: white;
position: absolute;
top: 10px;
left: 10px;
}
.game-character {
width: 30px;
height: 30px;
background-color: white;
border-radius: 50%;
position: absolute;
left: 60px;
top: 50%;
transform: translateY(-50%);
background-image: url('path-to-your-ghost-image.png'); /* Установи путь к изображению привидения */
background-size: cover;
}
.platforms .platform {
width: 70px;
height: 10px;
background-color: white;
border-radius: 5px;
position: absolute;
}
.platforms .platform:nth-child(1) {
top: 10px;
left: 160px;
}
.platforms .platform:nth-child(2) {
top: 40px;
left: 230px;
}
.platforms .platform:nth-child(3) {
top: 70px;
left: 120px;
}
.platforms .platform:nth-child(4) {
top: 110px;
left: 50px;
}
.platforms .platform:nth-child(5) {
top: 130px;
left: 190px;
}
.play-button {
position: absolute;
right: 10px;
bottom: 10px;
background-color: #ffeb3b;
border: none;
border-radius: 15px;
padding: 5px 20px;
font-size: 16px;
color: black;
cursor