Initial Commit
This commit is contained in:
1 parent
ae0db346a0
commit
06bc03176b
55 files changed
+1442
-346
No files matched your search
@@ -0,0 +1,32 @@
|
||||
#vanta-blog-bg {
|
||||
transition: opacity 0.3s ease-in-out;
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 100vw; /* Full viewport width */
|
||||
height: 100vh; /* Full viewport height */
|
||||
z-index: -100; /* Place the background behind content */
|
||||
}
|
||||
|
||||
.container {
|
||||
display: flex;
|
||||
height: 100%;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
text-align: center;
|
||||
z-index: 10; /* Ensure the text and button are above the canvas */
|
||||
}
|
||||
|
||||
.error-message h1 {
|
||||
font-size: 10rem;
|
||||
margin: 0;
|
||||
font-weight: 700;
|
||||
color: white;
|
||||
}
|
||||
|
||||
.error-message p {
|
||||
font-size: 1.5rem;
|
||||
margin: 20px 0;
|
||||
font-weight: 400;
|
||||
color: white;
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
<div id="vanta-blog-bg"></div>
|
||||
<div class="container" id="container">
|
||||
<div class="error-message">
|
||||
<h1>Soon™</h1>
|
||||
<p>Under Construction!</p>
|
||||
</div>
|
||||
</div>
|
||||
@@ -0,0 +1,23 @@
|
||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
|
||||
import { BlogComponent } from './blog.component';
|
||||
|
||||
describe('BlogComponent', () => {
|
||||
let component: BlogComponent;
|
||||
let fixture: ComponentFixture<BlogComponent>;
|
||||
|
||||
beforeEach(async () => {
|
||||
await TestBed.configureTestingModule({
|
||||
imports: [BlogComponent]
|
||||
})
|
||||
.compileComponents();
|
||||
|
||||
fixture = TestBed.createComponent(BlogComponent);
|
||||
component = fixture.componentInstance;
|
||||
fixture.detectChanges();
|
||||
});
|
||||
|
||||
it('should create', () => {
|
||||
expect(component).toBeTruthy();
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,69 @@
|
||||
import {Component, OnInit, OnDestroy, AfterViewInit } from '@angular/core';
|
||||
import {Meta, Title} from '@angular/platform-browser';
|
||||
|
||||
@Component({
|
||||
selector: 'app-blog',
|
||||
imports: [],
|
||||
templateUrl: './blog.component.html',
|
||||
styleUrl: './blog.component.css'
|
||||
})
|
||||
export class BlogComponent implements OnInit, OnDestroy, AfterViewInit {
|
||||
constructor(private titleService: Title, private meta: Meta) {}
|
||||
private vantaEffect: any;
|
||||
|
||||
ngOnInit() {
|
||||
this.titleService.setTitle('Blog | itzMiney');
|
||||
this.meta.updateTag({ name: 'description', content: 'Welcome to my blog!\bI\'ll post occasional updates here on the stuff I\'m currently up to.'});
|
||||
this.meta.updateTag({ property: 'og:image', content: 'https://itzminey.dev/assets/ogimg.png' });
|
||||
|
||||
window.addEventListener('resize', this.onResize.bind(this)); // Add resize listener for responsiveness
|
||||
|
||||
const bgElement = document.getElementById('vanta-blog-bg');
|
||||
if (bgElement) {
|
||||
bgElement.style.position = 'fixed';
|
||||
}
|
||||
}
|
||||
|
||||
ngAfterViewInit() {
|
||||
this.initVanta();
|
||||
this.resizeVanta();
|
||||
}
|
||||
ngOnDestroy() {
|
||||
if (this.vantaEffect) {
|
||||
this.vantaEffect.destroy(); // Clean up the effect on destroy
|
||||
}
|
||||
window.removeEventListener('resize', this.onResize); // Remove the listener when the component is destroyed
|
||||
}
|
||||
|
||||
initVanta() {
|
||||
// Initialize the Vanta effect on the element with ID 'vanta-bg'
|
||||
this.vantaEffect = window.VANTA.NET({
|
||||
el: '#vanta-blog-bg',
|
||||
mouseControls: true,
|
||||
touchControls: true,
|
||||
gyroControls: false,
|
||||
scale: 1.00,
|
||||
scaleMobile: 1.00,
|
||||
points: 20.00,
|
||||
maxDistance: 25.00,
|
||||
spacing: 18.00,
|
||||
showDots: false,
|
||||
minWidth: window.innerWidth,
|
||||
minHeight: window.innerHeight,
|
||||
color: 0xac1f4e,
|
||||
backgroundColor: 0x191522
|
||||
});
|
||||
}
|
||||
|
||||
onResize() {
|
||||
// Update the minHeight and minWidth when the window is resized
|
||||
this.resizeVanta();
|
||||
}
|
||||
|
||||
resizeVanta() {
|
||||
if (this.vantaEffect) {
|
||||
// Trigger the resize on the vanta effect
|
||||
this.vantaEffect.resize();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user