Style overhaul, added built in socials page

This commit is contained in:
itzMiney committed 2025-01-05 05:09:06 +01:00
1 parent d9489d9d6b
commit a0532d7300
16 files changed
+226 -30

No files matched your search

+51
View File
@@ -0,0 +1,51 @@
import {AfterViewInit, Component, Inject, OnDestroy, OnInit, PLATFORM_ID} from '@angular/core';
import {isPlatformBrowser, NgOptimizedImage, NgStyle} from '@angular/common';
import {VantaBackgroundService} from '../services/vanta-background.service';
import {DeviceDetectorService} from '../services/device-detector.service';
import {Title} from '@angular/platform-browser';
@Component({
selector: 'app-socials',
imports: [
NgStyle,
NgOptimizedImage
],
templateUrl: './socials.component.html',
styleUrl: './socials.component.css'
})
export class SocialsComponent implements OnInit, OnDestroy, AfterViewInit {
private readonly elementId = 'vanta-socials-bg';
isMobile: boolean = false;
constructor(
private vantaService: VantaBackgroundService,
private deviceService: DeviceDetectorService,
private titleService: Title,
@Inject(PLATFORM_ID) private platformId: Object
) {}
ngOnInit() {
this.titleService.setTitle('Socials | itzMiney');
this.isMobile = this.deviceService.isMobile;
if (isPlatformBrowser(this.platformId)) {
window.addEventListener('resize', this.onResize.bind(this));
}
}
ngAfterViewInit() {
this.vantaService.initVanta(this.elementId, {
color: 0xc3b65c,
backgroundColor: 0x23153c
});
}
ngOnDestroy() {
this.vantaService.destroyVanta(this.elementId);
if (isPlatformBrowser(this.platformId)) {
window.removeEventListener('resize', this.onResize);
}
}
onResize() {
this.vantaService.resizeVanta(this.elementId);
}
}