-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBoard_2.css
More file actions
100 lines (89 loc) · 2.05 KB
/
Board_2.css
File metadata and controls
100 lines (89 loc) · 2.05 KB
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
body {
margin: 0;
background-color:lightblue;
display: flex;
flex-direction: column;
justify-content: center;
text-align: center;
align-items: center;
}
.hexagon-container {
position: relative;
width: 700px;
height: 700px;
background-color: rgb(196, 220, 244);
grid-template-columns: repeat(auto-fit,minmax(40px,1fr));
gap: 6px;
}
.button {
position: absolute;
width: 20px;
height: 20px;
border-radius: 50%;
background:white;
color: white;
text-align: center;
line-height: 60px;
font-weight: bold;
transform: translate(-50%, -50%);
}
.outer {
/* Position with trigonometry */
left:calc(50% + 300px * cos(var(--angle)));
top: calc(50% + 300px * sin(var(--angle)));
}
.middle {
left:calc(50% + 200px * cos(var(--angle)));
top: calc(50% + 200px * sin(var(--angle)));
}
.inner {
left:calc(50% + 100px * cos(var(--angle)));
top: calc(50% + 100px * sin(var(--angle)));
}
/* Generate angle in radians: 0, 60, 120, ..., using index i */
.button[style*="--i: 0"] { --angle: 0rad; }
.button[style*="--i: 1"] { --angle: 1.047rad; } /* 60° */
.button[style*="--i: 2"] { --angle: 2.094rad; } /* 120° */
.button[style*="--i: 3"] { --angle: 3.142rad; } /* 180° */
.button[style*="--i: 4"] { --angle: 4.189rad; } /* 240° */
.button[style*="--i: 5"] { --angle: 5.236rad; } /* 300° */
.edges {
position: absolute;
top: 0;
left: 0;
pointer-events: none;
}
.edges line {
stroke: black;
stroke-width: 3;
}
button {
cursor: pointer;
z-index: 2;
transition: transform 0.1s ease, background-color 0.2s ease;
}
.weight-text {
font-size: 25px;
fill:darkblue;
dominant-baseline: text-top;
text-anchor: middle;
}
.button.red {
background-color: red;
}
.button.blue {
background-color: blue;
}
@media (max-width: 600px) {
.button {
width: 25px;
height: 25px;
font-size: 10px;
}
#scoreboard, #game-controls {
font-size: 14px;
padding: 5px;
flex-direction: column;
align-items: center;
}
}