mutualisons quelques styles et js

This commit is contained in:
chankalan 2021-06-10 18:07:44 +02:00
parent 65e1d552f8
commit 1d6b24efd2
7 changed files with 35 additions and 29 deletions

View File

@ -1,7 +1,7 @@
<paquet
prefix="baz_april"
categorie="squelette"
version="2.4.8"
version="2.4.9"
schema="1.0.1"
etat="stable"
compatibilite="[3.2.0;4.0.*]"

View File

@ -24,11 +24,17 @@ $(function() {
});
// un sous-menu dans initiatives : .menu-entree.sousinitiatives > .menu-items__lien.sousinitiatives
// .menu-entree.sousinitiatives > ul > li > a
$('.page_wrapper').append('<div class="menucache"></div>');
$('.menu-items__lien.sousinitiatives').on('click', function(){
$('.menucache').addClass('cache');
$(this).toggleClass('actif');
$(this).siblings('ul').toggleClass('ouvert');
$(this).parent().siblings('.sousinitiatives').find('ul.ouvert').removeClass('ouvert');
});
$('.menucache').on('click', function(){
$('.menucache').removeClass('cache');
$('.menu-items__lien.sousinitiatives').removeClass('actif').siblings('ul').removeClass('ouvert');
});
// placer le html du bouton du menu, visible < medium
$('.nav.principale').prepend('<button type="button" class="btn-nav"><span class="ham"></span>MENU</button>');
@ -55,27 +61,6 @@ $(function() {
});
});
// smooth scroll
// $('a[href^="#"], .js-scrollTo').on('click', function(e) {
// if($(this).hasClass('js-noscroll')) {
// return;
// }
// var hash = this.hash;
// var $target = $(hash);
// var offset = $target.offset();
// if(!offset) {
// $target = $('a[name='+hash.replace(/#/,'')+']');
// offset = $target.offset();
// }
// if(offset) {
// e.preventDefault();
// var newPos = offset.top - 10;
// $('html, body').stop().animate(
// {'scrollTop': newPos}, 750, 'swing', function() {
// window.location.hash = hash;
// });
// }
// });
// champ de recherche dans le menu
$('.loupe > a').on('click', function(){

View File

@ -91,7 +91,7 @@ ol {
}
ul ul, ol ol {
margin-bottom: 0;
/* margin-bottom: 0; */
}
dt {
@ -357,7 +357,7 @@ video {
/*
* Remove default fieldset styles.
*/
fieldset {
fieldset, figure {
border: 0;
margin: 0;
padding: 0;

View File

@ -43,7 +43,7 @@ html, body {
right:0;
background-color:$couleurPrincipale;
color:white;
z-index: 10;
}
@include media($bp-medium-up) {

View File

@ -55,6 +55,18 @@
.pagination { margin:0 0 1rem; }
}
.menucache {
display: none;
position: fixed;
left: 0;
top: 0px;
width: 100%;
height: 100%;
background:transparent;
z-index:8;
cursor:pointer;
&.cache { display:block;}
}
// menu smart cf js/script.js
// ----------------------------------------
.btn-nav {
@ -82,7 +94,7 @@
.nav {
padding-top:($spacer/2);
font-size:0.95rem;
z-index:10;
z-index:7;
@include media($bp-medium-up) {
position:relative;
}
@ -227,7 +239,7 @@
right:0;
background-color:$couleurPrincipale;
color:white;
z-index:9;
.btn-initiatives {
font-size:0.8rem;
display:none;
@ -275,7 +287,6 @@
top:-999em;
left:0;
width:150px;
z-index:9;
&.ouvert {
top:23px;
li {

View File

@ -145,7 +145,7 @@ a.back-to-top {
height: 66px;
right: 20px;
bottom: 20px;
z-index: 999;
z-index: 8;
text-indent: -9999px;
background: url("../images/back-top.png") no-repeat center;
outline: none;
@ -155,6 +155,15 @@ a.back-to-top {
}
}
.flex {
@include flex;
flex-wrap:wrap;
justify-content:space-between;
}
.flex3 > * {
max-width:30%;
}
// ------------------------------------------------
// Affichage de valeurs de formulaires

View File

@ -272,6 +272,7 @@
@error "Direction must be either `top`, `right`, `bottom` or `left`.";
}
display:block;
width: 0;
height: 0;
content: '';