A Pen by Ken Haduch on CodePen.
Created
November 4, 2017 17:55
-
-
Save khaduch/e2c2e53ea397a7cbc2162688f00e22e6 to your computer and use it in GitHub Desktop.
tic-tac-toe sandbox
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- this is an experiment --> | |
<div class="container"> | |
<div class="text-center center-block"> | |
<div class="row text-center center-block"> | |
<div class="col-xs-4 grid-box top-row left-col" id="1"></div> | |
<div class="col-xs-4 grid-box top-row middle-col" id="2"></div> | |
<div class="col-xs-4 grid-box top-row right-col" id="3"></div> | |
</div> | |
<div class="row text-center center-block"> | |
<div class="col-xs-4 grid-box middle-row left-col" id="4"></div> | |
<div class="col-xs-4 grid-box middle-row middle-col" id="5"></div> | |
<div class="col-xs-4 grid-box middle-row right-col" id="6"></div> | |
</div> | |
<div class="row text-center center-block"> | |
<div class="col-xs-4 grid-box bottom-row left-col" id="7"></div> | |
<div class="col-xs-4 grid-box bottom-row middle-col" id="8"></div> | |
<div class="col-xs-4 grid-box bottom-row right-col" id="9"></div> | |
</div> | |
</div> | |
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(function() { | |
for (var i = 1; i <= 9; i++) { | |
var letter = i % 2 ? "X" : "O"; | |
var id = '#' + i; | |
$(id).text(letter); | |
} | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script src="https://code.jquery.com/jquery-2.2.4.min.js"></script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.grid-box { | |
/* min-width: 200px; | |
min-height: 200px; | |
max-width: 300px; | |
max-height: 300px; */ | |
max-height: 200px; | |
width: 200px; | |
/* border: 5px solid red; */ | |
font-size: 10em; | |
} | |
.top-row { | |
border-bottom: 5px solid red; | |
} | |
.middle-row { | |
border-bottom: 5px solid red; | |
border-top: 5px solid red; | |
} | |
.bottom-row { | |
/* border-bottom: 5px solid red; */ | |
border-top: 5px solid red; | |
} | |
.left-col { | |
border-right: 5px solid red; | |
} | |
.middle-col { | |
border-right: 5px solid red; | |
border-left: 5px solid red; | |
} | |
.right-col { | |
/* border-bottom: 5px solid red; */ | |
border-left: 5px solid red; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" rel="stylesheet" /> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
experimental gist - the start of the tic-tac-toe game.