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

CALINGACION: chessboard flex & grid project #69

Open
wants to merge 9 commits into
base: main
Choose a base branch
from
Open
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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
48 changes: 48 additions & 0 deletions calingacion-chester-garett/chessboard/flex/assets/css/main.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
body{
background-color: rgba(194, 162, 162, 0.575)
}

.chessboard{
border: 2px solid black;
box-sizing: content-box;
display: flex;
flex-direction: column;
height: 50vw;
margin: 0 auto;
width: 50vw;
}

.row{
display: flex;
flex: 1;
flex-direction: row;
}


.white-box{
background-color: white;
flex: 1;
font-size: 4vw;
justify-content: center;
}

.black-box{
background-color: #287728c2;
flex: 1;
font-size: 4vw;
}

.player1{
color: #fcc4a4d7;
filter: brightness(100%);
}

.player2{
color: black;
}

span{
margin-left: 18%;
}


14 changes: 14 additions & 0 deletions calingacion-chester-garett/chessboard/flex/assets/js/main.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
const board=document.querySelector(".board");
const boardletters=document.querySelector(".letters");
const boardnumbers=document.querySelector(".numbers");
let letters=["a","b","c","d","e","f","g","h"]
let index = 0;
let black = false;
let num = 1;


for (let i=0;i<8; i++){
let letter=document.createElement("li");
letter.textContent = letters[i];
boardletters.appendChild(letter);
}
102 changes: 102 additions & 0 deletions calingacion-chester-garett/chessboard/flex/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
<!DOCTYPE html>
<html lang='en'>
<head>
<meta charset="UTF-8">
<meta name='viewport' content='width-device-width, initial-scale-1.0'>
<title>Chess Board</title>
<link rel='stylesheet' type='text/css' href='assets/css/main.css'>
</head>
<body>

<div class="chessboard">
<div class="row">
<div class="white-box"><span class='player1'>&#9820;</span></div>
<div class="black-box"><span class='player1'>&#9822;</span></div>
<div class="white-box"><span class='player1'>&#9821;</span></div>
<div class="black-box"><span class='player1'>&#9819;</span></div>
<div class="white-box"><span class='player1'>&#9818;</span></div>
<div class="black-box"><span class='player1'>&#9821;</span></div>
<div class="white-box"></div>
<div class="black-box"><span class='player1'>&#9820;</span></div>
</div>

<div class="row">
<div class="black-box"><span class='player1'>&#9823;</span></div>
<div class="white-box"><span class='player1'>&#9823;</span></div>
<div class="black-box"><span class='player1'>&#9823;</span></div>
<div class="white-box"></div>
<div class="black-box"><span class='player1'>&#9823;</span></div>
<div class="white-box"><span class='player1'>&#9823;</span></div>
<div class="black-box"></div>
<div class="white-box"><span class='player1'>&#9823;</span></div>
</div>

<div class="row">
<div class="white-box"></div>
<div class="black-box"></div>
<div class="white-box"></div>
<div class="black-box"><span class='player1'>&#9823;</span></div>
<div class="white-box"></div>
<div class="black-box"><span class='player1'>&#9822;</span></div>
<div class="white-box"><span class='player1'>&#9823;</span></div>
<div class="black-box"></div>
</div>

<div class="row">
<div class="black-box"></div>
<div class="white-box"></div>
<div class="black-box"></div>
<div class="white-box"></div>
<div class="black-box"></div>
<div class="white-box"></div>
<div class="black-box"></div>
<div class="white-box"><span class='player2'>&#9819;</span></div>
</div>

<div class="row">
<div class="white-box"></div>
<div class="black-box"></div>
<div class="white-box"><span class='player2'>&#9821;</span></div>
<div class="black-box"></div>
<div class="white-box"><span class='player2'>&#9823;</span></div>
<div class="black-box"></div>
<div class="white-box"></div>
<div class="black-box"></div>
</div>

<div class="row">
<div class="black-box"></div>
<div class="white-box"></div>
<div class="black-box"></div>
<div class="white-box"></div>
<div class="black-box"></div>
<div class="white-box"></div>
<div class="black-box"></div>
<div class="white-box"></div>
</div>

<div class="row">
<div class="white-box"><span class='player2'>&#9823;</span></div>
<div class="black-box"><span class='player2'>&#9823;</span></div>
<div class="white-box"><span class='player2'>&#9823;</span></div>
<div class="black-box"><span class='player2'>&#9823;</span></div>
<div class="white-box"></div>
<div class="black-box"><span class='player2'>&#9823;</span></div>
<div class="white-box"><span class='player2'>&#9823;</span></div>
<div class="black-box"><span class='player2'>&#9823;</span></div>
</div>

<div class="row">
<div class="black-box"><span class='player2'>&#9820;</span></div>
<div class="white-box"><span class='player2'>&#9822;</span></div>
<div class="black-box"><span class='player2'>&#9821;</span></div>
<div class="white-box"></div>
<div class="black-box"><span class='player2'>&#9818;</span></div>
<div class="white-box"></div>
<div class="black-box"><span class='player2'>&#9822;</span></div>
<div class="white-box"><span class='player2'>&#9820;</span></div>
</div>
</div>

</body>
</html>
69 changes: 69 additions & 0 deletions calingacion-chester-garett/chessboard/grid/assets/css/main.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
body {
margin: 40px;
background-color: rgba(194, 162, 162, 0.575);
}
.wrapper {
border: 1px solid rgba(255, 255, 255, 0.452);
width: 560px;
margin: 0 auto;
display: grid;
grid-gap: 0;
grid-template-columns: repeat(8, 70px);
grid-template-rows: 40px repeat(8, 70px) 40px;
grid-auto-flow: row;
}

.box {
padding: 0;
font-size: 3vw;
background-color: white;
color: #000;
text-align: center;
}

.top,
.bottom{
display: grid;
align-items: stretch;
background-color: #7d694c7a;
}
.top {
grid-column-start: 1;
grid-column-end: 9;
grid-row-start: 1;
grid-row-end: 1;
}
.bottom {
grid-column-start: 1;
grid-column-end: 9;
grid-row-start: 10;
grid-row-end: 10;
}


.box:nth-child(-2n+9),
.box:nth-child(9) ~ div:nth-child(-2n+16),
.box:nth-child(17) ~ div:nth-child(-2n+25),
.box:nth-child(25) ~ div:nth-child(-2n+32),
.box:nth-child(33) ~ div:nth-child(-2n+41),
.box:nth-child(41) ~ div:nth-child(-2n+48),
.box:nth-child(49) ~ div:nth-child(-2n+57),
.box:nth-child(57) ~ div:nth-child(-2n+64){
background-color: #287728c2;
color: #fff;
}

.player1{
color: #fcc4a4d7;
filter: brightness(100%);
}

.player2{
color: black;
}

span{
margin-left: 18%;
}


90 changes: 90 additions & 0 deletions calingacion-chester-garett/chessboard/grid/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Chess</title>
<link rel='stylesheet' type='text/css' href='assets/css/main.css'>
</head>
<body>
<div class="wrapper">
<div class='top'>

</div>
<div class="box"><span class='player1'>&#9820;</span></div>
<div class="box"><span class='player1'>&#9822;</span></div>
<div class="box"><span class='player1'>&#9821;</span></div>
<div class="box"><span class='player1'>&#9819;</span></div>
<div class="box"><span class='player1'>&#9818;</span></div>
<div class="box"><span class='player1'>&#9821;</span></div>
<div class="box"></div>
<div class="box"><span class='player1'>&#9820;</span></div>

<div class="box"><span class='player1'>&#9823;</span></div>
<div class="box"><span class='player1'>&#9823;</span></div>
<div class="box"><span class='player1'>&#9823;</span></div>
<div class="box"></div>
<div class="box"><span class='player1'>&#9823;</span></div>
<div class="box"><span class='player1'>&#9823;</span></div>
<div class="box"></div>
<div class="box"><span class='player1'>&#9823;</span></div>

<div class="box"></div>
<div class="box"></div>
<div class="box"></div>
<div class="box"><span class='player1'>&#9823;</span></div>
<div class="box"></div>
<div class="box"><span class='player1'>&#9822;</span></div>
<div class="box"><span class='player1'>&#9823;</span></div>
<div class="box"></div>

<div class="box"></div>
<div class="box"></div>
<div class="box"></div>
<div class="box"></div>
<div class="box"></div>
<div class="box"></div>
<div class="box"></div>
<div class="box"><span class='player2'>&#9819;</span></div>

<div class="box"></div>
<div class="box"></div>
<div class="box"><span class='player2'>&#9821;</span></div>
<div class="box"></div>
<div class="box"><span class='player2'>&#9823;</span></div>
<div class="box"></div>
<div class="box"></div>
<div class="box"></div>

<div class="box"></div>
<div class="box"></div>
<div class="box"></div>
<div class="box"></div>
<div class="box"></div>
<div class="box"></div>
<div class="box"></div>
<div class="box"></div>

<div class="box"><span class='player2'>&#9823;</span></div>
<div class="box"><span class='player2'>&#9823;</span></div>
<div class="box"><span class='player2'>&#9823;</span></div>
<div class="box"><span class='player2'>&#9823;</span></div>
<div class="box"></div>
<div class="box"><span class='player2'>&#9823;</span></div>
<div class="box"><span class='player2'>&#9823;</span></div>
<div class="box"><span class='player2'>&#9823;</span></div>

<div class="box"><span class='player2'>&#9820;</span></div>
<div class="box"><span class='player2'>&#9822;</span></div>
<div class="box"><span class='player2'>&#9821;</span></div>
<div class="box"></div>
<div class="box"><span class='player2'>&#9818;</span></div>
<div class="box"></div>
<div class="box"><span class='player2'>&#9822;</span></div>
<div class="box"><span class='player2'>&#9820;</span></div>
<div class='bottom'>

</div>

</div>
</body>
</html>
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading