From: Sven Date: Sun, 2 Apr 2017 18:39:06 +0000 (+0200) Subject: add responsive layout. X-Git-Url: http://git.ipfire.org/?p=people%2Fshoehn%2Fipfire.org.git;a=commitdiff_plain;h=69a9b33d51aa5d8ac5d827543021940b786533fd add responsive layout. spacing not right. --- diff --git a/static/css/style.css b/static/css/style.css index 4be90d1..a310821 100644 --- a/static/css/style.css +++ b/static/css/style.css @@ -1425,7 +1425,7 @@ mark, .btn { display: inline-block; font-weight: normal; - line-height: 1.25; + line-height: 0.95; text-align: center; white-space: nowrap; vertical-align: middle; @@ -5010,8 +5010,26 @@ a.text-gray-dark:focus, a.text-gray-dark:hover { -webkit-transform: translateY(2px); transform: translateY(2px); } +.btn-outline-primary, +.btn-outline-secondary { + -webkit-transition: background-color .25s ease-in-out; + transition: background-color .25s ease-in-out; } + .btn-outline-primary:hover, + .btn-outline-secondary:hover { + -webkit-transition: background-color .25s ease-in-out; + transition: background-color .25s ease-in-out; } + .btn-lg, .btn-group-lg > .btn { margin: 0 24px; } + @media (max-width: 991px) { + .btn-lg, .btn-group-lg > .btn { + margin: 0 8px; + font-size: 14px; } } + +.btn-sm small, .btn-group-sm > .btn small { + display: inline-block; + -webkit-transform: translateY(-2px); + transform: translateY(-2px); } .btn-block { margin: 0 0 2rem 0; } @@ -5019,9 +5037,22 @@ a.text-gray-dark:focus, a.text-gray-dark:hover { .fixed-top { -webkit-transition: background-color 700ms linear; transition: background-color 700ms linear; } + .fixed-top .navbar { + width: 100%; } + .fixed-top .navbar-brand { + opacity: 0; + -webkit-transition: opacity 700ms linear; + transition: opacity 700ms linear; } + @media (min-width: 992px) { + .fixed-top .navbar-brand { + opacity: 1; } } .scrolled { background-color: rgba(255, 255, 255, 0.96); } + .scrolled .navbar-brand { + opacity: 1; + -webkit-transition: opacity 700ms linear; + transition: opacity 700ms linear; } .navbar a { color: #263238; } @@ -5039,6 +5070,13 @@ a.text-gray-dark:focus, a.text-gray-dark:hover { .display-2 { margin-bottom: 4rem; } + @media (max-width: 991px) { + .display-2 { + font-size: 32px; } } + +@media (max-width: 991px) { + .display-4 { + font-size: 14px; } } .bg-progress { background-image: -webkit-linear-gradient(left, #fbc02d, #ff8f00); @@ -5052,42 +5090,56 @@ section.intro { background-position: center top; position: relative; } section.intro .branding { - padding-top: 192px; + padding-top: 6rem; margin-bottom: 64px; text-align: center; color: #546e7a; } + @media (min-width: 768px) { + section.intro .branding { + padding-top: 192px; } } section.intro .branding h1 { font-weight: 300 !important; color: #263238; } + @media (max-width: 991px) { + section.intro .branding h1 { + font-size: 4.5rem; } } section.intro .branding h1 strong { font-weight: 700 !important; } section.intro .branding h1:before { content: ""; - height: 120px; - width: 93px; + height: 60px; + width: 76px; background-image: url("../img/ipfire-tux.png"); background-repeat: no-repeat; background-position: center center; background-size: contain; - margin-right: 32px; display: inline-block; position: relative; - top: 8px; } + top: 4px; } + @media (min-width: 768px) { + section.intro .branding h1:before { + height: 120px; + width: 93px; + margin-right: 32px; + top: 8px; } } section.intro .page-scroll { position: absolute; bottom: 48px; - width: 66px; left: 50%; -webkit-transform: translateX(-50%); transform: translateX(-50%); } section.intro .page-scroll .btn { - width: 64px; - height: 64px; + width: 32px; + height: 32px; fill: #b71c1c; } + @media (min-width: 768px) { + section.intro .page-scroll .btn { + width: 64px; + height: 64px; } } section.intro .page-scroll .btn:hover { fill: white; } section.intro .page-scroll .btn svg { - width: 24px; + width: 12px; height: auto; position: absolute; top: 50%; @@ -5095,6 +5147,9 @@ section.intro { transform: translate(-50%, -60%); -webkit-animation: scroll 3s infinite; animation: scroll 3s infinite; } + @media (min-width: 768px) { + section.intro .page-scroll .btn svg { + width: 24px; } } section.content-section { padding: 96px 0; } @@ -5183,21 +5238,6 @@ footer { -webkit-transform: translate(-50%, -60%); transform: translate(-50%, -60%); } } -.donate small { - display: inline-block; - -webkit-transform: translateY(-2px); - transform: translateY(-2px); } - .donate small:before { - content: ""; - width: 20px; - height: 19px; - margin-right: 8px; - display: inline-block; - background-image: url("../img/icons/icon-heart-filled-white.svg"); - background-size: cover; - -webkit-transform: translateY(5px); - transform: translateY(5px); } - .btn-red900 { color: #fff !important; background-color: #b71c1c; @@ -5257,3 +5297,7 @@ footer { background-color: #11171a; background-image: none; border-color: #0d1114; } + +@media (max-width: 991px) { + p.lead { + font-size: 1rem; } } diff --git a/static/scss/bootstrap-4.0.0-alpha.6/scss/_custom.scss b/static/scss/bootstrap-4.0.0-alpha.6/scss/_custom.scss index 7446ce3..2285122 100755 --- a/static/scss/bootstrap-4.0.0-alpha.6/scss/_custom.scss +++ b/static/scss/bootstrap-4.0.0-alpha.6/scss/_custom.scss @@ -109,7 +109,7 @@ $small-font-size: .875rem; $btn-padding-x: 1rem; $btn-padding-y: .5rem !default; -$btn-line-height: 1.25 !default; +$btn-line-height: .95; $btn-font-weight: $font-weight-normal !default; $btn-box-shadow: none; $btn-focus-box-shadow: none; diff --git a/static/scss/style.scss b/static/scss/style.scss index 571157d..4115900 100644 --- a/static/scss/style.scss +++ b/static/scss/style.scss @@ -69,8 +69,25 @@ } } +.btn-outline-primary, +.btn-outline-secondary { + transition: background-color .25s ease-in-out; + &:hover { + transition: background-color .25s ease-in-out; + } +} + .btn-lg { margin: 0 24px; + @include media-breakpoint-down(md) { + margin: 0 8px; + font-size: 14px; + } +} + +.btn-sm small { + display: inline-block; + transform: translateY(-2px); } .btn-block { @@ -79,10 +96,24 @@ .fixed-top { transition: background-color 700ms linear; + .navbar { + width: 100%; + } + .navbar-brand { + opacity: 0; + transition: opacity 700ms linear; + @include media-breakpoint-up(lg) { + opacity: 1; + } + } } .scrolled { background-color: rgba(255, 255, 255, .96); + .navbar-brand { + opacity: 1; + transition: opacity 700ms linear; + } } .navbar { @@ -105,6 +136,15 @@ .display-2 { margin-bottom: 4rem; + @include media-breakpoint-down(md) { + font-size: 32px; + } +} + +.display-4 { + @include media-breakpoint-down(md) { + font-size: 14px; + } } .bg-progress { @@ -119,51 +159,68 @@ section.intro { background-position: center top; position: relative; .branding { - padding-top: 192px; + padding-top: 6rem; + @include media-breakpoint-up(md) { + padding-top: 192px; + } margin-bottom: 64px; text-align: center; color: $blue-grey-600; h1 { font-weight: 300 !important; color: $blue-grey-900; + @include media-breakpoint-down(md) { + font-size: 4.5rem; + } strong { font-weight: 700 !important; } } h1:before { content: ""; - height: 120px; - width: 93px; + height: 60px; + width: 76px; background-image: url('../img/ipfire-tux.png'); background-repeat: no-repeat; background-position: center center; background-size: contain; - margin-right: 32px; display: inline-block; position: relative; - top: 8px; + top: 4px; + @include media-breakpoint-up(md) { + height: 120px; + width: 93px; + margin-right: 32px; + top: 8px; + } } } .page-scroll { position: absolute; bottom: 48px; - width: 66px; left: 50%; transform: translateX(-50%); .btn { - width: 64px; - height: 64px; + width: 32px; + height: 32px; fill: $red_900; + @include media-breakpoint-up(md) { + width: 64px; + height: 64px; + } &:hover { fill: white; } svg { - width: 24px; + width: 12px; height: auto; position: absolute; top: 50%; transform: translate(-50%, -60%); animation: scroll 3s infinite; + @include media-breakpoint-up(md) { + width: 24px; + } } } } @@ -258,21 +315,6 @@ footer { 100% { transform: translate(-50%, -60%); } } -.donate small { - display: inline-block; - transform: translateY(-2px); - &:before { - content: ""; - width: 20px; - height: 19px; - margin-right: 8px; - display: inline-block; - background-image: url('../img/icons/icon-heart-filled-white.svg'); - background-size: cover; - transform: translateY(5px); - } -} - .btn-red900 { @include button-variant($btn-red900-color, $btn-red900-bg, $btn-red900-border); } @@ -281,4 +323,10 @@ footer { } .btn-bluegrey900 { @include button-variant($btn-bluegrey900-color, $btn-bluegrey900-bg, $btn-bluegrey900-border); +} + +p.lead { + @include media-breakpoint-down(md) { + font-size: 1rem; + } } \ No newline at end of file diff --git a/templates/base.html b/templates/base.html index 62ec599..3e47bae 100644 --- a/templates/base.html +++ b/templates/base.html @@ -12,7 +12,6 @@ - @@ -25,13 +24,13 @@
-
@@ -65,7 +67,7 @@