Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
mamayaya1
GitHub Repository: mamayaya1/game
Path: blob/main/projects/connect3/style.css
4626 views
1
html, body {
2
height: 100%;
3
width: 100%;
4
}
5
body {
6
display: flex;
7
justify-content: center;
8
align-items: center;
9
margin: 0;
10
font-size: 0;
11
background-color: #303030;
12
color: white;
13
font-family: 'Roboto', sans-serif;
14
}
15
.grid {
16
background-color: #424242;
17
padding: 20px;
18
box-shadow: 0 6px 24px rgba(0,0,0,0.3);
19
border-radius: 2px;
20
width: 355px;
21
height: 355px;
22
position: relative;
23
}
24
.grid::after {
25
content: attr(data-score);
26
font-size: 72px;
27
text-align: center;
28
display: block;
29
width: 100%;
30
position: absolute;
31
bottom: 100%;
32
left: 0;
33
}
34
.grid > span {
35
position: absolute;
36
padding: 20px;
37
border-radius: 2px;
38
background-position: center;
39
background-repeat: no-repeat;
40
background-size: 20px;
41
box-shadow: 0 0.5px 3px rgba(0,0,0,0.3);
42
transition: left .2s, top .2s;
43
}
44
.grid > span.square {
45
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 10' stroke-linejoin='round' fill='none' stroke='rgba(0,0,0,0.3)' stroke-width='1'%3E%3Cpath d='M1 1H9V9H1z'/%3E%3C/svg%3E")
46
}
47
.grid > span.circle {
48
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 10' fill='none' stroke='rgba(0,0,0,0.3)' stroke-width='1'%3E%3Ccircle cx='5' cy='5' r='4'/%3E%3C/svg%3E")
49
}
50
.grid > span.triangle {
51
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 10' stroke-linejoin='round' fill='none' stroke='rgba(0,0,0,0.3)' stroke-width='1'%3E%3Cpath d='M5 1.5L9 8.5H1z'/%3E%3C/svg%3E")
52
}
53
.grid > span.plus {
54
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 10' stroke-linecap='round' fill='none' stroke='rgba(0,0,0,0.3)' stroke-width='1'%3E%3Cpath d='M5 1V9M1 5H9'/%3E%3C/svg%3E")
55
}
56
.grid > span.minus {
57
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 10' stroke-linecap='round' fill='none' stroke='rgba(0,0,0,0.3)' stroke-width='1'%3E%3Cpath d='M2 5H8'/%3E%3C/svg%3E")
58
}
59
.grid > span.hexagon {
60
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 10' stroke-linejoin='round' fill='none' stroke='rgba(0,0,0,0.3)' stroke-width='1'%3E%3Cpath d='M4 1H8L10.6 5L8 9H4L1.4 5z'/%3E%3C/svg%3E");
61
background-size: 24px 20px;
62
}
63
.grid > span.dot {
64
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 10' fill='rgba(0,0,0,0.3)'%3E%3Ccircle cx='5' cy='5' r='1'/%3E%3C/svg%3E");
65
}
66
.grid > span::after {
67
content: '';
68
pointer-events: none;
69
width: 100%;
70
height: 100%;
71
position: absolute;
72
top: 0;
73
left: 0;
74
background-size: 100%;
75
background-position: center;
76
background-repeat: no-repeat;
77
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 10' stroke-linejoin='round' stroke-linecap='round' fill='none' stroke='white' stroke-width='1'%3E%3Cpath d='M1 2V1H2M9 8V9H8 M9 2V1H8M2 9H1V8'/%3E%3C/svg%3E");
78
transform: scale(1.2);
79
opacity: 0;
80
transition: all .2s;
81
}
82
.grid > span.active::after {
83
transform: scale(1);
84
opacity: 1;
85
}
86
.grid > span.entering {
87
padding: 0 20px;
88
animation: entering .2s .2s forwards;
89
}
90
@keyframes entering {
91
from {padding: 0 20px;}
92
to {padding: 20px;}
93
}
94
.grid > span.exiting {
95
pointer-events: none;
96
animation: exiting .2s forwards;
97
}
98
@keyframes exiting {
99
from {padding: 20px; margin-top: 0;}
100
to {padding: 0 20px; margin-top: 40px;}
101
}
102