From 584be02a8c1c228a62a5bf81835f11a98149869a Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Mon, 23 Sep 2019 14:19:51 +0200 Subject: [PATCH] Responsive home page --- src/App.vue | 10 ++++++- src/components/ContentSelection.vue | 21 +++++++++++++ src/scss/_mixins.scss | 27 +++++++++++++++++ src/scss/_variables.scss | 3 ++ src/scss/main.scss | 46 +++++++++++++++++++++-------- src/views/Home.vue | 44 +++++++++++++++++++++++++-- 6 files changed, 134 insertions(+), 17 deletions(-) diff --git a/src/App.vue b/src/App.vue index 2ee801c..3cec95b 100644 --- a/src/App.vue +++ b/src/App.vue @@ -6,11 +6,19 @@ - diff --git a/src/components/ContentSelection.vue b/src/components/ContentSelection.vue index 115c008..2867c11 100644 --- a/src/components/ContentSelection.vue +++ b/src/components/ContentSelection.vue @@ -50,6 +50,17 @@ .root { display: flex; + + @media screen and (max-width: $small-screen) { + flex-direction: column; + + .left { + align-items: center !important; + display: flex !important; + flex-direction: column !important; + margin-bottom: 20px !important; + } + } } .left { @@ -107,6 +118,16 @@ .tags { display: flex; + flex-wrap: wrap; + + + @media screen and (max-width: $responsive-screen) { + justify-content: center; + } + + .tag { + margin-top: 10px; + } } } diff --git a/src/scss/_mixins.scss b/src/scss/_mixins.scss index f717850..b9ce2f7 100644 --- a/src/scss/_mixins.scss +++ b/src/scss/_mixins.scss @@ -1,3 +1,5 @@ +@import './_variables'; + @mixin disable-default-a-behaviour { &:hover, &:focus, &:active { text-decoration: none !important; @@ -5,3 +7,28 @@ color: inherit !important; } } + +@mixin one-column { + width: 600px; + margin: auto; + display: flex; + flex-direction: column; + align-items: center; + + img { + margin: 30px 0; + + & + .citation { + margin-top: 0 !important; + } + } + + @media screen and (max-width: $small-screen) { + width: 100%; + + img { + max-width: 100% !important; + margin: 30px auto !important; + } + } +} diff --git a/src/scss/_variables.scss b/src/scss/_variables.scss index 66905d4..b55777a 100644 --- a/src/scss/_variables.scss +++ b/src/scss/_variables.scss @@ -2,3 +2,6 @@ $font-semibold: 600; $orange: #f67e08; $grey: #5e5e5e; + +$responsive-screen: 992px; +$small-screen: 700px; diff --git a/src/scss/main.scss b/src/scss/main.scss index da91e8e..e7d62fc 100644 --- a/src/scss/main.scss +++ b/src/scss/main.scss @@ -59,6 +59,14 @@ main { background-color: #fff; box-shadow: 0 2px 6px 0 rgba(0, 0, 0, 0.35); border: solid 1px #d9d9d9; + + @media screen and (max-width: $responsive-screen) { + padding: 0 15px; + } + + @media screen and (max-width: $small-screen) { + padding: 0 10px; + } } .caret::after { @@ -89,10 +97,26 @@ main { width: 18px; height: 18px; } + + @media screen and (max-width: $responsive-screen) { + width: auto; + font-size: 14px; + flex-direction: column; + text-align: center; + } + + @media screen and (max-width: $small-screen) { + min-width: auto !important; + padding: 0 5px !important; + } } .jpt-big-button-icon svg { margin-right: 30px; + + @media screen and (max-width: $responsive-screen) { + margin-right: 0; + } } .jpt-button-medium { @@ -120,6 +144,10 @@ main { height: 40px; vertical-align: sub; } + + @media screen and (max-width: $small-screen) { + margin: 50px 0 30px 0; + } } .subtitle { @@ -128,22 +156,14 @@ main { font-weight: $font-semibold; margin-top: 100px; white-space: nowrap; + + @media screen and (max-width: $responsive-screen) { + white-space: normal; + } } .one-column { - width: 600px; - margin: auto; - display: flex; - flex-direction: column; - align-items: center; - - img { - margin: 30px 0; - - & + .citation { - margin-top: 0 !important; - } - } + @include one-column; } .bottom-link-wrapper { diff --git a/src/views/Home.vue b/src/views/Home.vue index 7caf72c..31a3fb3 100644 --- a/src/views/Home.vue +++ b/src/views/Home.vue @@ -250,12 +250,12 @@ PeerTube you play illustration -
+