-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
62 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,14 @@ | ||
<div class="mx-auto max-w-7xl px-4 sm:px-6 lg:px-8 pb-16 pt-20 text-center lg:pt-32"> | ||
<h1 class="mx-auto max-w-4xl font-display text-5xl font-medium tracking-tight text-slate-900 sm:text-7xl"> | ||
<div class="text-center lg:pt-32"> | ||
<h1 class="font-display text-5xl font-medium tracking-tight text-slate-900 sm:text-7xl"> | ||
Bienvenue chez les petits chats ! | ||
<fa-icon [icon]="faPaw"></fa-icon> | ||
</h1> | ||
<p class="mx-auto mt-6 max-w-2xl text-lg tracking-tight text-slate-700"> | ||
Notre plateforme regroupe les annonces de divers associations afin de vous aider à trouver votre nouveau | ||
<p class="text-center text-lg tracking-tight text-slate-700"> | ||
Notre plateforme regroupe les annonces de diverses associations afin de vous aider à trouver votre nouveau | ||
compagnon. | ||
</p> | ||
<div class="mt-10 flex justify-center gap-x-6"> | ||
<a class="group inline-flex items-center justify-center rounded-full py-2 px-4 text-sm font-semibold focus:outline-none focus-visible:outline-2 focus-visible:outline-offset-2 bg-slate-900 text-white hover:bg-slate-700 hover:text-slate-100 active:bg-slate-800 active:text-slate-300 focus-visible:outline-slate-900" | ||
variant="solid" color="slate" routerLink="/animaux">Voir tout les animaux</a> | ||
variant="solid" color="slate" routerLink="/animaux">Voir tous les animaux</a> | ||
</div> | ||
|
||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
// no-header-footer.directive.ts | ||
import { | ||
Directive, | ||
Input, | ||
OnInit, | ||
OnDestroy, | ||
ElementRef, | ||
Renderer2, | ||
} from '@angular/core'; | ||
import { Router, NavigationEnd } from '@angular/router'; | ||
import { Subscription } from 'rxjs'; | ||
|
||
@Directive({ | ||
selector: '[noHeaderFooter]', | ||
}) | ||
export class NoHeaderFooterDirective implements OnInit, OnDestroy { | ||
@Input() restrictedRoutes: string[] = []; | ||
|
||
private subscription: Subscription = new Subscription(); | ||
|
||
constructor( | ||
private el: ElementRef, | ||
private renderer: Renderer2, | ||
private router: Router | ||
) {} | ||
|
||
ngOnInit() { | ||
this.checkVisibility(); | ||
this.subscription = this.router.events.subscribe((event) => { | ||
if (event instanceof NavigationEnd) { | ||
this.checkVisibility(); | ||
} | ||
}); | ||
} | ||
|
||
ngOnDestroy() { | ||
this.subscription.unsubscribe(); | ||
} | ||
|
||
private checkVisibility() { | ||
const currentRoute = this.router.url; | ||
const shouldHide = this.restrictedRoutes.includes(currentRoute); | ||
if (shouldHide) { | ||
this.renderer.setStyle(this.el.nativeElement, 'display', 'none'); | ||
} else { | ||
this.renderer.setStyle(this.el.nativeElement, 'display', 'block'); | ||
} | ||
} | ||
} |