Updated Admin & Login Page design, also finally disabled mouse & touch controls for bg effect for Mrxikaiba
This commit is contained in:
1 parent
0907f0b66b
commit
f9e0eb32db
11 files changed
+87
-34
No files matched your search
@@ -69,8 +69,8 @@ export class AboutComponent implements OnInit, OnDestroy, AfterViewInit {
|
||||
// Initialize the Vanta effect on the element with ID 'vanta-bg'
|
||||
this.vantaEffect = window.VANTA.NET({
|
||||
el: '#vanta-about-bg',
|
||||
mouseControls: true,
|
||||
touchControls: true,
|
||||
mouseControls: false,
|
||||
touchControls: false,
|
||||
gyroControls: false,
|
||||
scale: 1.00,
|
||||
scaleMobile: 1.00,
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
|
||||
.admin-container {
|
||||
background: #fff;
|
||||
border-radius: 8px;
|
||||
border-radius: 25px;
|
||||
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
|
||||
padding: 40px;
|
||||
width: 350px;
|
||||
@@ -25,17 +25,31 @@
|
||||
}
|
||||
|
||||
.admin-actions button {
|
||||
background-color: #4CAF50;
|
||||
background-color: #bd3948;
|
||||
color: white;
|
||||
padding: 12px 20px;
|
||||
margin: 10px;
|
||||
border: none;
|
||||
border-radius: 5px;
|
||||
border-radius: 25px;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.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 {
|
||||
|
||||
@@ -5,17 +5,25 @@
|
||||
<div class="admin-actions">
|
||||
<button (click)="createArticle()">Create Article</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 *ngIf="articles && articles.length > 0">
|
||||
<h3>Articles</h3>
|
||||
<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">
|
||||
<p>No articles available.</p> <!-- Show message if no articles -->
|
||||
</div>
|
||||
|
||||
<div *ngIf="!noArticles">
|
||||
<ul>
|
||||
<li *ngFor="let article of articles">
|
||||
<!-- Display article details here -->
|
||||
{{ article.title }}
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="logout">
|
||||
<button (click)="logout()">Logout</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -16,6 +16,7 @@ import { HttpClientModule } from '@angular/common/http';
|
||||
})
|
||||
export class AdminComponent implements OnInit {
|
||||
articles: any[] = [];
|
||||
noArticles: boolean = false;
|
||||
|
||||
constructor(private articleService: ArticleService, private router: Router) {}
|
||||
|
||||
@@ -34,6 +35,7 @@ export class AdminComponent implements OnInit {
|
||||
this.articleService.getArticles(token).subscribe(
|
||||
(data) => {
|
||||
this.articles = data;
|
||||
this.noArticles = this.articles.length === 0;
|
||||
},
|
||||
(error) => {
|
||||
console.error('Failed to load articles', error);
|
||||
@@ -45,6 +47,14 @@ export class AdminComponent implements OnInit {
|
||||
alert('Create article functionality goes here');
|
||||
}
|
||||
|
||||
editArticle() {
|
||||
alert('Delete article functionality goes here');
|
||||
}
|
||||
|
||||
deleteArticle() {
|
||||
alert('Delete article functionality goes here');
|
||||
}
|
||||
|
||||
viewArticles() {
|
||||
this.fetchArticles();
|
||||
}
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
<ng-container *ngIf="!isMobile; else mobileNavbar">
|
||||
<app-navbar></app-navbar>
|
||||
<app-navbar *ngIf="showNavbar" ></app-navbar>
|
||||
</ng-container>
|
||||
<ng-template #mobileNavbar>
|
||||
<app-mobile-navbar></app-mobile-navbar>
|
||||
<app-mobile-navbar *ngIf="showNavbar"></app-mobile-navbar>
|
||||
</ng-template>
|
||||
<router-outlet />
|
||||
<app-footer></app-footer>
|
||||
<app-footer *ngIf="showFooter"></app-footer>
|
||||
@@ -8,6 +8,7 @@ import {FooterComponent} from './footer/footer.component';
|
||||
import { Title, Meta } from '@angular/platform-browser';
|
||||
import { filter, map, mergeMap } from 'rxjs/operators';
|
||||
import { isPlatformBrowser } from '@angular/common';
|
||||
import {subscribe} from 'node:diagnostics_channel';
|
||||
|
||||
@Component({
|
||||
selector: 'app-root',
|
||||
@@ -18,6 +19,9 @@ import { isPlatformBrowser } from '@angular/common';
|
||||
export class AppComponent implements OnInit {
|
||||
isMobile: boolean;
|
||||
|
||||
showNavbar: boolean = true;
|
||||
showFooter: boolean = true;
|
||||
|
||||
constructor(
|
||||
private deviceService: DeviceDetectorService,
|
||||
private router: Router,
|
||||
@@ -60,7 +64,9 @@ export class AppComponent implements OnInit {
|
||||
meta.color = meta.color || '#eb284c';
|
||||
}
|
||||
this.updateMetaTags(meta);
|
||||
this.checkRoute();
|
||||
});
|
||||
this.checkRoute();
|
||||
}
|
||||
|
||||
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});
|
||||
}
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -70,8 +70,8 @@ export class BlogComponent implements OnInit, OnDestroy, AfterViewInit {
|
||||
// Initialize the Vanta effect on the element with ID 'vanta-bg'
|
||||
this.vantaEffect = window.VANTA.NET({
|
||||
el: '#vanta-blog-bg',
|
||||
mouseControls: true,
|
||||
touchControls: true,
|
||||
mouseControls: false,
|
||||
touchControls: false,
|
||||
gyroControls: false,
|
||||
scale: 1.00,
|
||||
scaleMobile: 1.00,
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
/* Login Form Styles */
|
||||
.login-container {
|
||||
background: #fff;
|
||||
border-radius: 8px;
|
||||
border-radius: 25px;
|
||||
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
|
||||
padding: 40px;
|
||||
width: 300px;
|
||||
@@ -31,29 +31,31 @@ h2 {
|
||||
}
|
||||
|
||||
input {
|
||||
width: 100%;
|
||||
width: 92%;
|
||||
padding: 10px;
|
||||
margin: 10px 0;
|
||||
border: 1px solid #ccc;
|
||||
border-radius: 4px;
|
||||
border-radius: 25px;
|
||||
}
|
||||
|
||||
button {
|
||||
width: 100%;
|
||||
width: 50%;
|
||||
padding: 10px;
|
||||
background-color: #4CAF50;
|
||||
margin-top: 20px;
|
||||
background-color: #5a39bd;
|
||||
color: white;
|
||||
border: none;
|
||||
border-radius: 4px;
|
||||
border-radius: 25px;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
button:disabled {
|
||||
background-color: #ccc;
|
||||
cursor: not-allowed;
|
||||
}
|
||||
|
||||
button:hover {
|
||||
background-color: #45a049;
|
||||
button:hover:enabled {
|
||||
background-color: #4e17ef;
|
||||
}
|
||||
|
||||
.error-message {
|
||||
|
||||
@@ -72,8 +72,8 @@ export class LoginComponent implements OnInit, OnDestroy, AfterViewInit {
|
||||
// Initialize the Vanta effect on the element with ID 'vanta-bg'
|
||||
this.vantaEffect = window.VANTA.NET({
|
||||
el: '#vanta-login-bg',
|
||||
mouseControls: true,
|
||||
touchControls: true,
|
||||
mouseControls: false,
|
||||
touchControls: false,
|
||||
gyroControls: false,
|
||||
scale: 1.00,
|
||||
scaleMobile: 1.00,
|
||||
|
||||
@@ -68,8 +68,8 @@ export class NotFoundComponent implements OnInit, OnDestroy, AfterViewInit {
|
||||
// Initialize the Vanta effect on the element with ID 'vanta-bg'
|
||||
this.vantaEffect = window.VANTA.NET({
|
||||
el: '#vanta-not-found-bg',
|
||||
mouseControls: true,
|
||||
touchControls: true,
|
||||
mouseControls: false,
|
||||
touchControls: false,
|
||||
gyroControls: false,
|
||||
scale: 1.00,
|
||||
scaleMobile: 1.00,
|
||||
|
||||
@@ -70,8 +70,8 @@ export class PortfolioComponent implements OnInit, OnDestroy, AfterViewInit {
|
||||
// Initialize the Vanta effect on the element with ID 'vanta-bg'
|
||||
this.vantaEffect = window.VANTA.NET({
|
||||
el: '#vanta-portfolio-bg',
|
||||
mouseControls: true,
|
||||
touchControls: true,
|
||||
mouseControls: false,
|
||||
touchControls: false,
|
||||
gyroControls: false,
|
||||
scale: 1.00,
|
||||
scaleMobile: 1.00,
|
||||
|
||||
Reference in new issue
Block a user