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

Defined different themes more prominently #339

Merged
merged 1 commit into from
Jun 8, 2024
Merged
Show file tree
Hide file tree
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
79 changes: 47 additions & 32 deletions index.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<!DOCTYPE html>
<html lang="en">

<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
Expand All @@ -15,53 +16,66 @@

<title>Dots & Boxes Game</title>
</head>

<body>
<div class="settings">
<video autoplay muted class="video" loop id="myVideo">
<source src="./assets/default.mp4" type="video/mp4">
</video>

<div class="form">
<h1 class="heading">▂ ▄ ▅ ▆ ▇ █ MAXIMISE BOXES!! █ ▇ ▆ ▅ ▄ ▂</h1>

<h3 class="instructions-heading">Instructions</h3>
<div class="whole-background">
<div class="form">
<h1 class="heading">▂ ▄ ▅ ▆ ▇ █ MAXIMISE BOXES!! █ ▇ ▆ ▅ ▄ ▂</h1>

<p class="instructions">
1. Select the number of rows, columns and players. <br>
2. The player who has maximum number of boxes on board is the winner. <br>
3. Players will switch after every turn. But the player who has filled the last box, will get one extra
chance consecutively. <br>
</p>
</div>
<h3 class="instructions-heading">Instructions</h3>

<div class="form">
<div class="form-item">
<label for="theme-select">Select Theme:</label>
<select id="theme-select">
<option value="default">Default</option>
<option value="2">Theme 1</option>
<option value="3">Theme 2</option>
</select>
<p class="instructions">
1. Select the number of rows, columns and players. <br>
2. The player who has maximum number of boxes on board is the winner. <br>
3. Players will switch after every turn. But the player who has filled the last box, will get one extra
chance consecutively. <br>
</p>
</div>

<div class="form-item">
<label for="rows">Rows : <span class="details">(between 5 and 30)</span></label>
<input type="number" id="rows" min="5" max="30" value="6" />
</div>

<div class="form-item">
<label for="columns">Columns : <span class="details">(between 5 and 30)</span></label>
<input type="number" id="columns" min="5" max="30" value="6" />
</div>

<div class="form-item">
<label for="players-count">Players : <span class="details">(between 2 and 6)</span></label>
<input type="number" id="players-count" min="2" max="6" value="2" />
<div class="form">
<div class="right-background">
<div class="form-item">

<label for="theme-select">Select Theme:</label>
<select id="theme-select">
<option value="default">Default</option>
<option value="2">Theme 1</option>
<option value="3">Theme 2</option>
</select>
</div>

<div class="form-item">
<label for="rows">Rows : <span class="details">(between 5 and 30)</span></label>
<input type="number" id="rows" min="5" max="30" value="6" />
</div>
<br>

<div class="form-item">
<label for="columns">Columns : <span class="details">(between 5 and 30)</span></label>
<input type="number" id="columns" min="5" max="30" value="6" />
</div>
<br>

<div class="form-item">
<label for="players-count">Players : <span class="details">(between 2 and 6)</span></label>
<input type="number" id="players-count" min="2" max="6" value="2" />
</div>
<br>
<button class="start-btn">START</button>


</div>
</div>

<button class="start-btn">START</button>
</div>

<p class="author">
Created with ❤️ by <a target="_blank" href="#">Chrome Gaming</a>
</p>
Expand All @@ -88,4 +102,5 @@ <h3 class="instructions-heading">Instructions</h3>
</div>
</div>
</body>
</html>

</html>
25 changes: 25 additions & 0 deletions js/game.js
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,31 @@
const selectedTheme = themeSelect.value;
video.src = `./assets/${selectedTheme}.mp4`; // Update video source based on theme
video2.src = `./assets/${selectedTheme}.mp4`; // Update video source based on theme

var element=document.querySelector(".whole-background");
var element2=document.querySelector(".right-background");
var element3=document.querySelector(".score");


if(selectedTheme==2){
element.style.backgroundColor = "rgba(241, 41, 34, 0.957)";
element2.classList.remove('hover-effect-1','hover-effect-2', 'hover-effect-3');
element2.classList.add('hover-effect-2');
element3.style.backgroundColor = "rgba(241, 41, 34, 0.957)";

}
else if(selectedTheme==3){
element.style.backgroundColor = "rgba(79, 163, 221, 0.950)";
element2.classList.remove('hover-effect-1','hover-effect-2', 'hover-effect-3');
element2.classList.add('hover-effect-3');
element3.style.backgroundColor = "rgba(79, 163, 221, 0.950)";
}
else{
element.style.backgroundColor = "rgba(231, 181, 55, 0.979)";
element2.classList.remove('hover-effect-1','hover-effect-2', 'hover-effect-3');
element2.classList.add('hover-effect-1');
element3.style.backgroundColor = "rgba(231, 181, 55, 0.979)";
}
});


Expand Down
45 changes: 40 additions & 5 deletions style.css
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,7 @@ a {
max-width: 200px;
text-align: center;
border-radius: 1rem;
box-shadow:0px 1px 4px rgba(6, 6, 6, 0.829);
}

.player-turn .bg.win {
Expand Down Expand Up @@ -283,17 +284,20 @@ h1 {
.settings .form {
display: flex;
flex-direction: column;
gap: 1.4rem;
max-width: 550px;
justify-content: center;
max-width: 475px;
padding: 1rem;
font-size: 20px;
padding-left: 7%;
padding-left: 3%;
padding-right: 3%;
}

.settings .form-item {
display: flex;
flex-direction: column;
gap: 0.2rem;
width:260px;

}

.settings .form-item input {
Expand All @@ -306,7 +310,7 @@ h1 {

.settings .form-item .details {
font-style: italic;
color: #999;
color: #3e3e3e;
font-size: 15px;
}

Expand Down Expand Up @@ -366,10 +370,11 @@ h1 {


.score{
background-color: rgba(96, 87, 87, 0.822);
background-color: rgba(231, 181, 55, 0.979);
padding: 50px;
border: #111;
border-radius: 10px;
box-shadow:0px 5px 15px rgba(6, 6, 6, 0.829);
}

.flex{
Expand All @@ -396,3 +401,33 @@ h1 {
.flex-btn button:hover {
background: rgb(75, 75, 75);
}

.whole-background{
display:flex;
gap:1rem;
background-color: rgba(231, 181, 55, 0.979);
/*background-color: rgba(6, 159, 103, 0.957);*/
border-radius: 10px;
padding:10px 20px;
box-shadow:0px 5px 15px rgba(6, 6, 6, 0.829);
}
.right-background{
padding: 20px 50px;
border-radius:10px;
max-width: 350px;
transition:background-color 0.5s ease;
}

.right-background:hover{
background-color: rgba(236, 66, 109, 0.329);
}

.hover-effect-1:hover{
background-color: rgba(236, 66, 109, 0.329);
}
.hover-effect-2:hover{
background-color: rgba(218, 216, 219, 0.612);
}
.hover-effect-3:hover{
background-color: rgba(117, 214, 179, 0.817);
}
Loading