Added image fullscreen modals and style updates
This commit is contained in:
1 parent
659ab2a975
commit
5bbadfef1c
7 files changed
+240
-67
No files matched your search
@@ -1,22 +1,60 @@
|
||||
import {AfterViewInit, Component, Inject, OnDestroy, OnInit, PLATFORM_ID} from '@angular/core';
|
||||
import {VantaBackgroundService} from '../shared/services/vanta-background.service';
|
||||
import {DeviceDetectorService} from '../shared/services/device-detector.service';
|
||||
import {isPlatformBrowser, NgStyle} from '@angular/common';
|
||||
import {CommonModule, isPlatformBrowser, NgStyle} from '@angular/common';
|
||||
import {Title} from '@angular/platform-browser';
|
||||
import {AudioPlayerComponent} from '../shared/audio-player/audio-player.component';
|
||||
import {TranslatePipe} from '@ngx-translate/core';
|
||||
import {animate, stagger, style, transition, trigger, query} from '@angular/animations';
|
||||
|
||||
@Component({
|
||||
selector: 'app-portfolio',
|
||||
imports: [
|
||||
NgStyle,
|
||||
AudioPlayerComponent,
|
||||
TranslatePipe
|
||||
TranslatePipe,
|
||||
CommonModule
|
||||
],
|
||||
templateUrl: './portfolio.component.html',
|
||||
styleUrl: './portfolio.component.css'
|
||||
styleUrl: './portfolio.component.css',
|
||||
animations: [
|
||||
trigger('fadeInOut', [
|
||||
transition(':enter', [
|
||||
style({ opacity: 0, transform: 'translateY(20px)' }),
|
||||
animate('0.5s ease-out', style({ opacity: 1, transform: 'translateY(0)' }))
|
||||
]),
|
||||
transition(':leave', [
|
||||
animate('0.3s ease-in', style({ opacity: 0, transform: 'translateY(20px)' }))
|
||||
])
|
||||
]),
|
||||
trigger('staggerGallery', [
|
||||
transition(':enter', [
|
||||
query('.gallery-item', [
|
||||
style({ opacity: 0, transform: 'translateY(20px)' }),
|
||||
stagger(100, [
|
||||
animate('0.5s ease-out', style({ opacity: 1, transform: 'translateY(0)' }))
|
||||
])
|
||||
], {
|
||||
optional: true
|
||||
})
|
||||
])
|
||||
])
|
||||
]
|
||||
})
|
||||
export class PortfolioComponent implements OnInit, OnDestroy, AfterViewInit {
|
||||
galleryItems = [
|
||||
{ src: '/assets/design1.png', alt: 'Design 1', label: 'Abstract Background' },
|
||||
{ src: '/assets/design2.png', alt: 'Design 2', label: 'Profile Picture Design' },
|
||||
{ src: '/assets/design3.png', alt: 'Design 3', label: 'Pixelart Canvas' },
|
||||
{ src: '/assets/design4.png', alt: 'Design 4', label: 'Profile Picture Design 2' },
|
||||
{ src: '/assets/design5.png', alt: 'Design 5', label: 'Social Media Banner' },
|
||||
{ src: '/assets/design6.png', alt: 'Design 6', label: 'Logo Design' },
|
||||
{ src: '/assets/design7.png', alt: 'Design 7', label: 'Clipart Design' },
|
||||
{ src: 'https://opengraph.githubassets.com/1/itzMiney/itzmineydev', alt: 'Frontend', label: 'itzMiney.dev Frontend' },
|
||||
{ src: 'https://opengraph.githubassets.com/1/Hideout-Codeworks/DoritoBot', alt: 'DoritoBot', label: 'DoritoBot' },
|
||||
];
|
||||
selectedItem: any = null;
|
||||
showModal = false;
|
||||
private readonly elementId = 'vanta-portfolio-bg';
|
||||
isMobile: boolean = false;
|
||||
constructor(
|
||||
@@ -51,4 +89,14 @@ export class PortfolioComponent implements OnInit, OnDestroy, AfterViewInit {
|
||||
// Update the minHeight and minWidth when the window is resized
|
||||
this.vantaService.resizeVanta(this.elementId);
|
||||
}
|
||||
|
||||
openModal(item: any) {
|
||||
this.selectedItem = item;
|
||||
this.showModal = true;
|
||||
}
|
||||
|
||||
closeModal() {
|
||||
this.selectedItem = null;
|
||||
this.showModal = false;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user