Updated Admin & Login Page design, also finally disabled mouse & touch controls for bg effect for Mrxikaiba

This commit is contained in:
ItzMineyy committed 2024-12-28 13:40:54 +01:00
1 parent 0907f0b66b
commit f9e0eb32db
11 files changed
+85 -32

No files matched your search

+2 -2
View File
@@ -69,8 +69,8 @@ export class AboutComponent implements OnInit, OnDestroy, AfterViewInit {
// Initialize the Vanta effect on the element with ID 'vanta-bg' // Initialize the Vanta effect on the element with ID 'vanta-bg'
this.vantaEffect = window.VANTA.NET({ this.vantaEffect = window.VANTA.NET({
el: '#vanta-about-bg', el: '#vanta-about-bg',
mouseControls: true, mouseControls: false,
touchControls: true, touchControls: false,
gyroControls: false, gyroControls: false,
scale: 1.00, scale: 1.00,
scaleMobile: 1.00, scaleMobile: 1.00,
+18 -4
View File
@@ -11,7 +11,7 @@
.admin-container { .admin-container {
background: #fff; background: #fff;
border-radius: 8px; border-radius: 25px;
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1); box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
padding: 40px; padding: 40px;
width: 350px; width: 350px;
@@ -25,17 +25,31 @@
} }
.admin-actions button { .admin-actions button {
background-color: #4CAF50; background-color: #bd3948;
color: white; color: white;
padding: 12px 20px; padding: 12px 20px;
margin: 10px; margin: 10px;
border: none; border: none;
border-radius: 5px; border-radius: 25px;
cursor: pointer; cursor: pointer;
} }
.admin-actions button:hover { .admin-actions button:hover {
background-color: #45a049; background-color: #e3485a;
}
.logout button {
background-color: #713252;
color: white;
padding: 12px 20px;
margin: 10px;
border: none;
border-radius: 25px;
cursor: pointer;
}
.logout button:hover {
background-color: #592840;
} }
.articles-list { .articles-list {
+15 -7
View File
@@ -5,17 +5,25 @@
<div class="admin-actions"> <div class="admin-actions">
<button (click)="createArticle()">Create Article</button> <button (click)="createArticle()">Create Article</button>
<button (click)="viewArticles()">View Articles</button> <button (click)="viewArticles()">View Articles</button>
<button (click)="logout()">Logout</button> <button (click)="editArticle()">Edit Article</button>
<button (click)="deleteArticle()">Delete Article</button>
</div> </div>
<div *ngIf="articles && articles.length > 0"> <div *ngIf="noArticles">
<h3>Articles</h3> <p>No articles available.</p> <!-- Show message if no articles -->
<div class="articles-list">
<div *ngFor="let article of articles" class="article">
<h4>{{ article.title }}</h4>
<p>{{ article.content }}</p>
</div> </div>
<div *ngIf="!noArticles">
<ul>
<li *ngFor="let article of articles">
<!-- Display article details here -->
{{ article.title }}
</li>
</ul>
</div> </div>
<div class="logout">
<button (click)="logout()">Logout</button>
</div> </div>
</div> </div>
</div> </div>
+10
View File
@@ -16,6 +16,7 @@ import { HttpClientModule } from '@angular/common/http';
}) })
export class AdminComponent implements OnInit { export class AdminComponent implements OnInit {
articles: any[] = []; articles: any[] = [];
noArticles: boolean = false;
constructor(private articleService: ArticleService, private router: Router) {} constructor(private articleService: ArticleService, private router: Router) {}
@@ -34,6 +35,7 @@ export class AdminComponent implements OnInit {
this.articleService.getArticles(token).subscribe( this.articleService.getArticles(token).subscribe(
(data) => { (data) => {
this.articles = data; this.articles = data;
this.noArticles = this.articles.length === 0;
}, },
(error) => { (error) => {
console.error('Failed to load articles', error); console.error('Failed to load articles', error);
@@ -45,6 +47,14 @@ export class AdminComponent implements OnInit {
alert('Create article functionality goes here'); alert('Create article functionality goes here');
} }
editArticle() {
alert('Delete article functionality goes here');
}
deleteArticle() {
alert('Delete article functionality goes here');
}
viewArticles() { viewArticles() {
this.fetchArticles(); this.fetchArticles();
} }
+3 -3
View File
@@ -1,8 +1,8 @@
<ng-container *ngIf="!isMobile; else mobileNavbar"> <ng-container *ngIf="!isMobile; else mobileNavbar">
<app-navbar></app-navbar> <app-navbar *ngIf="showNavbar" ></app-navbar>
</ng-container> </ng-container>
<ng-template #mobileNavbar> <ng-template #mobileNavbar>
<app-mobile-navbar></app-mobile-navbar> <app-mobile-navbar *ngIf="showNavbar"></app-mobile-navbar>
</ng-template> </ng-template>
<router-outlet /> <router-outlet />
<app-footer></app-footer> <app-footer *ngIf="showFooter"></app-footer>
+19
View File
@@ -8,6 +8,7 @@ import {FooterComponent} from './footer/footer.component';
import { Title, Meta } from '@angular/platform-browser'; import { Title, Meta } from '@angular/platform-browser';
import { filter, map, mergeMap } from 'rxjs/operators'; import { filter, map, mergeMap } from 'rxjs/operators';
import { isPlatformBrowser } from '@angular/common'; import { isPlatformBrowser } from '@angular/common';
import {subscribe} from 'node:diagnostics_channel';
@Component({ @Component({
selector: 'app-root', selector: 'app-root',
@@ -18,6 +19,9 @@ import { isPlatformBrowser } from '@angular/common';
export class AppComponent implements OnInit { export class AppComponent implements OnInit {
isMobile: boolean; isMobile: boolean;
showNavbar: boolean = true;
showFooter: boolean = true;
constructor( constructor(
private deviceService: DeviceDetectorService, private deviceService: DeviceDetectorService,
private router: Router, private router: Router,
@@ -60,7 +64,9 @@ export class AppComponent implements OnInit {
meta.color = meta.color || '#eb284c'; meta.color = meta.color || '#eb284c';
} }
this.updateMetaTags(meta); this.updateMetaTags(meta);
this.checkRoute();
}); });
this.checkRoute();
} }
updateMetaTags(meta: { title?: string; description?: string; image?: string; url?: string; color?: string }) { updateMetaTags(meta: { title?: string; description?: string; image?: string; url?: string; color?: string }) {
@@ -83,4 +89,17 @@ export class AppComponent implements OnInit {
this.metaService.updateTag({ name: 'theme-color', content: meta.color}); this.metaService.updateTag({ name: 'theme-color', content: meta.color});
} }
} }
checkRoute() {
const currentRoute = this.activatedRoute.snapshot.firstChild?.routeConfig?.path;
// Hide navbar and footer on admin route
if (currentRoute === 'admin'||'login') {
this.showNavbar = false;
this.showFooter = false;
} else {
this.showNavbar = true;
this.showFooter = true;
}
}
} }
+2 -2
View File
@@ -70,8 +70,8 @@ export class BlogComponent implements OnInit, OnDestroy, AfterViewInit {
// Initialize the Vanta effect on the element with ID 'vanta-bg' // Initialize the Vanta effect on the element with ID 'vanta-bg'
this.vantaEffect = window.VANTA.NET({ this.vantaEffect = window.VANTA.NET({
el: '#vanta-blog-bg', el: '#vanta-blog-bg',
mouseControls: true, mouseControls: false,
touchControls: true, touchControls: false,
gyroControls: false, gyroControls: false,
scale: 1.00, scale: 1.00,
scaleMobile: 1.00, scaleMobile: 1.00,
+10 -8
View File
@@ -16,7 +16,7 @@
/* Login Form Styles */ /* Login Form Styles */
.login-container { .login-container {
background: #fff; background: #fff;
border-radius: 8px; border-radius: 25px;
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1); box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
padding: 40px; padding: 40px;
width: 300px; width: 300px;
@@ -31,29 +31,31 @@ h2 {
} }
input { input {
width: 100%; width: 92%;
padding: 10px; padding: 10px;
margin: 10px 0; margin: 10px 0;
border: 1px solid #ccc; border: 1px solid #ccc;
border-radius: 4px; border-radius: 25px;
} }
button { button {
width: 100%; width: 50%;
padding: 10px; padding: 10px;
background-color: #4CAF50; margin-top: 20px;
background-color: #5a39bd;
color: white; color: white;
border: none; border: none;
border-radius: 4px; border-radius: 25px;
cursor: pointer; cursor: pointer;
} }
button:disabled { button:disabled {
background-color: #ccc; background-color: #ccc;
cursor: not-allowed;
} }
button:hover { button:hover:enabled {
background-color: #45a049; background-color: #4e17ef;
} }
.error-message { .error-message {
+2 -2
View File
@@ -72,8 +72,8 @@ export class LoginComponent implements OnInit, OnDestroy, AfterViewInit {
// Initialize the Vanta effect on the element with ID 'vanta-bg' // Initialize the Vanta effect on the element with ID 'vanta-bg'
this.vantaEffect = window.VANTA.NET({ this.vantaEffect = window.VANTA.NET({
el: '#vanta-login-bg', el: '#vanta-login-bg',
mouseControls: true, mouseControls: false,
touchControls: true, touchControls: false,
gyroControls: false, gyroControls: false,
scale: 1.00, scale: 1.00,
scaleMobile: 1.00, scaleMobile: 1.00,
+2 -2
View File
@@ -68,8 +68,8 @@ export class NotFoundComponent implements OnInit, OnDestroy, AfterViewInit {
// Initialize the Vanta effect on the element with ID 'vanta-bg' // Initialize the Vanta effect on the element with ID 'vanta-bg'
this.vantaEffect = window.VANTA.NET({ this.vantaEffect = window.VANTA.NET({
el: '#vanta-not-found-bg', el: '#vanta-not-found-bg',
mouseControls: true, mouseControls: false,
touchControls: true, touchControls: false,
gyroControls: false, gyroControls: false,
scale: 1.00, scale: 1.00,
scaleMobile: 1.00, scaleMobile: 1.00,
+2 -2
View File
@@ -70,8 +70,8 @@ export class PortfolioComponent implements OnInit, OnDestroy, AfterViewInit {
// Initialize the Vanta effect on the element with ID 'vanta-bg' // Initialize the Vanta effect on the element with ID 'vanta-bg'
this.vantaEffect = window.VANTA.NET({ this.vantaEffect = window.VANTA.NET({
el: '#vanta-portfolio-bg', el: '#vanta-portfolio-bg',
mouseControls: true, mouseControls: false,
touchControls: true, touchControls: false,
gyroControls: false, gyroControls: false,
scale: 1.00, scale: 1.00,
scaleMobile: 1.00, scaleMobile: 1.00,