Skip to content

Commit 5ab1ae6

Browse files
committed
improving flip card responsiveness
1 parent 55d8bb3 commit 5ab1ae6

2 files changed

Lines changed: 92 additions & 3 deletions

File tree

src/app/maturity/maturity-main/maturity-main.component.css

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -190,8 +190,36 @@ button[mat-raised-button] {
190190
flex-direction: row;
191191
align-items: center;
192192
justify-content: center;
193+
flex-wrap: wrap;
193194
padding: 16px;
194195
margin: 16px;
196+
gap: 8px;
197+
}
198+
199+
/* Responsive adjustments for small laptop screens */
200+
@media (max-width: 1200px) {
201+
.flip-card-container {
202+
padding: 12px;
203+
margin: 12px;
204+
gap: 6px;
205+
}
206+
}
207+
208+
@media (max-width: 1024px) {
209+
.flip-card-container {
210+
padding: 8px;
211+
margin: 8px;
212+
gap: 4px;
213+
}
214+
}
215+
216+
/* For very small laptops - stack cards vertically or show in single row */
217+
@media (max-width: 900px) {
218+
.flip-card-container {
219+
flex-direction: column;
220+
padding: 8px;
221+
margin: 8px;
222+
}
195223
}
196224

197225
/* Responsive adjustments */

src/app/util/flip-card/flip-card.component.scss

Lines changed: 64 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,20 +3,59 @@
33
width: 400px;
44
height: 400px;
55
margin: 1rem;
6+
flex-shrink: 1;
7+
border: none;
8+
box-shadow: none;
9+
background: transparent;
10+
611
.mat-mdc-card-content {
712
padding: 0;
813
}
14+
15+
// Remove Material card default styling
16+
&.mat-mdc-card {
17+
box-shadow: none;
18+
border: none;
19+
background: transparent;
20+
}
21+
}
22+
23+
/* Responsive sizing for smaller laptops and tablets */
24+
@media (max-width: 1400px) {
25+
.flip-container {
26+
width: 350px;
27+
height: 350px;
28+
margin: 0.75rem;
29+
}
30+
}
31+
32+
@media (max-width: 1200px) {
33+
.flip-container {
34+
width: 300px;
35+
height: 320px;
36+
margin: 0.6rem;
37+
}
38+
}
39+
40+
@media (max-width: 1024px) {
41+
.flip-container {
42+
width: 280px;
43+
height: 300px;
44+
margin: 0.5rem;
45+
}
946
}
1047

1148
.flip-card {
1249
width: 100%;
1350
height: 100%;
1451
position: relative;
15-
transform-origin: center center; // or 50% 50%
52+
transform-origin: center center;
1653
transition: transform 0.6s;
1754
transform-style: preserve-3d;
18-
background-color: rgb(18, 79, 107);
55+
background: transparent;
1956
color: white;
57+
border: none;
58+
box-shadow: none;
2059
}
2160

2261
.flipped .flip-card {
@@ -25,16 +64,38 @@
2564

2665
.flip-card-front,
2766
.flip-card-back {
28-
padding: 10px;
67+
padding: 20px;
2968
position: absolute;
3069
width: 100%;
3170
height: 100%;
3271
backface-visibility: hidden;
72+
-webkit-backface-visibility: hidden;
3373
display: flex;
3474
align-items: center;
3575
justify-content: center;
3676
text-align: center;
3777
flex-direction: column;
78+
font-size: 1rem;
79+
border-radius: 4px;
80+
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2), 0 4px 8px rgba(0, 0, 0, 0.15);
81+
overflow: hidden;
82+
}
83+
84+
/* Adjust padding and font sizes for smaller laptops */
85+
@media (max-width: 1200px) {
86+
.flip-card-front,
87+
.flip-card-back {
88+
padding: 16px;
89+
font-size: 0.9rem;
90+
}
91+
}
92+
93+
@media (max-width: 1024px) {
94+
.flip-card-front,
95+
.flip-card-back {
96+
padding: 12px;
97+
font-size: 0.85rem;
98+
}
3899
}
39100

40101
.flip-card-front {

0 commit comments

Comments
 (0)