Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

addition of player name & image, timer #184

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
84 changes: 84 additions & 0 deletions player box & timer
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
<!DOCTYPE html>
<style>
body {
background-color: #000000;
}

.container {
width: 80%;
margin: 40px auto;
text-align: center;
}

.timer {
font-size: 36px;
font-weight: bold;
color: #0f0; /* green color */
margin-bottom: 20px;
}

.players {
display: flex;
justify-content: space-between;

}

.player {
width: 30%; /* decreased width to make room for Tic-Tac-Toe board */
margin: 20px 40px; /* added horizontal margin to create space between player boxes */
background-color: #fff; /* white background for boxes */
padding: 10px;
border-radius: 15%;
border: 1px solid #ddd;
height: 250px; /* increased height */
}

.player img {
width: 100%;
height: 100%; /* adjusted image height */
object-fit: cover;
border-radius: 15%;
border-color: rgb(44, 44, 44);
}

.name {
font-size: 18px;
color: #fff;
margin-top: 50px;
}
</style>
<html>
<head>
<title>Game Interface</title>
<link rel="stylesheet" href="style.css">
</head>
<body>
<div class="container">
<div class="timer" id="timer">10</div>
<div class="players">
<div class="player" id="player-1">
<img src="img1.jpg" alt="Image 1">
<div class="name">Player 1</div>
</div>
<div class="player" id="player-2">
<img src="img2.jpg" alt="Image 2">
<div class="name">Player 2</div>
</div>
</div>
</div>

<script src="next.js"></script>
</body>
</html>
<script>
let timer = 10;
let timerElement = document.getElementById('timer');

setInterval(() => {
timer--;
timerElement.textContent = timer;
if (timer <= 0) {
timer = 10; // reset timer to 10 seconds
}
}, 1000);
</script>