Skip to content

Commit

Permalink
CovidTrackerFr#99 Fade in then fade out with css
Browse files Browse the repository at this point in the history
  • Loading branch information
nhumblot committed Apr 29, 2021
1 parent b38d39a commit 242b2ce
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 23 deletions.
11 changes: 11 additions & 0 deletions src/views/vmd-rdv.view.scss
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
26 changes: 3 additions & 23 deletions src/views/vmd-rdv.view.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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 {
Expand Down Expand Up @@ -251,21 +244,13 @@ export abstract class AbstractVmdRdvView extends LitElement {
})}
` : html``}
</div>
${this.renderEligibilityCriteria()}
<div class="eligibility-criteria fade-in-then-fade-out">
<p>Les critères d'éligibilité sont vérifiés lors de la prise de rendez-vous</p>
</div>
`}
`;
}

private renderEligibilityCriteria() {
if (this.eligibilityCriteriaDisplayed) {
return html`
<div class="eligibility-criteria">
<p>Les critères d'éligibilité sont vérifiés lors de la prise de rendez-vous</p>
</div>`;
}

return ``;
}
onCommuneAutocompleteLoaded(autocompletes: string[]): Promise<void> {
return Promise.resolve();
}
Expand Down Expand Up @@ -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" {
Expand Down

0 comments on commit 242b2ce

Please sign in to comment.