complete visual overhaul
This commit is contained in:
1 parent
02bc2faca0
commit
25d06ec49a
51 files changed
+694
-664
No files matched your search
@@ -9,15 +9,6 @@
|
||||
}
|
||||
}
|
||||
|
||||
#vanta-article-bg {
|
||||
animation: fadeIn 1s ease-out;
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
z-index: -100;
|
||||
}
|
||||
.height-container {
|
||||
display: flex;
|
||||
min-height: 100vh;
|
||||
@@ -68,7 +59,7 @@ h1 {
|
||||
}
|
||||
|
||||
.content-container button {
|
||||
background-color: #713252;
|
||||
background-color: #444893FF;
|
||||
color: #fff;
|
||||
border: none;
|
||||
padding: 10px 20px;
|
||||
@@ -81,7 +72,7 @@ h1 {
|
||||
}
|
||||
|
||||
.content-container button:hover {
|
||||
background-color: #bf9bae;
|
||||
background-color: #707ec5;
|
||||
}
|
||||
|
||||
.error-message h1 {
|
||||
@@ -99,7 +90,7 @@ h1 {
|
||||
}
|
||||
|
||||
.error-message button {
|
||||
background-color: #713252;
|
||||
background-color: #444893FF;
|
||||
color: #fff;
|
||||
border: none;
|
||||
padding: 10px 20px;
|
||||
|
||||
@@ -1,4 +1,10 @@
|
||||
<div id="vanta-article-bg"></div>
|
||||
<app-parallax
|
||||
[baseColor]="'#101522'"
|
||||
[bgGradient]="
|
||||
'radial-gradient(circle 120vw at center, rgba(90,78,130,0.32), transparent 40%), ' +
|
||||
'linear-gradient(180deg,#1b172c 0%, #0b0b0f 100%);'
|
||||
">
|
||||
</app-parallax>
|
||||
<div class="height-container">
|
||||
@if (!loading && article) {
|
||||
<div class="article-container">
|
||||
|
||||
@@ -1,11 +1,10 @@
|
||||
import {AfterViewInit, Component, ElementRef, Inject, OnDestroy, OnInit, PLATFORM_ID, ViewChild} from '@angular/core';
|
||||
import {DeviceDetectorService} from '../../shared/services/device-detector.service'
|
||||
import { DatePipe, isPlatformBrowser, NgStyle } from '@angular/common';
|
||||
import {VantaBackgroundService} from '../../shared/services/vanta-background.service';
|
||||
import {AfterViewInit, Component, ElementRef, OnInit, ViewChild} from '@angular/core';
|
||||
import { DatePipe, NgStyle } from '@angular/common';
|
||||
import {ArticleService} from '../../shared/services/article.service';
|
||||
import {ActivatedRoute} from '@angular/router';
|
||||
import {Title} from '@angular/platform-browser';
|
||||
import {TranslatePipe} from '@ngx-translate/core';
|
||||
import {ParallaxComponent} from '../../shared/parallax/parallax.component';
|
||||
|
||||
interface Article {
|
||||
id: number;
|
||||
@@ -24,17 +23,16 @@ interface Article {
|
||||
imports: [
|
||||
DatePipe,
|
||||
NgStyle,
|
||||
TranslatePipe
|
||||
],
|
||||
TranslatePipe,
|
||||
ParallaxComponent
|
||||
],
|
||||
templateUrl: './article-page.component.html',
|
||||
styleUrl: './article-page.component.css'
|
||||
})
|
||||
export class ArticlePageComponent implements OnInit, OnDestroy, AfterViewInit {
|
||||
export class ArticlePageComponent implements OnInit, AfterViewInit {
|
||||
@ViewChild('articleContent') articleContent!: ElementRef<HTMLDivElement>;
|
||||
selectedImage: string | null = null;
|
||||
private imagesProcessed = false;
|
||||
private readonly elementId = 'vanta-article-bg';
|
||||
isMobile: boolean = false;
|
||||
article: Article | undefined;
|
||||
currentArticle: any;
|
||||
error: boolean = false;
|
||||
@@ -42,18 +40,13 @@ export class ArticlePageComponent implements OnInit, OnDestroy, AfterViewInit {
|
||||
|
||||
loading: boolean = true;
|
||||
constructor(
|
||||
private deviceService: DeviceDetectorService,
|
||||
private vantaService: VantaBackgroundService,
|
||||
private articleService: ArticleService,
|
||||
private titleService: Title,
|
||||
private route: ActivatedRoute,
|
||||
@Inject(PLATFORM_ID) private platformId: Object
|
||||
private route: ActivatedRoute
|
||||
) {
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
this.isMobile = this.deviceService.isMobile;
|
||||
|
||||
this.route.params.subscribe((params) => {
|
||||
const slug = params['slug'];
|
||||
if (slug) {
|
||||
@@ -63,9 +56,6 @@ export class ArticlePageComponent implements OnInit, OnDestroy, AfterViewInit {
|
||||
}
|
||||
});
|
||||
|
||||
if (isPlatformBrowser(this.platformId)) {
|
||||
window.addEventListener('resize', this.onResize.bind(this));
|
||||
}
|
||||
const slug = this.route.snapshot.paramMap.get('slug') || '';
|
||||
this.articleService.getArticleBySlug(slug).subscribe(
|
||||
(article) => {
|
||||
@@ -96,10 +86,6 @@ export class ArticlePageComponent implements OnInit, OnDestroy, AfterViewInit {
|
||||
}
|
||||
|
||||
ngAfterViewInit() {
|
||||
this.vantaService.initVanta(this.elementId, {
|
||||
color: 0xac1f4e,
|
||||
backgroundColor: 0x191522
|
||||
});
|
||||
this.makeImagesClickable();
|
||||
this.imagesProcessed = true;
|
||||
}
|
||||
@@ -123,17 +109,6 @@ export class ArticlePageComponent implements OnInit, OnDestroy, AfterViewInit {
|
||||
this.selectedImage = null;
|
||||
}
|
||||
|
||||
ngOnDestroy() {
|
||||
this.vantaService.destroyVanta(this.elementId);
|
||||
if (isPlatformBrowser(this.platformId)) {
|
||||
window.removeEventListener('resize', this.onResize);
|
||||
}
|
||||
}
|
||||
|
||||
onResize() {
|
||||
this.vantaService.resizeVanta(this.elementId);
|
||||
}
|
||||
|
||||
loadTitleBySlug(slug: string) {
|
||||
this.articleService.getArticleBySlug(slug).subscribe(
|
||||
(article) => {
|
||||
|
||||
@@ -9,16 +9,6 @@
|
||||
}
|
||||
}
|
||||
|
||||
#vanta-blog-bg {
|
||||
animation: fadeIn 1s ease-out;
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 100vw;
|
||||
height: 100vh;
|
||||
z-index: -100;
|
||||
}
|
||||
|
||||
.height-container {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
@@ -42,11 +32,12 @@
|
||||
.blog-header h1 {
|
||||
font-size: 2.5rem;
|
||||
background: transparent;
|
||||
border-bottom: 4px solid white;
|
||||
border-left: 6px solid white;
|
||||
border-right: 6px solid white;
|
||||
border-radius: 12px;
|
||||
margin: 8px auto 8px auto;
|
||||
max-width: 220px;
|
||||
padding: 10px;
|
||||
border-radius: 45px;
|
||||
}
|
||||
|
||||
.blog-container {
|
||||
@@ -60,23 +51,24 @@
|
||||
|
||||
.article-card {
|
||||
z-index: 10;
|
||||
background: linear-gradient(135deg, #501949, #93446e);
|
||||
background: rgba(40, 41, 89, 0.5);
|
||||
padding: 15px;
|
||||
margin: 25px 0;
|
||||
cursor: pointer;
|
||||
border-radius: 45px;
|
||||
border: 4px solid white;
|
||||
border-radius: 45px 25px;
|
||||
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
|
||||
transition: background-color 0.3s, transform 0.2s;
|
||||
}
|
||||
|
||||
.article-card:hover {
|
||||
background: linear-gradient(135deg, #cd376b, #592840);
|
||||
background: linear-gradient(135deg, #4637cd, #282959);
|
||||
transform: translateY(-5px);
|
||||
}
|
||||
|
||||
h2 {
|
||||
font-size: 1.6rem;
|
||||
color: #ffffff;
|
||||
color: white;
|
||||
}
|
||||
|
||||
p {
|
||||
|
||||
@@ -1,4 +1,10 @@
|
||||
<div id="vanta-blog-bg"></div>
|
||||
<app-parallax
|
||||
[baseColor]="'#101522'"
|
||||
[bgGradient]="
|
||||
'radial-gradient(circle 120vw at center, rgba(90,78,130,0.32), transparent 40%), ' +
|
||||
'linear-gradient(180deg,#1b172c 0%, #0b0b0f 100%);'
|
||||
">
|
||||
</app-parallax>
|
||||
<div class="height-container">
|
||||
<div class="blog-header" [ngStyle]="{'margin-top': isMobile ? '72px' : '112px'}">
|
||||
<h1>Blog</h1>
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
import {AfterViewInit, Component, Inject, OnDestroy, OnInit, PLATFORM_ID} from '@angular/core';
|
||||
import {Component, OnInit} from '@angular/core';
|
||||
import {DeviceDetectorService} from '../shared/services/device-detector.service'
|
||||
import { DatePipe, isPlatformBrowser, AsyncPipe, SlicePipe, NgStyle } from '@angular/common';
|
||||
import {VantaBackgroundService} from '../shared/services/vanta-background.service';
|
||||
import { DatePipe, AsyncPipe, SlicePipe, NgStyle } from '@angular/common';
|
||||
import { ArticleService } from '../shared/services/article.service';
|
||||
import { Router } from '@angular/router';
|
||||
import {Observable} from 'rxjs';
|
||||
import {Title} from '@angular/platform-browser';
|
||||
import {TranslatePipe} from '@ngx-translate/core';
|
||||
import {ParallaxComponent} from '../shared/parallax/parallax.component';
|
||||
|
||||
@Component({
|
||||
selector: 'app-blog',
|
||||
@@ -15,30 +15,25 @@ import {TranslatePipe} from '@ngx-translate/core';
|
||||
AsyncPipe,
|
||||
SlicePipe,
|
||||
NgStyle,
|
||||
TranslatePipe
|
||||
],
|
||||
TranslatePipe,
|
||||
ParallaxComponent
|
||||
],
|
||||
templateUrl: './blog.component.html',
|
||||
styleUrl: './blog.component.css'
|
||||
})
|
||||
export class BlogComponent implements OnInit, OnDestroy, AfterViewInit {
|
||||
export class BlogComponent implements OnInit {
|
||||
articles$: Observable<any[]> | undefined;
|
||||
private readonly elementId = 'vanta-blog-bg';
|
||||
isMobile: boolean = false;
|
||||
constructor(
|
||||
private deviceService: DeviceDetectorService,
|
||||
private vantaService: VantaBackgroundService,
|
||||
private articleService: ArticleService,
|
||||
private router: Router,
|
||||
private titleService: Title,
|
||||
@Inject(PLATFORM_ID) private platformId: Object
|
||||
private titleService: Title
|
||||
) {}
|
||||
|
||||
ngOnInit() {
|
||||
this.titleService.setTitle('Blog | itzMiney')
|
||||
this.isMobile = this.deviceService.isMobile;
|
||||
if (isPlatformBrowser(this.platformId)) {
|
||||
window.addEventListener('resize', this.onResize.bind(this));
|
||||
}
|
||||
this.articles$ = this.articleService.getAllArticles();
|
||||
}
|
||||
|
||||
@@ -57,23 +52,6 @@ export class BlogComponent implements OnInit, OnDestroy, AfterViewInit {
|
||||
);
|
||||
}
|
||||
|
||||
ngAfterViewInit() {
|
||||
this.vantaService.initVanta(this.elementId, {
|
||||
color: 0xac1f4e,
|
||||
backgroundColor: 0x191522
|
||||
});
|
||||
}
|
||||
ngOnDestroy() {
|
||||
this.vantaService.destroyVanta(this.elementId);
|
||||
if (isPlatformBrowser(this.platformId)) {
|
||||
window.removeEventListener('resize', this.onResize);
|
||||
}
|
||||
}
|
||||
|
||||
onResize() {
|
||||
this.vantaService.resizeVanta(this.elementId);
|
||||
}
|
||||
|
||||
sanitizeContent(content: string): string {
|
||||
if (!content) return '';
|
||||
return content.replace(/<[^>]*>/g, ' ').replace(/\s+/g, ' ').trim();
|
||||
|
||||
Reference in new issue
Block a user