From b3f83db1205a0c292e044fe649bb4e08943d84de Mon Sep 17 00:00:00 2001 From: bach Date: Mon, 15 Jan 2024 14:40:25 +0100 Subject: [PATCH] more cartouche lisibility improvements: header lables hide on scroll #2325 --- src/assets/main.scss | 64 ++++++++++++++--------- src/components/contents/TerrainDeVie.vue | 25 +++++++-- src/components/layout/CartoucheLayout.vue | 20 +++++-- 3 files changed, 75 insertions(+), 34 deletions(-) diff --git a/src/assets/main.scss b/src/assets/main.scss index 845c926..8de888e 100644 --- a/src/assets/main.scss +++ b/src/assets/main.scss @@ -272,12 +272,13 @@ body{ font-weight: bold; } } - span.menacemaintient{ - display: block; - font-weight: 100; - font-size: 0.882em; - padding: 1em 0; - } + // span.menacemaintient{ + // display: block; + // font-weight: 100; + // font-size: 0.882em; + // padding: 1em 0; + // } + } div.concernement-cartouche-icons{ h2{ @@ -286,29 +287,40 @@ body{ // &.faded{ // font-weight: 100; // } + padding-bottom: 0.5em; } - nav.icons{ - ul{ - display: flex; - flex-direction: row; - li{ - margin: 0.4em 0.6em 0 0; - >svg{ - display: inline-block; - $d: 35px; - width:$d; height:$d; - border-radius: $d * 0.5; - background-color: #fff; - padding: 2px; - box-sizing: border-box; - color: #333; - // font-size: 2em; - } - } - } + // nav.icons{ + // ul{ + // display: flex; + // flex-direction: row; + // li{ + // margin: 0.4em 0.6em 0 0; + // >svg{ + // display: inline-block; + // $d: 35px; + // width:$d; height:$d; + // border-radius: $d * 0.5; + // background-color: #fff; + // padding: 2px; + // box-sizing: border-box; + // color: #333; + // // font-size: 2em; + // } + // } + // } + // } + } + label{ + display: block; + height:auto; + transition: max-height 0.5s ease-in-out,padding 0.5s ease-in-out; + max-height: 100px; + overflow: hidden; + &.hidden{ + max-height: 0; + padding-bottom: 0; } } - } >main{ diff --git a/src/components/contents/TerrainDeVie.vue b/src/components/contents/TerrainDeVie.vue index c6ebe6c..5a50002 100644 --- a/src/components/contents/TerrainDeVie.vue +++ b/src/components/contents/TerrainDeVie.vue @@ -32,6 +32,7 @@ export default { infos_opened: false, chevronright_path: mdiChevronRight, chevrondown_path: mdiChevronDown, + mainscrolled: false, } }, computed: { @@ -53,6 +54,15 @@ export default { }, display_concernement(){ return this.ct_concernement && !this.entite && this.map_mode !== 'puissancedagir' && this.map_mode !== 'doleancer'; + }, + entity_title_label(){ + let str; + if (this.concernement.entites_byid[this.eid].menacemaintien > 0) { + str = 'maintenu'; + } else { + str = 'menacé' + } + return `Pouvez-vous nommer par qui ou par quoi cet élément est ${str} ?`; } }, created () { @@ -90,7 +100,14 @@ export default { } else { this.history_slider_ops = null; } + }, + // mounted(){ + // console.log('terrain de vie mounted', this); + // // this.$refs.cartouche_main.addEventListener('scroll', (event) => { + // // console.log('main is scrolling', event); + // // }) + // }, watch: { history_value: { handler (n, o) { @@ -142,6 +159,9 @@ export default { .catch(error => { console.warn('Issue with load entite', error) }) + }, + onMainScrolled(scrolled){ + this.mainscrolled = scrolled; } }, components: { @@ -155,12 +175,11 @@ export default {