From 242b2ce3a8432a66726baf561026ecb49d1ecc7d Mon Sep 17 00:00:00 2001 From: Nicolas Humblot Date: Thu, 29 Apr 2021 22:00:06 +0200 Subject: [PATCH] #99 Fade in then fade out with css --- src/views/vmd-rdv.view.scss | 11 +++++++++++ src/views/vmd-rdv.view.ts | 26 +++----------------------- 2 files changed, 14 insertions(+), 23 deletions(-) diff --git a/src/views/vmd-rdv.view.scss b/src/views/vmd-rdv.view.scss index eafef0183..e6f85ba73 100644 --- a/src/views/vmd-rdv.view.scss +++ b/src/views/vmd-rdv.view.scss @@ -91,6 +91,17 @@ } } +.fade-in-then-fade-out { + animation-name: fade-in-then-fade-out; + animation-duration: 10s; + animation-fill-mode: forwards; +} + +@keyframes fade-in-then-fade-out { + 0%, 100% {opacity: 0} + 10%, 90% {opacity: 1} +} + vmd-appointment-card { display: block; opacity: 1; diff --git a/src/views/vmd-rdv.view.ts b/src/views/vmd-rdv.view.ts index 636954be3..e90b407cb 100644 --- a/src/views/vmd-rdv.view.ts +++ b/src/views/vmd-rdv.view.ts @@ -55,9 +55,6 @@ export abstract class AbstractVmdRdvView extends LitElement { protected derniereCommuneSelectionnee: Commune|undefined = undefined; - private eligibilityCriteriaTimeout: number|undefined = undefined; - private eligibilityCriteriaDisplayed: boolean = true; - get communeSelectionnee(): Commune|undefined { if(this.derniereCommuneSelectionnee) { return this.derniereCommuneSelectionnee; @@ -80,10 +77,6 @@ export abstract class AbstractVmdRdvView extends LitElement { protected firstUpdated(_changedProperties: PropertyValues) { super.firstUpdated(_changedProperties); - this.eligibilityCriteriaTimeout = setTimeout(async () => { - this.eligibilityCriteriaDisplayed = false; - await this.requestUpdate(); - }, 10000); } protected getDepartementSelectionne(): Departement|undefined { @@ -251,21 +244,13 @@ export abstract class AbstractVmdRdvView extends LitElement { })} ` : html``} - ${this.renderEligibilityCriteria()} +
+

Les critères d'éligibilité sont vérifiés lors de la prise de rendez-vous

+
`} `; } - private renderEligibilityCriteria() { - if (this.eligibilityCriteriaDisplayed) { - return html` -
-

Les critères d'éligibilité sont vérifiés lors de la prise de rendez-vous

-
`; - } - - return ``; - } onCommuneAutocompleteLoaded(autocompletes: string[]): Promise { return Promise.resolve(); } @@ -338,11 +323,6 @@ export abstract class AbstractVmdRdvView extends LitElement { disconnectedCallback() { super.disconnectedCallback(); - - if (this.eligibilityCriteriaTimeout) { - clearTimeout(this.eligibilityCriteriaTimeout); - this.eligibilityCriteriaTimeout = undefined; - } } _onRefreshPageWhenValidParams(): "return"|"continue" {