Made Mobile Detection more robust
This commit is contained in:
1 parent
4422cf448b
commit
2782cb4d45
7 files changed
+35
-18
No files matched your search
@@ -1,13 +1,17 @@
|
||||
<div id="vanta-portfolio-bg"></div>
|
||||
<div class="portfolio-container">
|
||||
<ng-container *ngIf="!isMobile; else mobileContainer">
|
||||
<div class="portfolio-header" *ngIf="!isMobile">
|
||||
<h1>My Portfolio</h1>
|
||||
<p class="subtitle">Projects & Designs</p>
|
||||
</div>
|
||||
</ng-container>
|
||||
<ng-template #mobileContainer>
|
||||
<div class="portfolio-header-mobile" *ngIf="isMobile">
|
||||
<h1>My Portfolio</h1>
|
||||
<p class="subtitle">Projects & Designs</p>
|
||||
</div>
|
||||
</ng-template>
|
||||
<div class="text-content">
|
||||
<p>
|
||||
Welcome to my portfolio!<br><br>
|
||||
|
||||
@@ -22,12 +22,12 @@ export class PortfolioComponent 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);
|
||||
|
||||
Reference in new issue
Block a user