Created
August 3, 2023 03:58
-
-
Save CodingWith-Adam/d82337a4c8b3beb49248584a51c6f550 to your computer and use it in GitHub Desktop.
React Tic Tac Toe CSS
This file contains hidden or 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
| body { | |
| display: flex; | |
| flex-direction: column; | |
| align-items: center; | |
| background-color: #23272f; | |
| color: white; | |
| } | |
| h1 { | |
| text-align: center; | |
| } | |
| .board { | |
| display: grid; | |
| grid-template-columns: 100px 100px 100px; | |
| grid-template-rows: 100px 100px 100px; | |
| cursor: pointer; | |
| position: relative; | |
| } | |
| .tile { | |
| color: currentColor; | |
| font-size: 2em; | |
| display: flex; | |
| justify-content: center; | |
| align-items: center; | |
| } | |
| .right-border { | |
| border-right: 0.2em solid #0074a6; | |
| } | |
| .bottom-border { | |
| border-bottom: 0.2em solid #0074a6; | |
| } | |
| .x-hover:hover::after { | |
| content: "X"; | |
| opacity: 0.4; | |
| } | |
| .o-hover:hover::after { | |
| content: "O"; | |
| opacity: 0.4; | |
| } | |
| .strike { | |
| position: absolute; | |
| background-color: darkorange; | |
| } | |
| .strike-row-1 { | |
| width: 100%; | |
| height: 4px; | |
| top: 15%; | |
| } | |
| .strike-row-2 { | |
| width: 100%; | |
| height: 4px; | |
| top: 48%; | |
| } | |
| .strike-row-3 { | |
| width: 100%; | |
| height: 4px; | |
| top: 83%; | |
| } | |
| .strike-column-1 { | |
| height: 100%; | |
| width: 4px; | |
| left: 15%; | |
| } | |
| .strike-column-2 { | |
| height: 100%; | |
| width: 4px; | |
| left: 48%; | |
| } | |
| .strike-column-3 { | |
| height: 100%; | |
| width: 4px; | |
| left: 83%; | |
| } | |
| .strike-diagonal-1 { | |
| width: 90%; | |
| height: 4px; | |
| top: 50%; | |
| left: 5%; | |
| transform: skewY(45deg); | |
| } | |
| .strike-diagonal-2 { | |
| width: 90%; | |
| height: 4px; | |
| top: 50%; | |
| left: 5%; | |
| transform: skewY(-45deg); | |
| } | |
| .game-over { | |
| text-align: center; | |
| border: #5468ff 8px; | |
| border-style: dotted; | |
| padding: 10px; | |
| margin-top: 50px; | |
| font-size: 1.5em; | |
| } | |
| .reset-button { | |
| margin-top: 50px; | |
| padding: 20px; | |
| background-color: #0074a6; | |
| color: white; | |
| width: 100%; | |
| font-size: 1.5em; | |
| } |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Click sound
https://user-images.githubusercontent.com/62483230/259564660-d64f7059-a360-4421-b6d0-8c4d01a2b9a0.mov
Game over sound
https://user-images.githubusercontent.com/62483230/259564774-ef9d675c-da4a-4ab4-9aec-7861f3a4869a.mov