Skip to content

Commit 1562a4d

Browse files
committed
Better support the mobile size
1 parent 44f24c7 commit 1562a4d

8 files changed

Lines changed: 53 additions & 5 deletions

File tree

src/components/games/GameCard.astro

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,14 +132,22 @@ const { title, slug, summary, status, components, locale, cover } = Astro.props;
132132
line-height: 1.6;
133133
}
134134

135-
@media (max-width: 640px) {
135+
@media (max-width: 768px) {
136136
.game-card {
137137
flex-direction: column;
138+
gap: var(--space-6);
138139
}
139140

140141
.game-card__cover {
141142
flex: none;
142143
width: 100%;
144+
aspect-ratio: 16 / 9;
145+
}
146+
}
147+
148+
@media (max-width: 480px) {
149+
.game-card {
150+
padding: var(--space-6);
143151
}
144152
}
145153
</style>

src/components/layout/Footer.astro

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,4 +74,14 @@ const year = new Date().getFullYear();
7474
padding-top: var(--space-4);
7575
border-top: var(--guideline-width) solid var(--guideline-color);
7676
}
77+
78+
@media (max-width: 480px) {
79+
.footer__inner {
80+
grid-template-columns: 1fr;
81+
}
82+
83+
.footer__right {
84+
margin-top: var(--space-2);
85+
}
86+
}
7787
</style>

src/components/layout/Header.astro

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,8 +123,20 @@ const currentPath = Astro.url.pathname;
123123
}
124124

125125
@media (max-width: 640px) {
126+
.header__inner {
127+
gap: var(--space-3);
128+
}
129+
130+
.header__logo-img {
131+
height: 1.2rem;
132+
}
133+
126134
.header__nav-list {
127-
gap: var(--space-4);
135+
gap: var(--space-3);
136+
}
137+
138+
.header__locale {
139+
display: none;
128140
}
129141
}
130142
</style>

src/pages/games/[slug].astro

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -139,12 +139,11 @@ const related = allResearch.filter((r) => r.data.game === slug && !r.data.draft)
139139
@media (max-width: 768px) {
140140
.game-header {
141141
grid-template-columns: 1fr;
142+
gap: var(--space-6);
142143
}
143144

144145
.game-header__cover {
145-
width: 100%;
146-
max-width: 240px;
147-
padding-top: 0;
146+
display: none;
148147
}
149148
}
150149

src/pages/research/[slug].astro

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,4 +87,14 @@ const dateStr = post.data.publishDate.toLocaleDateString("en-US", {
8787
font-size: var(--text-xs);
8888
color: var(--c-gray-400);
8989
}
90+
91+
@media (max-width: 480px) {
92+
.research-header {
93+
padding: var(--space-8) 0 var(--space-6);
94+
}
95+
96+
.research-header__title {
97+
font-size: var(--text-2xl);
98+
}
99+
}
90100
</style>

src/styles/global.css

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ html {
1515
-webkit-font-smoothing: antialiased;
1616
-moz-osx-font-smoothing: grayscale;
1717
scroll-behavior: smooth;
18+
overflow-x: hidden;
1819
}
1920

2021
body {
@@ -91,6 +92,12 @@ button {
9192
padding-inline: var(--space-6);
9293
}
9394

95+
@media (max-width: 480px) {
96+
.container {
97+
padding-inline: var(--space-4);
98+
}
99+
}
100+
94101
.sr-only {
95102
position: absolute;
96103
width: 1px;

src/styles/prose-game.css

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
line-height: 1.8;
99
color: var(--c-ink);
1010
max-width: 72ch;
11+
overflow-wrap: break-word;
1112
}
1213

1314
.prose-game h1,

src/styles/prose-research.css

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
line-height: 1.8;
99
color: var(--c-ink);
1010
max-width: 65ch;
11+
overflow-wrap: break-word;
1112
}
1213

1314
.prose-research h1,

0 commit comments

Comments
 (0)