Skip to content
Snippets Groups Projects
Commit e887c1fd authored by Pierre-Jean CHANCELLIER's avatar Pierre-Jean CHANCELLIER
Browse files

reduce lexique search on scroll

parent 4669ef83
No related branches found
No related tags found
No related merge requests found
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
<main class="container"> <main class="container">
<div class="rech-lexique row pb-3"> <div class="rech-lexique row pb-3">
<div class="col-md-6 mx-auto"> <div class="col-md-6 mx-auto">
<h2 class="text-center my-5 font-weight-light">{{ $t("lexique") }}</h2> <h2 class="text-center font-weight-light">{{ $t("lexique") }}</h2>
<BtnSearch v-model="search" :help="$t('recherche.desc.lexicon')" /> <BtnSearch v-model="search" :help="$t('recherche.desc.lexicon')" />
</div> </div>
</div> </div>
...@@ -120,6 +120,15 @@ export default { ...@@ -120,6 +120,15 @@ export default {
return retour return retour
} }
}, },
beforeMount() {
window.addEventListener("scroll", function (e) {
if (window.scrollY > 20) {
$(".rech-lexique").addClass("reduced")
} else {
$(".rech-lexique").removeClass("reduced")
}
})
},
mounted() { mounted() {
$nuxt.$emit("changeRoute", this.breadcrumb) $nuxt.$emit("changeRoute", this.breadcrumb)
} }
...@@ -131,7 +140,17 @@ export default { ...@@ -131,7 +140,17 @@ export default {
position: sticky; position: sticky;
top: var(--paddingTop); top: var(--paddingTop);
background: var(--background-color-primary); background: var(--background-color-primary);
h2 {
margin: 3rem 0;
transition: margin 0.3s ease-in-out;
}
&.reduced h2 {
margin: 0.5rem 0;
}
} }
th { th {
min-width: 200px; min-width: 200px;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment