Skip to content
This repository was archived by the owner on Oct 15, 2025. It is now read-only.

Commit 4060582

Browse files
committed
refactor: RWD optimization
1 parent fa0a655 commit 4060582

File tree

3 files changed

+22
-14
lines changed

3 files changed

+22
-14
lines changed

assets/styles/app.scss

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -328,9 +328,17 @@ ul.credit {
328328
display: grid;
329329
gap: 3rem;
330330
grid-template:
331-
"hello-text hello-text hello-text hello-text" auto
332-
"weekly-metrics weekly-metrics leaderboard leaderboard" 1fr
333-
"historic-statistics historic-statistics leaderboard leaderboard" 1fr;
331+
"hello-text" auto
332+
"weekly-metrics" auto
333+
"historic-statistics" auto
334+
"leaderboard" auto;
335+
336+
@media (min-width: 768px) {
337+
grid-template:
338+
"hello-text hello-text hello-text hello-text" auto
339+
"weekly-metrics weekly-metrics leaderboard leaderboard" 1fr
340+
"historic-statistics historic-statistics leaderboard leaderboard" 1fr;
341+
}
334342

335343
&__hello-text {
336344
grid-area: hello-text;

templates/overview/index.html.twig

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,15 @@
1313
<section class="app-overview-dashboard__weekly-metrics">
1414
<h3 class="mb-3">每週學習概況</h3>
1515

16-
<div class="row gutter-2">
17-
<div class="col-6">
18-
<div class="week-overview__cards vstack gap-1">
16+
<div class="row g-2">
17+
<div class="col-12 col-md-6">
18+
<div class="vstack gap-1">
1919
<turbo-frame id="solved_questions" src="{{ path('app_overview_cards_solved_questions') }}"></turbo-frame>
2020
<turbo-frame id="points" src="{{ path('app_overview_cards_points') }}"></turbo-frame>
2121
<turbo-frame id="level" src="{{ path('app_overview_cards_level') }}"></turbo-frame>
2222
</div>
2323
</div>
24-
<div class="col-6">
24+
<div class="col-12 col-md-6">
2525
<turbo-frame id="events_daily_chart" src="{{ path('app_overview_cards_events_daily_chart') }}"></turbo-frame>
2626
</div>
2727
</div>
@@ -30,15 +30,15 @@
3030
<section class="app-overview-dashboard__historic-statistics">
3131
<h3 class="mb-3">學習歷程</h3>
3232

33-
<div class="historic-statistics__main row gutter-2">
34-
<div class="col-6">
35-
<div class="historic-statistics__cards vstack gap-1">
33+
<div class="row g-5 g-md-2">
34+
<div class="col-12 col-md-6">
35+
<div class="vstack gap-1">
3636
<turbo-frame id="solved_questions" src="{{ path('app_overview_cards_solved_questions') }}"></turbo-frame>
3737
<turbo-frame id="events_count" src="{{ path('app_overview_cards_events_count') }}"></turbo-frame>
3838
<turbo-frame id="questions_count" src="{{ path('app_overview_cards_questions_count') }}"></turbo-frame>
3939
</div>
4040
</div>
41-
<div class="col-6">
41+
<div class="col-12 col-md-6t">
4242
<turbo-frame id="events_history" src="{{ path('app_overview_cards_events_history') }}"></turbo-frame>
4343
</div>
4444
</div>

templates/profile/index.html.twig

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
{% block title %}個人資料{% endblock %}
55

66
{% block app %}
7-
<div class="profile d-flex row">
8-
<turbo-frame id="app-profile-information" class="profile__information col gr-5">
7+
<div class="profile d-flex row g-5">
8+
<turbo-frame id="app-profile-information" class="profile__information col-12 col-md-6">
99
<h2 class="mb-3">
1010
{{ user.name }}
1111

@@ -47,7 +47,7 @@
4747
</ul>
4848
</turbo-frame>
4949

50-
<section class="profile__update col">
50+
<section class="profile__update col-12 col-md-6">
5151
<h2 class="mb-4">更新帳號資訊</h2>
5252

5353
<div class="vstack gap-4">

0 commit comments

Comments
 (0)