From dc35f001cf3e780a7871b3ad78a4e701e8e7a2e9 Mon Sep 17 00:00:00 2001 From: Tony Yang Date: Thu, 1 Apr 2021 16:23:23 +0800 Subject: [PATCH] [Update] Agenda event RWD Layout: mobile event block container Style: event block font size and icon scale RWD --- src/assets/scss/agenda.scss | 51 +++++++++++++++++++++- src/assets/scss/eventblock.scss | 77 ++++++++++++++++++++++++++++++--- src/components/EventBlock.vue | 25 ++++++----- src/pages/Agenda.vue | 22 +++++++--- 4 files changed, 151 insertions(+), 24 deletions(-) diff --git a/src/assets/scss/agenda.scss b/src/assets/scss/agenda.scss index de1bc65..cc4f785 100644 --- a/src/assets/scss/agenda.scss +++ b/src/assets/scss/agenda.scss @@ -47,6 +47,7 @@ $fontFamilyVote: "Noto Serif CJK TC -Black"; margin: 0 auto; @include RWDWidth; padding-top: 50px; + padding-bottom: 50px; font-family: $fontFamily; @include RWDFontSize; @@ -88,11 +89,18 @@ $fontFamilyVote: "Noto Serif CJK TC -Black"; } } - div.event.container { + div.event.container:not(.mobile) { display: grid; grid-template-columns: min-content repeat(6, 1fr) min-content; column-gap: 30px; + @media screen and (max-width: 1200px) { + column-gap: 20px; + } + @media screen and (max-width: 1024px) { + column-gap: 10px; + } + img.arrow { margin: auto; width: fit-content; @@ -100,10 +108,51 @@ $fontFamilyVote: "Noto Serif CJK TC -Black"; } } } + @media screen and (max-width: $max-width-medium-1) { #agenda { p.vote { padding: 0; } + + div.mobile.event.container { + .column { + display: flex; + justify-content: center; + align-items: center; + + width: 100%; + + .event.block { + width: 33%; + } + + > :nth-child(2) { + margin-left: 20px; + margin-right: 20px; + } + + // column with two item only + > :last-child:nth-child(2) { + margin-left: 10px; + margin-right: 0; + } + + // column with one item and two arrows + > .arrow ~ :nth-child(2) { + margin-left: 30px; + margin-right: 30px; + } + + &:not(:first-child) { + // more vertically compact column + margin-top: -20px; + } + } + + img.arrow { + height: 80%; + } + } } } \ No newline at end of file diff --git a/src/assets/scss/eventblock.scss b/src/assets/scss/eventblock.scss index 5e8eac3..4f8eb19 100644 --- a/src/assets/scss/eventblock.scss +++ b/src/assets/scss/eventblock.scss @@ -1,4 +1,56 @@ -@import url('https://fonts.googleapis.com/css2?family=Noto+Serif+TC&display=swap'); +@import './font'; +@import './breakpoint'; + +$fontFamily: "Noto Serif CJK TC -Bold"; + +@mixin RWDFontSize { + font-size: 18pt; + + @media screen and (max-width: 1400px) { + font-size: 16pt; + } + @media screen and (max-width: 1200px) { + font-size: 15pt; + } + @media screen and (max-width: 1024px) { + font-size: 13pt; + } + @media screen and (max-width: $max-width-medium-1) { + font-size: 22pt; + } + @media screen and (max-width: 650px) { + font-size: 16pt; + } + @media screen and (max-width: 500px) { + font-size: 15pt; + } +} + +@mixin RWDIconScale { + transform: scale(0.75); + + @media screen and (max-width: 1300px) { + transform: scale(0.6); + } + @media screen and (max-width: 1200px) { + transform: scale(0.55); + } + @media screen and (max-width: 1024px) { + transform: scale(0.5); + } + @media screen and (max-width: $max-width-medium-1) { + transform: scale(1.25); + } + @media screen and (max-width: $max-width-small-0) { + transform: scale(1); + } + @media screen and (max-width: 600px) { + transform: scale(0.75); + } + @media screen and (max-width: 500px) { + transform: scale(0.55); + } +} .event.block { position: relative; @@ -9,10 +61,9 @@ align-items: center; justify-content: center; - font-size: 24px; + @include RWDFontSize; line-height: 1.44; - font-family: 'Noto Serif TC', serif; - font-weight: bold; + font-family: $fontFamily; .background { width: 100%; @@ -36,12 +87,26 @@ span { white-space: pre; z-index: 1; + + // for lightning talk block + &.special { + // visual adjustment + margin-top: 5%; + + } + @media screen and (min-width: $max-width-medium-1) { + &.special { + transform: scale(0.75); + } + } } i.icon { position: absolute; z-index: 0; - transform: scale(0.75); + + @include RWDIconScale(); + // transform: scale(0.75); &::before { width: 100%; @@ -91,7 +156,7 @@ } &.guide-outline { - margin-right: 40px; + margin-right: 25%; width: 74px; height: 95px; diff --git a/src/components/EventBlock.vue b/src/components/EventBlock.vue index f4dcfa1..8d9c22d 100644 --- a/src/components/EventBlock.vue +++ b/src/components/EventBlock.vue @@ -1,11 +1,11 @@