forked from alialaa/tic-tac-toe-js-2020
-
Notifications
You must be signed in to change notification settings - Fork 1
/
style.css
128 lines (122 loc) · 2.17 KB
/
style.css
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
* {
box-sizing: border-box;
}
body {
background-color: #000000;
}
.container {
max-width: 500px;
padding: 0 30px;
margin: 100px auto;
}
.field {
margin-bottom: 20px;
}
.field label {
color: #1f1f1f;
}
#board {
width: 100%;
padding-top: 100%;
position: relative;
margin-bottom: 30px;
}
#board .cells-wrap {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
display: flex;
flex-direction: row;
flex-wrap: wrap;
}
#board [class^="cell-"] {
height: 33.3333333%;
width: 33.3333333%;
border: 2px solid #0a0710;
background: #e0e0e0;
position: relative;
cursor: pointer;
color: #292929;
font-size: calc(18px + 5vw);
font-family: sans-serif;
}
#board [class^="cell-"].x, #board [class^="cell-"].o {
cursor: not-allowed;
}
#board [class^="cell-"].x:after {
content: 'x';
}
#board [class^="cell-"].o:after {
content: 'o';
}
#board:after {
content: '';
position: absolute;
background-color: #c11dd4;
transition: 0.7s;
}
/* Horizontal Lines */
#board[class^="h-"]:after {
width: 0%;
height: 3px;
left: 0;
transform: width translateY(-50%);
}
#board.fullLine[class^="h-"]:after {
width: 100%;
}
#board.h-1:after {
top: 16.6666666665%;
}
#board.h-2:after {
top: 50%;
}
#board.h-3:after {
top: 83.33333333%;
}
/* Vertical Lines */
#board[class^="v-"]:after {
width: 3px;
height: 0%;
top: 0;
transform: height translateX(-50%);
}
#board.fullLine[class^="v-"]:after {
height: 100%;
}
#board.v-1:after {
left: 16.6666666665%;
}
#board.v-2:after {
left: 50%;
}
#board.v-3:after {
left: 83.33333333%;
}
/* Diagonal Lines */
#board[class^="d-main"]:after {
width: 3px;
height: 0%;
left: 0;
top: 0;
transform: rotateZ(-45deg);
transform-origin: 50% 0;
transition: height 0.7s;
}
#board.fullLine[class^="d-main"]:after {
height: 140%;
}
#board[class^="d-counter"]:after {
height: 0%;
width: 3px;
right: 0;
top: 0;
transform: rotateZ(45deg);
transform-origin: 50% 0;
transition: height 0.7s;
}
#board.fullLine[class^="d-counter"]:after {
height: 140%;
}