Skip to content

Commit

Permalink
refactor: RWD optimization
Browse files Browse the repository at this point in the history
  • Loading branch information
pan93412 committed Oct 3, 2024
1 parent fa0a655 commit 4060582
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 14 deletions.
14 changes: 11 additions & 3 deletions assets/styles/app.scss
Original file line number Diff line number Diff line change
Expand Up @@ -328,9 +328,17 @@ ul.credit {
display: grid;
gap: 3rem;
grid-template:
"hello-text hello-text hello-text hello-text" auto
"weekly-metrics weekly-metrics leaderboard leaderboard" 1fr
"historic-statistics historic-statistics leaderboard leaderboard" 1fr;
"hello-text" auto
"weekly-metrics" auto
"historic-statistics" auto
"leaderboard" auto;

@media (min-width: 768px) {
grid-template:
"hello-text hello-text hello-text hello-text" auto
"weekly-metrics weekly-metrics leaderboard leaderboard" 1fr
"historic-statistics historic-statistics leaderboard leaderboard" 1fr;
}

&__hello-text {
grid-area: hello-text;
Expand Down
16 changes: 8 additions & 8 deletions templates/overview/index.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,15 @@
<section class="app-overview-dashboard__weekly-metrics">
<h3 class="mb-3">每週學習概況</h3>

<div class="row gutter-2">
<div class="col-6">
<div class="week-overview__cards vstack gap-1">
<div class="row g-2">
<div class="col-12 col-md-6">
<div class="vstack gap-1">
<turbo-frame id="solved_questions" src="{{ path('app_overview_cards_solved_questions') }}"></turbo-frame>
<turbo-frame id="points" src="{{ path('app_overview_cards_points') }}"></turbo-frame>
<turbo-frame id="level" src="{{ path('app_overview_cards_level') }}"></turbo-frame>
</div>
</div>
<div class="col-6">
<div class="col-12 col-md-6">
<turbo-frame id="events_daily_chart" src="{{ path('app_overview_cards_events_daily_chart') }}"></turbo-frame>
</div>
</div>
Expand All @@ -30,15 +30,15 @@
<section class="app-overview-dashboard__historic-statistics">
<h3 class="mb-3">學習歷程</h3>

<div class="historic-statistics__main row gutter-2">
<div class="col-6">
<div class="historic-statistics__cards vstack gap-1">
<div class="row g-5 g-md-2">
<div class="col-12 col-md-6">
<div class="vstack gap-1">
<turbo-frame id="solved_questions" src="{{ path('app_overview_cards_solved_questions') }}"></turbo-frame>
<turbo-frame id="events_count" src="{{ path('app_overview_cards_events_count') }}"></turbo-frame>
<turbo-frame id="questions_count" src="{{ path('app_overview_cards_questions_count') }}"></turbo-frame>
</div>
</div>
<div class="col-6">
<div class="col-12 col-md-6t">
<turbo-frame id="events_history" src="{{ path('app_overview_cards_events_history') }}"></turbo-frame>
</div>
</div>
Expand Down
6 changes: 3 additions & 3 deletions templates/profile/index.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
{% block title %}個人資料{% endblock %}

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

Expand Down Expand Up @@ -47,7 +47,7 @@
</ul>
</turbo-frame>

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

<div class="vstack gap-4">
Expand Down

0 comments on commit 4060582

Please sign in to comment.