-
Notifications
You must be signed in to change notification settings - Fork 0
/
styles.css
168 lines (139 loc) · 2.75 KB
/
styles.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
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
@import url("https://fonts.googleapis.com/css2?family=Comfortaa:wght@300;400;500;600;700&display=swap");
* {
margin: 0 auto;
padding: 0;
font-family: "Comfortaa", cursive;
}
body {
min-height: 100vh;
min-width: 100vw;
background-color: #c9e3ea;
}
header {
display: flex;
width: 100%;
background-color: #000000;
color: #f4c4c9;
align-items: center;
justify-content: flex-end;
/* import for to fix the header on top */
top: 0;
position: fixed;
z-index: 1;
height: 60px;
}
.main {
display: flex;
flex-direction: column;
justify-content: center;
/* to show after the header */
height: calc(100vh - 60px);
top: 60px;
position: relative;
}
/* ----------------- LIVES AND BUTTON ----------- */
.wrap {
display: flex;
top: 20px;
position: relative;
}
.container {
display: flex;
gap: 1.4rem;
height: 5rem;
/* align-items: center; */
}
a {
text-decoration: none;
color: #f4c4c9;
}
.lives {
font-weight: 700;
}
/* Button CSS */
.reset {
background-color: #000000;
border: solid transparent;
border-radius: 12px;
border-width: 0 0 4px;
box-sizing: border-box;
color: #f4c4c9;
cursor: pointer;
width: 100px;
height: 40px;
}
.reset:hover:not(:disabled) {
filter: brightness(1.1);
-webkit-filter: brightness(1.1);
}
.reset:active {
transform: translateY(4px);
}
/* -------------------CARDS ------------- */
.memory-game {
display: grid;
grid-template-columns: repeat(4, 180px);
grid-template-rows: repeat(3, 220px);
align-items: center;
justify-content: center;
cursor: pointer;
/* to make the cards flip 3D*/
perspective: 1000px;
}
.card {
/* to make the cards above the others */
position: relative;
/* to make the cards flip */
transform-style: preserve-3d;
/* transition: transform 0.5s ease-in; */
transition: all 2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
border-radius: 15px;
background-color: white;
box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2);
/*need the size for to be in place */
width: 150px;
height: 200px;
}
/* to flip when it clicked with the event "click" */
.toggleCard {
transform: rotateY(180deg);
}
.front,
.back {
width: 150px;
height: 200px;
position: absolute;
pointer-events: none;
}
.back {
transform: rotateY(180deg);
-webkit-backface-visibility: hidden;
backface-visibility: hidden;
}
/* ------------------ MOBILE SIZE ------------- */
@media (max-width: 390px) {
.memory-game {
grid-template-columns: repeat(3, 90px);
grid-template-rows: repeat(4, 100px);
gap: 1em;
}
.main {
top: 20px;
}
.front,
.back,
.card {
width: 90px;
height: 100px;
border-radius: 10px;
}
.lives {
font-size: 1.5rem;
}
.wrap {
top: 0px;
}
.container {
align-items: center;
}
}