Made Mobile Detection more robust

This commit is contained in:
ItzMineyy committed 2024-12-25 18:05:51 +01:00
1 parent 4422cf448b
commit 2782cb4d45
7 files changed
+35 -18

No files matched your search

+4
View File
@@ -1,11 +1,15 @@
<div id="vanta-blog-bg"></div>
<div class="container" id="container">
<ng-container *ngIf="!isMobile; else mobileError">
<div class="error-message" *ngIf="!isMobile">
<h1>Soon&#8482;</h1>
<p>Under Construction!</p>
</div>
</ng-container>
<ng-template #mobileError>
<div class="error-message-mobile" *ngIf="isMobile">
<h1>Soon&#8482;</h1>
<p>Under Construction!</p>
</div>
</ng-template>
</div>
+2 -2
View File
@@ -22,12 +22,12 @@ export class BlogComponent implements OnInit, OnDestroy, AfterViewInit {
private route: ActivatedRoute,
@Inject(PLATFORM_ID) private platformId: Object
) {
this.isMobile = this.deviceService.isMobile();
}
isMobile: boolean;
isMobile: boolean = false;
private vantaEffect: any;
ngOnInit() {
this.isMobile = this.deviceService.isMobile();
const metaData = this.route.snapshot.data['meta'];
if (metaData?.title) {
this.title.setTitle(metaData.title);