Skip to content

Commit 95c5b2c

Browse files
committed
improving centering player cards
and removing duplicated code
1 parent 0f63d55 commit 95c5b2c

File tree

2 files changed

+19
-25
lines changed

2 files changed

+19
-25
lines changed

Diff for: src/App.css

+18-25
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,8 @@ img {
5050
grid-template-columns: repeat(4, 1fr);
5151
gap: 20px;
5252
justify-content: center;
53+
justify-items: center;
54+
align-items: center;
5355
padding: 20px;
5456
}
5557

@@ -66,6 +68,19 @@ img {
6668
grid-template-columns: repeat(1, 1fr);
6769
}
6870

71+
.games {
72+
text-align: center;
73+
margin-top: 40px;
74+
}
75+
76+
.games-list {
77+
display: flex;
78+
flex-wrap: wrap;
79+
justify-content: center;
80+
gap: 20px;
81+
padding: 20px;
82+
}
83+
6984
@media (max-width: 768px) {
7085
.logo {
7186
width: 50%;
@@ -76,6 +91,8 @@ img {
7691
}
7792

7893
.games-list {
94+
flex-direction: column;
95+
align-items: center;
7996
grid-template-columns: repeat(2, 1fr);
8097
}
8198

@@ -97,31 +114,7 @@ img {
97114
grid-template-columns: repeat(2, 1fr);
98115
}
99116

100-
.logo {
101-
width: 80%;
102-
}
103-
}
104-
105-
.games {
106-
text-align: center;
107-
margin-top: 40px;
108-
}
109-
110-
.games-list {
111-
display: flex;
112-
flex-wrap: wrap;
113-
justify-content: center;
114-
gap: 20px;
115-
padding: 20px;
116-
}
117-
118-
@media (max-width: 768px) {
119117
.logo {
120118
width: 50%;
121119
}
122-
123-
.games-list {
124-
flex-direction: column;
125-
align-items: center;
126-
}
127-
}
120+
}

Diff for: src/components/PlayerCard.css

+1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
width: 100%;
1111
max-width: 250px;
1212
transition: transform 0.2s;
13+
box-sizing: border-box;
1314
}
1415

1516
.player-card:hover {

0 commit comments

Comments
 (0)