improvement: add responsive support

This commit is contained in:
Kazhnuz 2019-11-06 16:11:27 +01:00
parent 7198ffb55f
commit e2b99475e6
6 changed files with 424 additions and 284 deletions

View file

@ -22,7 +22,7 @@
<body> <body>
<div id="wrapper"> <div id="wrapper">
<header id="page-header">
<nav class="navbar navbar-expand-lg navbar-dark navbar-transparent"> <nav class="navbar navbar-expand-lg navbar-dark navbar-transparent">
<a class="navbar-brand" href="#">Blue Sky</a> <a class="navbar-brand" href="#">Blue Sky</a>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation"> <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
@ -52,19 +52,15 @@
</div> </div>
</nav> </nav>
<div class="title_area">
<header class="container">
<div class="row">
<h1>Blue Sky</h1> <h1>Blue Sky</h1>
</div> </div>
</header> </header>
<section class="container"> <div id="global-area" class="index-layout">
<div class="row">
<div class="col-md-9">
<main id="page-main">
<nav aria-label="breadcrumb"> <nav aria-label="breadcrumb">
<ol class="breadcrumb"> <ol class="breadcrumb">
<li class="breadcrumb-item"><a href="#">Accueil</a></li> <li class="breadcrumb-item"><a href="#">Accueil</a></li>
@ -73,9 +69,7 @@
</ol> </ol>
</nav> </nav>
<article> <article class="card card-success">
<section class="card card-success">
<div class="card-header"> <div class="card-header">
<h2 class="card-title">Nom de l'article :</h2> <h2 class="card-title">Nom de l'article :</h2>
</div> </div>
@ -108,7 +102,8 @@
<blockquote><p>Cras malesuada, metus at viverra molestie, mi ligula sodales tellus, vitae facilisis ante est vitae dolor. Donec feugiat non est eget elementum. Nullam in erat et arcu tincidunt maximus. Nullam nibh orci, egestas eu ex non, viverra pretium magna. Proin convallis, risus eu condimentum luctus, ante dui mattis eros, a varius risus diam sed nisl. Ut malesuada ipsum in augue accumsan ullamcorper. Phasellus efficitur augue in venenatis sollicitudin. Integer at consectetur arcu.</p></blockquote> <blockquote><p>Cras malesuada, metus at viverra molestie, mi ligula sodales tellus, vitae facilisis ante est vitae dolor. Donec feugiat non est eget elementum. Nullam in erat et arcu tincidunt maximus. Nullam nibh orci, egestas eu ex non, viverra pretium magna. Proin convallis, risus eu condimentum luctus, ante dui mattis eros, a varius risus diam sed nisl. Ut malesuada ipsum in augue accumsan ullamcorper. Phasellus efficitur augue in venenatis sollicitudin. Integer at consectetur arcu.</p></blockquote>
<pre><code>Vivamus tincidunt dolor quis consectetur dapibus. <pre><code>
Vivamus tincidunt dolor quis consectetur dapibus.
Ut metus risus, lobortis non venenatis in, ultricies a orci. Ut metus risus, lobortis non venenatis in, ultricies a orci.
In suscipit ante et aliquet pretium. In suscipit ante et aliquet pretium.
Integer diam dui, rutrum vitae risus ultricies, varius vulputate magna. Integer diam dui, rutrum vitae risus ultricies, varius vulputate magna.
@ -117,7 +112,7 @@ In id suscipit elit.</code></pre>
<p id="1">[1] : Sed et odio volutpat, convallis est et, interdum sapien.</p> <p id="1">[1] : Sed et odio volutpat, convallis est et, interdum sapien.</p>
</div> </div>
</section> </article>
<section class="share-buttons align-right"> <section class="share-buttons align-right">
<a href="#" class="btn btn-facebook"><i class="fa fa-fw fa-facebook"></i></a> <a href="#" class="btn btn-facebook"><i class="fa fa-fw fa-facebook"></i></a>
@ -136,9 +131,7 @@ In id suscipit elit.</code></pre>
</div> </div>
</section> </section>
</article> <div class="previews-section">
<div class="previews-section prev-col-3">
<div class="preview-container"> <div class="preview-container">
<article class="card card-preview"> <article class="card card-preview">
@ -160,8 +153,8 @@ In id suscipit elit.</code></pre>
<article class="card card-preview"> <article class="card card-preview">
<a href="#" class="preview-link"> <a href="#" class="preview-link">
<div class="preview-item"> <div class="preview-item">
<div class="preview-content"><p>Proin bibendum felis sit amet nisl iaculis, <strong>vel blandit purus dictum</strong>. Maecenas ullamcorper tortor ac dolor pulvinar, id imperdiet arcu suscipit. Sed posuere lectus eu orci tristique maximus. Nulla facilisi. Aenean sed fermentum nisl. Donec sodales ligula eu est finibus, eu posuere ligula condimentum. Morbi arcu magna, varius id justo ac, aliquam luctus magna. Pellentesque a velit et ipsum euismod congue eget eu sem. <del>Nulla luctus est nec arcu volutpat blandit.</del> Quisque egestas, elit eu tempus tincidunt, mi libero porta purus, eget lobortis metus erat a dolor. Integer ac turpis lacinia, interdum nisl non, feugiat libero.</p></div> <div class="preview-content"><p class="p-img"><img src="img/wmap.png" alt="Card image cap"></p></div>
<div class="preview-overlay"><h1>Text Exemple</h1></div> <div class="preview-overlay"><h1>Image Exemple</h1></div>
</div> </div>
</a> </a>
<aside class="card-body"> <aside class="card-body">
@ -176,24 +169,8 @@ In id suscipit elit.</code></pre>
<article class="card card-preview"> <article class="card card-preview">
<a href="#" class="preview-link"> <a href="#" class="preview-link">
<div class="preview-item"> <div class="preview-item">
<div class="preview-content"><p>Proin bibendum felis sit amet nisl iaculis, <strong>vel blandit purus dictum</strong>. Maecenas ullamcorper tortor ac dolor pulvinar, id imperdiet arcu suscipit. Sed posuere lectus eu orci tristique maximus. Nulla facilisi. Aenean sed fermentum nisl. Donec sodales ligula eu est finibus, eu posuere ligula condimentum. Morbi arcu magna, varius id justo ac, aliquam luctus magna. Pellentesque a velit et ipsum euismod congue eget eu sem. <del>Nulla luctus est nec arcu volutpat blandit.</del> Quisque egestas, elit eu tempus tincidunt, mi libero porta purus, eget lobortis metus erat a dolor. Integer ac turpis lacinia, interdum nisl non, feugiat libero.</p></div> <div class="preview-content"><p class="p-img"><img src="img/wmap.png" alt="Card image cap"></p></div>
<div class="preview-overlay"><h1>Text Exemple</h1></div> <div class="preview-overlay"><h1>Image Exemple</h1></div>
</div>
</a>
<aside class="card-body">
<div class="align-right"><time><small>Le 27/02/2017</small></time></div>
<div class="align-left"><i class="fa fa-tags"></i>&nbsp; <a href="" class="badge badge-primary">categorie</a> <a href="" class="badge badge-primary">categorie</a> <a href="" class="badge badge-primary">categorie</a> <a href="" class="badge badge-info">mot-clef</a> <a href="" class="badge badge-info">mot-clef</a> <a href="" class="badge badge-info">mot-clef</a> <a href="" class="badge badge-info">mot-clef</a> </div>
<div class="align-center comment-text"><a href="#">3 commentaires</a></div>
</aside>
</article>
</div>
<div class="preview-container">
<article class="card card-preview">
<a href="#" class="preview-link">
<div class="preview-item">
<div class="preview-content"><p>Proin bibendum felis sit amet nisl iaculis, <strong>vel blandit purus dictum</strong>. Maecenas ullamcorper tortor ac dolor pulvinar, id imperdiet arcu suscipit. Sed posuere lectus eu orci tristique maximus. Nulla facilisi. Aenean sed fermentum nisl. Donec sodales ligula eu est finibus, eu posuere ligula condimentum. Morbi arcu magna, varius id justo ac, aliquam luctus magna. Pellentesque a velit et ipsum euismod congue eget eu sem. <del>Nulla luctus est nec arcu volutpat blandit.</del> Quisque egestas, elit eu tempus tincidunt, mi libero porta purus, eget lobortis metus erat a dolor. Integer ac turpis lacinia, interdum nisl non, feugiat libero.</p></div>
<div class="preview-overlay"><h1>Text Exemple</h1></div>
</div> </div>
</a> </a>
<aside class="card-body"> <aside class="card-body">
@ -221,22 +198,11 @@ In id suscipit elit.</code></pre>
</div> </div>
</article> </article>
</section>
<article class="card comment"> </main>
<div class="media card-meta">
<div class="media-left"><a href="#"><img class="media-object" src="img/avatar.png" alt="..."></a></div>
<div class="media-body"><author class="media-heading">Écrit par <a href="" >Pseudo</a></author><time> Le vendredi 19 septembre 2014 à 07:16 </time></div>
</div>
<div class="card-body">
<p><em>Lorem ipsum dolor sit amet<sup><a href="#1">[1]</a></sup>, consectetur adipiscing elit. Praesent varius ullamcorper diam, non sagittis lectus rutrum id. Integer eros urna, egestas et libero a, finibus egestas odio. Nunc vel hendrerit quam, eget malesuada sem. Sed hendrerit ligula pharetra leo aliquam volutpat. Integer auctor urna ac convallis laoreet. Nunc vestibulum ipsum sed tortor aliquam porta. Cras nunc est, lobortis in est at, rhoncus auctor nunc. Sed dignissim erat non sollicitudin ultricies. Integer vel consectetur urna. Etiam fermentum ligula vitae nunc viverra, a fringilla sem aliquam. Suspendisse potenti. Morbi sem mi, malesuada quis odio vitae, suscipit congue metus. Sed ut ullamcorper urna, eget molestie est. Sed pulvinar justo ac urna consectetur fringilla. Donec tristique eget leo sit amet mollis.</em></p>
<p>Proin bibendum felis sit amet nisl iaculis, <strong>vel blandit purus dictum</strong>. Maecenas ullamcorper tortor ac dolor pulvinar, id imperdiet arcu suscipit. <mark>Sed posuere lectus eu orci tristique maximus</mark>. Nulla facilisi. Aenean sed fermentum nisl. Donec sodales ligula eu est finibus, eu posuere ligula condimentum. Morbi arcu magna, varius id justo ac, aliquam luctus magna. Pellentesque a velit et ipsum euismod congue eget eu sem. <del>Nulla luctus est nec arcu volutpat blandit.</del> Quisque egestas, elit eu tempus tincidunt, mi libero porta purus, eget lobortis metus erat a dolor. Integer ac turpis lacinia, interdum nisl non, feugiat libero.</p> <div id="page-sidebar">
</div>
</article>
</div>
<aside class="sidebar col-md-3">
<section class="card card-primary"> <section class="card card-primary">
<div class="card-header"> <div class="card-header">
<h3 class="card-title">Catégories</h3> <h3 class="card-title">Catégories</h3>
@ -286,15 +252,12 @@ In id suscipit elit.</code></pre>
</section> </section>
</aside>
</div> </div>
</section> </div>
</div> </div>
<footer class="container"> <footer id="page-footer">
<ul class="social"> <ul class="social">
<li class="social-li"><a class="social-link" href="https://twitter.com/kazhnuz" alt="Twitter"><i class="fa fa-fw fa-twitter"></i></a></li> <li class="social-li"><a class="social-link" href="https://twitter.com/kazhnuz" alt="Twitter"><i class="fa fa-fw fa-twitter"></i></a></li>
@ -322,9 +285,6 @@ In id suscipit elit.</code></pre>
</footer> </footer>
<!-- jQuery (necessary for Bootstrap's JavaScript plugins) --> <!-- jQuery (necessary for Bootstrap's JavaScript plugins) -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script>
<!-- Include all compiled plugins (below), or include individual files as needed --> <!-- Include all compiled plugins (below), or include individual files as needed -->

View file

@ -23,6 +23,68 @@ $baseline: 1.5;
$baselinerem: $baseline * 1rem; $baselinerem: $baseline * 1rem;
$baseheight: 18px; $baseheight: 18px;
// MIXINS RESPONSIVES
// Small tablets and large smartphones (landscape view)
$screen-sm-min: 576px;
// Small tablets (portrait view)
$screen-md-min: 768px;
// Tablets and small desktops
$screen-lg-min: 992px;
// Large tablets and desktops
$screen-xl-min: 1200px;
// Very large desktops
$screen-xxl-min: 1600px;
// Small devices
@mixin sm {
@media (min-width: #{$screen-sm-min}) {
@content;
}
}
// Medium devices
@mixin md {
@media (min-width: #{$screen-md-min}) {
@content;
}
}
// Large devices
@mixin lg {
@media (min-width: #{$screen-lg-min}) {
@content;
}
}
// Extra large devices
@mixin xl {
@media (min-width: #{$screen-xl-min}) {
@content;
}
}
// Extra large desktops
@mixin xxl {
@media (min-width: #{$screen-xxl-min}) {
@content;
}
}
// Custom devices
@mixin rwd($screen) {
@media (min-width: $screen+'px' ) {
@content;
}
}
// MIXINS AUTRES
@mixin borders() { @mixin borders() {
border: $border-size solid rgba(0, 0, 0, 0.3); border: $border-size solid rgba(0, 0, 0, 0.3);
} }

View file

@ -8,17 +8,60 @@
// A modifier pour customiser le style facilement : // A modifier pour customiser le style facilement :
$background-color: get-color("skyblue");
$sidebar-size:300px;
$max-size: 1600px;
$wrapper-padding: $baselinerem * 3;
// Mixins
@mixin row() {
max-width: $max-size;
margin: auto;
}
@mixin row-grid() {
@include row();
@include xl {
display: grid;
grid-template-rows: auto;
row-gap: $baselinerem;
column-gap: $baselinerem * 2;
}
}
/* 02.1 - Wrapper et page totale */ /* 02.1 - Wrapper et page totale */
$background-color: get-color("skyblue");
#wrapper { #wrapper {
background: $background-color url('img/background.png') center bottom repeat-x; background: $background-color url('img/background.png') center bottom repeat-x;
padding-left:$wrapper-padding/2;
padding-right:$wrapper-padding/2;
@include rwd(1300px) {
padding-left:$wrapper-padding;
padding-right:$wrapper-padding;
}
}
#global-area {
@include row-grid();
&.index-layout {
grid-template-columns: auto $sidebar-size;
grid-template-areas: "main sidebar";
}
} }
/* 02.1 - Header */ /* 02.1 - Header */
#page-header {
@include row();
}
header h1 { header h1 {
border-style:none !important; border-style:none !important;
color:#FFF; color:#FFF;
@ -53,10 +96,19 @@ header h1 {
box-shadow: $narrow-shadow, $inset-shadow; box-shadow: $narrow-shadow, $inset-shadow;
} }
/* 02.2 - Footer */ /* 02.2 - Main Area */
footer { #page-main {
max-width:100%;
}
/* 02.3 - Footer */
#page-footer {
margin-top: $baselinerem; margin-top: $baselinerem;
@include row();
padding-left:$wrapper-padding;
padding-right:$wrapper-padding;
} }
/* social media */ /* social media */

View file

@ -1,11 +1,19 @@
.previews-section { .previews-section {
@include md {
display: grid; display: grid;
grid-template-columns: auto auto auto; grid-template-columns: auto auto;
grid-template-rows: auto; grid-template-rows: auto;
grid-gap: 1.5rem; grid-gap: 1.5rem;
padding-bottom: 1.5rem; padding-bottom: 1.5rem;
} }
@include xxl {
grid-template-columns: auto auto auto;
}
}
.preview-container { .preview-container {
width:100% width:100%
} }
@ -15,6 +23,12 @@
width:100%; width:100%;
margin:auto; margin:auto;
box-shadow: $large-shadow, $inset-shadow; box-shadow: $large-shadow, $inset-shadow;
margin-bottom: 1.5rem;
@include lg {
margin-bottom:0;
}
} }
.preview-link:hover { .preview-link:hover {

View file

@ -470,9 +470,39 @@ mark {
/* 02.1 - Wrapper et page totale */ /* 02.1 - Wrapper et page totale */
#wrapper { #wrapper {
background: #42a0f3 url("img/background.png") center bottom repeat-x; background: #42a0f3 url("img/background.png") center bottom repeat-x;
padding-left: 2.25rem;
padding-right: 2.25rem;
}
@media (min-width: 1300pxpx) {
#wrapper {
padding-left: 4.5rem;
padding-right: 4.5rem;
}
}
#global-area {
max-width: 1600px;
margin: auto;
}
@media (min-width: 1200px) {
#global-area {
display: grid;
grid-template-rows: auto;
row-gap: 1.5rem;
column-gap: 3rem;
}
}
#global-area.index-layout {
grid-template-columns: auto 300px;
grid-template-areas: "main sidebar";
} }
/* 02.1 - Header */ /* 02.1 - Header */
#page-header {
max-width: 1600px;
margin: auto;
}
header h1 { header h1 {
border-style: none !important; border-style: none !important;
color: #FFF; color: #FFF;
@ -508,9 +538,18 @@ header h1 {
box-shadow: 0px 1px 2px rgba(0, 0, 0, 0.3), inset 0px -2px 0px rgba(0, 0, 0, 0.2); box-shadow: 0px 1px 2px rgba(0, 0, 0, 0.3), inset 0px -2px 0px rgba(0, 0, 0, 0.2);
} }
/* 02.2 - Footer */ /* 02.2 - Main Area */
footer { #page-main {
max-width: 100%;
}
/* 02.3 - Footer */
#page-footer {
margin-top: 1.5rem; margin-top: 1.5rem;
max-width: 1600px;
margin: auto;
padding-left: 4.5rem;
padding-right: 4.5rem;
} }
/* social media */ /* social media */
@ -1423,13 +1462,20 @@ a.list-group-item:hover {
color: #FFF; color: #FFF;
} }
@media (min-width: 768px) {
.previews-section { .previews-section {
display: grid; display: grid;
grid-template-columns: auto auto auto; grid-template-columns: auto auto;
grid-template-rows: auto; grid-template-rows: auto;
grid-gap: 1.5rem; grid-gap: 1.5rem;
padding-bottom: 1.5rem; padding-bottom: 1.5rem;
} }
}
@media (min-width: 1600px) {
.previews-section {
grid-template-columns: auto auto auto;
}
}
.preview-container { .preview-container {
width: 100%; width: 100%;
@ -1440,6 +1486,12 @@ a.list-group-item:hover {
width: 100%; width: 100%;
margin: auto; margin: auto;
box-shadow: 0px 1px 3px rgba(0, 0, 0, 0.5), inset 0px -2px 0px rgba(0, 0, 0, 0.2); box-shadow: 0px 1px 3px rgba(0, 0, 0, 0.5), inset 0px -2px 0px rgba(0, 0, 0, 0.2);
margin-bottom: 1.5rem;
}
@media (min-width: 992px) {
.card-preview {
margin-bottom: 0;
}
} }
.preview-link:hover { .preview-link:hover {

File diff suppressed because one or more lines are too long