Merge pull request #297 from sgmap/251_fix_landing_on_mobile

Fix #251, fix landing design on mobile (and add responsive)
This commit is contained in:
gregoirenovel 2017-05-17 18:09:38 +02:00 committed by GitHub
commit 7499f2a899
25 changed files with 197 additions and 128 deletions

View file

@ -1,4 +1,4 @@
exclude: 'app/assets/stylesheets/reset.scss' exclude: 'app/assets/stylesheets/new_design/reset.scss'
linters: linters:
BangFormat: BangFormat:

View file

@ -3,5 +3,3 @@ $light-blue: #F2F6FA;
// Bootstrap constants // Bootstrap constants
$font-size-base: 16px; $font-size-base: 16px;
$page-width: 1040px;

View file

@ -1,14 +0,0 @@
%horizontal-list {
list-style-type: none;
margin: 0;
padding: 0;
font-size: 0px;
}
%horizontal-list-item {
display: inline-block;
&:last-of-type {
margin-right: 0;
}
}

View file

@ -13,13 +13,8 @@
// file per style scope. // file per style scope.
// //
// = require _card // = require _card
// = require _colors
// = require _constants
// = require _helpers // = require _helpers
// = require _mixins
// = require _placeholders
// = require _turbolinks // = require _turbolinks
// = require _typography
// = require admin_procedures_modal // = require admin_procedures_modal
// = require admin_type_de_champ // = require admin_type_de_champ
// = require backoffice // = require backoffice
@ -31,9 +26,7 @@
// = require dossier_show // = require dossier_show
// = require dossiers // = require dossiers
// = require etapes // = require etapes
// = require fonts
// = require france_connect_particulier // = require france_connect_particulier
// = require landing
// = require left_panel // = require left_panel
// = require login // = require login
// = require main_container // = require main_container

View file

@ -1,10 +0,0 @@
// = require reset
// = require custom_reset
// = require common
// = require utils
// = require fonts
// = require new_alert
// = require new_header
// = require new_footer
// = require landing
// = require navbar

View file

@ -0,0 +1,3 @@
$page-width: 1040px;
$default-padding: 15px;

View file

@ -0,0 +1,21 @@
@import "constants";
@import "mixins";
%horizontal-list {
list-style-type: none;
margin: 0;
padding: 0;
font-size: 0px;
display: flex;
flex-wrap: wrap;
}
%horizontal-list-item {
display: inline-block;
}
%page-width-container {
@include horizontal-padding($default-padding);
max-width: $page-width + 2 * $default-padding;
margin: 0 auto;
}

View file

@ -0,0 +1,15 @@
#beta {
text-align: center;
text-transform: uppercase;
position: fixed;
bottom: 26px;
right: -35px;
transform: rotate(-45deg);
width: 150px;
background-color: #008CBA;
color: #FFFFFF;
padding: 5px;
font-size: 15px;
font-weight: 700;
z-index: 10;
}

View file

@ -12,12 +12,30 @@
} }
.landing-panel-inner-content { .landing-panel-inner-content {
width: $page-width; @extend %page-width-container;
margin: 0 auto; }
$landing-breakpoint: 1040px;
.hero-wrapper {
display: flex;
flex-wrap: wrap;
justify-content: space-between;
@media (max-width: $landing-breakpoint) {
justify-content: center;
}
}
.hero-text {
max-width: 500px;
@media (max-width: $landing-breakpoint) {
margin: auto;
}
} }
.hero-tagline { .hero-tagline {
width: 500px;
font-size: 30px; font-size: 30px;
margin-bottom: 0px; margin-bottom: 0px;
} }
@ -29,12 +47,16 @@
font-weight: bold; font-weight: bold;
} }
.hero-text {
width: 500px;
}
.hero-illustration { .hero-illustration {
width: 500px; max-width: 500px;
img {
max-width: 100%;
}
@media (max-width: 1030px) {
margin: auto;
}
} }
.hero-button { .hero-button {
@ -69,6 +91,7 @@
} }
.landing-panel-title { .landing-panel-title {
width: 100%;
font-size: 30px; font-size: 30px;
font-weight: normal; font-weight: normal;
text-align: center; text-align: center;
@ -86,15 +109,22 @@
.features { .features {
@extend %horizontal-list; @extend %horizontal-list;
} width: 100%;
align-items: baseline;
justify-content: space-between;
$feature-width: 320px; @media (max-width: $landing-breakpoint) {
$features-count: 3; justify-content: center;
}
}
.feature { .feature {
@extend %horizontal-list-item; @extend %horizontal-list-item;
width: $feature-width; width: 320px;
margin-right: calc((#{$page-width} - (#{$feature-width} * #{$features-count})) / (#{$features-count} - 1));
@media (max-width: $landing-breakpoint) {
margin: 15px 20px;
}
} }
.feature-text { .feature-text {
@ -116,18 +146,27 @@ $features-count: 3;
.quotes { .quotes {
@extend %horizontal-list; @extend %horizontal-list;
} width: 100%;
justify-content: space-between;
$quote-width: 500px; @media (max-width: $landing-breakpoint) {
$quote-count: 2; justify-content: center;
}
}
.quote { .quote {
@extend %horizontal-list-item; @extend %horizontal-list-item;
width: $quote-width; max-width: 500px;
margin-right: calc((#{$page-width} - (#{$quote-width} * #{$quote-count}))/ (#{$quote-count} - 1));
background-color: #FFFFFF; background-color: #FFFFFF;
box-shadow: 0 4px 16px 0 rgba(153, 153, 153, 0.2); box-shadow: 0 4px 16px 0 rgba(153, 153, 153, 0.2);
padding: 24px; padding: 24px;
display: flex;
justify-content: flex-start;
align-items: flex-start;
@media (max-width: $landing-breakpoint) {
margin: 15px 0;
}
} }
.quote-quotation-mark { .quote-quotation-mark {
@ -136,13 +175,16 @@ $quote-count: 2;
.quote-content { .quote-content {
font-size: 18px; font-size: 18px;
width: 388px;
margin-bottom: 24px; margin-bottom: 24px;
} }
.quote-content-wrapper {
margin-left: 20px;
width: 100%;
}
.quote-author { .quote-author {
font-size: 14px; font-size: 14px;
margin-left: 64px;
} }
.quote-author-name { .quote-author-name {
@ -155,16 +197,18 @@ $quote-count: 2;
.numbers { .numbers {
@extend %horizontal-list; @extend %horizontal-list;
justify-content: space-around;
width: 100%;
} }
$number-width: 320px;
$number-count: 3;
.number { .number {
@extend %horizontal-list-item; @extend %horizontal-list-item;
width: $number-width; width: 320px;
margin-right: calc((#{$page-width} - (#{$number-width} * #{$number-count}))/ (#{$number-count} - 1));
text-align: center; text-align: center;
@media (max-width: $landing-breakpoint) {
margin-bottom: 15px;
}
} }
.number-value { .number-value {
@ -178,25 +222,33 @@ $number-count: 3;
font-size: 20px; font-size: 20px;
} }
$users-breakpoint: 950px;
.users { .users {
@extend %horizontal-list; @extend %horizontal-list;
} justify-content: space-between;
width: 100%;
$image-width: 170px; @media (max-width: $users-breakpoint) {
$images-total-width: $image-width * 5; justify-content: space-around;
$images-count: 5; }
}
.user { .user {
@extend %horizontal-list-item; @extend %horizontal-list-item;
margin-right: calc((#{$page-width} - (#{$images-total-width}))/ (#{$images-count} - 1)); width: 170px;
&:hover { &:hover {
opacity: 0.6; opacity: 0.6;
} }
@media (max-width: $users-breakpoint) {
margin: 0 15px 15px;
}
} }
.user-image { .user-image {
width: $image-width; width: 170px;
} }
.cta-panel { .cta-panel {
@ -204,6 +256,13 @@ $images-count: 5;
color: #FFFFFF; color: #FFFFFF;
} }
.cta-panel-wrapper {
width: 100%;
display: flex;
flex-wrap: wrap;
justify-content: space-between;
}
.cta-panel-title { .cta-panel-title {
font-size: 24px; font-size: 24px;
font-weight: bold; font-weight: bold;
@ -212,22 +271,21 @@ $images-count: 5;
.cta-panel-explanation { .cta-panel-explanation {
font-size: 24px; font-size: 24px;
margin-bottom: 0; margin-bottom: 10px;
} }
$cta-panel-button-height: 60px;
$cta-panel-button-border-size: 2px; $cta-panel-button-border-size: 2px;
.cta-panel-button { .cta-panel-button {
@include horizontal-padding(30px); @include horizontal-padding(30px);
display: block; display: block;
height: $cta-panel-button-height; padding: 10px;
line-height: $cta-panel-button-height - (2 * $cta-panel-button-border-size); border-radius: 100px;
border-radius: $cta-panel-button-height;
border: $cta-panel-button-border-size solid #FFFFFF; border: $cta-panel-button-border-size solid #FFFFFF;
color: #FFFFFF; color: #FFFFFF;
font-size: 24px; font-size: 24px;
text-align: center;
&:hover { &:hover {
color: #FFFFFF; color: #FFFFFF;

View file

@ -0,0 +1,6 @@
// = require ./reset
// = require ./custom_reset
// = require ./common
// = require ./utils
// = require ./fonts
// = require_tree .

View file

@ -10,23 +10,25 @@
} }
.footer-inner-content { .footer-inner-content {
width: $page-width; @extend %page-width-container;
margin: 0 auto;
} }
.footer-columns { .footer-columns {
@extend %horizontal-list; @extend %horizontal-list;
justify-content: flex-start;
} }
$footer-column-width: 320px;
$footer-column-count: 3;
.footer-column { .footer-column {
@extend %horizontal-list-item; @extend %horizontal-list-item;
width: $footer-column-width;
margin-right: calc((#{$page-width} - (#{$footer-column-width} * #{$footer-column-count})) / (#{$footer-column-count} - 1));
font-size: 14px; font-size: 14px;
vertical-align: top; vertical-align: top;
flex-grow: 1;
min-width: 320px;
@media (max-width: 1000px) {
width: 100%;
margin-bottom: 14px;
}
} }
.footer-logos, .footer-logos,

View file

@ -1,6 +1,7 @@
@import "constants"; @import "constants";
@import "colors"; @import "colors";
@import "mixins"; @import "mixins";
@import "placeholders";
// FIXME: Rename when the header is generalized // FIXME: Rename when the header is generalized
.new-header { .new-header {
@ -13,8 +14,9 @@
} }
.header-inner-content { .header-inner-content {
width: $page-width; @extend %page-width-container;
margin: 0 auto; display: flex;
justify-content: space-between;
} }
.header-logo { .header-logo {

View file

@ -1,7 +1,5 @@
.new-header{ class: current_page?(root_path) ? nil : 'new-header-with-border' } .new-header{ class: current_page?(root_path) ? nil : 'new-header-with-border' }
.header-inner-content .header-inner-content
%img.header-logo.pull-left{ src: image_url("header/logo-tps.svg") } %img.header-logo{ src: image_url("header/logo-tps.svg") }
= link_to "Connexion", new_user_session_path, :class => "header-login-button pull-right" = link_to "Connexion", new_user_session_path, class: "header-login-button"
.clear-fix

View file

@ -3,6 +3,7 @@
%meta{ "http-equiv" => "Content-Type", :content => "text/html; charset=UTF-8" } %meta{ "http-equiv" => "Content-Type", :content => "text/html; charset=UTF-8" }
%meta{ "http-equiv" => "X-UA-Compatible", :content => "IE=edge" } %meta{ "http-equiv" => "X-UA-Compatible", :content => "IE=edge" }
%meta{ :name => "turbolinks-cache-control", :content => "no-cache" } %meta{ :name => "turbolinks-cache-control", :content => "no-cache" }
%meta{ name: "viewport", content: "width=device-width, initial-scale=1" }
= csrf_meta_tags = csrf_meta_tags
= action_cable_meta_tag = action_cable_meta_tag
@ -13,7 +14,7 @@
= favicon_link_tag(image_url("favicons/32x32.png"), type: "image/png", sizes: "32x32") = favicon_link_tag(image_url("favicons/32x32.png"), type: "image/png", sizes: "32x32")
= favicon_link_tag(image_url("favicons/96x96.png"), type: "image/png", sizes: "96x96") = favicon_link_tag(image_url("favicons/96x96.png"), type: "image/png", sizes: "96x96")
= stylesheet_link_tag "new_application", :media => "all", "data-turbolinks-track" => true = stylesheet_link_tag "new_design/new_application", :media => "all", "data-turbolinks-track" => true
= stylesheet_link_tag "print", :media => "print", "data-turbolinks-track" => true = stylesheet_link_tag "print", :media => "print", "data-turbolinks-track" => true
%body %body

View file

@ -1,23 +1,22 @@
.landing .landing
.landing-panel.hero-panel .landing-panel.hero-panel
.landing-panel-inner-content .landing-panel-inner-content
.hero-text.pull-left .hero-wrapper
%p.hero-tagline .hero-text
%em.hero-tagline-em Dématérialisez %p.hero-tagline
%br %em.hero-tagline-em Dématérialisez
vos procédures administratives en quelques minutes %br
vos procédures administratives en quelques minutes
= link_to "Demander une démo", = link_to "Demander une démo",
"mailto:#{t("dynamics.contact_email")}?subject=Demande de démo TPS", "mailto:#{t("dynamics.contact_email")}?subject=Demande de démo TPS",
:class => "hero-button" :class => "hero-button"
%p.hero-phone-cta %p.hero-phone-cta
ou nous appeler au 01 40 15 68 49 ou nous appeler au 01 40 15 68 49
.hero-illustration.pull-right .hero-illustration
%img{ :src => image_url("landing/hero/dematerialiser.svg") } %img{ :src => image_url("landing/hero/dematerialiser.svg") }
.clearfix
.landing-panel.features-panel .landing-panel.features-panel
.landing-panel-inner-content .landing-panel-inner-content
@ -55,28 +54,26 @@
%ul.quotes %ul.quotes
%li.quote %li.quote
%img.quote-quotation-mark.pull-left{ :src => image_url("landing/testimonials/quotation-mark.svg") } %img.quote-quotation-mark{ :src => image_url("landing/testimonials/quotation-mark.svg") }
%p.quote-content.pull-right .quote-content-wrapper
TPS est un outil de dématérialisation adapté au dépôt de dossiers de demande dinscription au registre des transporteurs routiers en Ile-de-France. Les échanges avec les usagers sont facilités, ce qui permet de réduire les délais dinstructions et de gagner en efficacité. %p.quote-content
.clearfix TPS est un outil de dématérialisation adapté au dépôt de dossiers de demande dinscription au registre des transporteurs routiers en Ile-de-France. Les échanges avec les usagers sont facilités, ce qui permet de réduire les délais dinstructions et de gagner en efficacité.
%p.quote-author.pull-left %p.quote-author
%span.quote-author-name Elodie Le Rhun %span.quote-author-name Elodie Le Rhun
%br %br
Chef de bureau, DRIEA Ile-de-France Chef de bureau, DRIEA Ile-de-France
.clearfix
%li.quote %li.quote
%img.quote-quotation-mark.pull-left{ :src => image_url("landing/testimonials/quotation-mark.svg") } %img.quote-quotation-mark{ :src => image_url("landing/testimonials/quotation-mark.svg") }
%p.quote-content.pull-right .quote-content-wrapper
TPS cest surtout lassurance dun dialogue en toute fluidité et en toute transparence entre les porteurs de projet et ladministration. Un service qui garantit une économie de temps et beaucoup moins de manipulations des dossiers. %p.quote-content
.clearfix TPS cest surtout lassurance dun dialogue en toute fluidité et en toute transparence entre les porteurs de projet et ladministration. Un service qui garantit une économie de temps et beaucoup moins de manipulations des dossiers.
%p.quote-author.pull-left %p.quote-author
%span.quote-author-name Nadja Briki %span.quote-author-name Nadja Briki
%br %br
Déléguée de la Préfète du Pas-de-Calais Déléguée de la Préfète du Pas-de-Calais
.clearfix
- cache "numbers-panel", :expires_in => 3.hours do - cache "numbers-panel", :expires_in => 3.hours do
.landing-panel.numbers-panel .landing-panel.numbers-panel
@ -128,14 +125,13 @@
.landing-panel.cta-panel .landing-panel.cta-panel
.landing-panel-inner-content .landing-panel-inner-content
.pull-right .cta-panel-wrapper
= link_to "Demander une démo", %div
"mailto:#{t('dynamics.contact_email')}?subject=Demande de démo TPS", %h1.cta-panel-title Commencez à dématerialiser vos procédures
:class => "cta-panel-button" %p.cta-panel-explanation Nous vous accompagnons dans la prise en main de loutil
%p.cta-panel-phone-cta %div
ou nous appeler au 01 40 15 68 49 = link_to "Demander une démo",
.pull-left "mailto:#{t('dynamics.contact_email')}?subject=Demande de démo TPS",
%h1.cta-panel-title Commencez à dématerialiser vos procédures :class => "cta-panel-button"
%p.cta-panel-explanation Nous vous accompagnons dans la prise en main de loutil %p.cta-panel-phone-cta
.clearfix ou nous appeler au 01 40 15 68 49

View file

@ -8,4 +8,4 @@ Rails.application.config.assets.version = '1.0'
# Precompile additional assets. # Precompile additional assets.
# application.js, application.css, and all non-JS/CSS in app/assets folder are already added. # application.js, application.css, and all non-JS/CSS in app/assets folder are already added.
Rails.application.config.assets.precompile += %w(print.css new_application.css) Rails.application.config.assets.precompile += %w(print.css new_design/new_application.css)