-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.scss
123 lines (109 loc) · 2.19 KB
/
index.scss
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
/* Array */
$palette1: #05668dff, #028090ff, #00a896ff, #02c39aff, #f0f3bdff;
$palette2: #264653ff, #2a9d8fff, #e9c46aff, #f4a261ff, #e76f51ff;
$palette3: #fe938cff, #e6b89cff, #ead2acff, #9cafb7ff, #4281a4ff;
$palette5: #ffffffff, #84dcc6ff, #a5ffd6ff, #ffa69eff, #ff686bff;
$palette4: #ffadadff, #ffd6a5ff, #fdffb6ff, #caffbfff, #9bf6ffff, #a0c4ffff,
#bdb2ffff, #ffc6ffff, #fffffcff;
$colorList: ();
$newColorList: ();
$font-family: Arial, Helvetica, sans-serif;
@function shuffle($list) {
$list-length: length($list);
@while ($list-length > 0) {
$rand: random($list-length);
$temp: nth($list, $rand);
$list: set-nth($list, $rand, nth($list, $list-length));
$list: set-nth($list, $list-length, $temp);
$list-length: $list-length - 1;
}
@return $list;
}
$colors: shuffle($palette1);
$colorBg: nth($colors, 1) !default;
$color1: nth($colors, 2) !default;
$color2: nth($colors, 3) !default;
$color3: nth($colors, 4) !default;
$color4: nth($colors, 5) !default;
html,
body {
overflow-x: hidden;
font-family: $font-family;
}
body {
position: relative;
margin: 0px;
padding: 0px;
width: 100vw;
height: 100vh;
display: flex;
justify-content: center;
align-items: center;
background-color: $colorBg;
}
.tile {
-webkit-tap-highlight-color: rgba(0, 0, 0, 0);
rx: 10;
ry: 10;
cursor: pointer;
rect,
text {
cursor: pointer;
}
z-index: 10;
}
.tile-a {
fill: $color1;
}
.tile-b {
fill: $color2;
}
.empty-tile {
cursor: grabbing;
rect,
text {
cursor: grabbing;
fill: $color3;
}
z-index: -1;
}
svg text {
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
cursor: pointer;
}
svg text::selection {
background: none;
}
text {
font-family: $font-family;
font-size: 2rem;
fill: $color4;
}
#puzzle-15 > svg {
border-radius: 10px;
fill: $color3;
background-color: $color3;
}
#controls{
position: absolute;
bottom: 30px;
}
button{
border-radius: 10px;
background-color: $color3;
min-height: 70px;
min-width: 70*2px;
border: none;
outline: none;
box-shadow: none;
font-size: 2rem;
&:hover {
background: $color4;
}
&:active{
background: $color1;
}
}