mirror of
https://github.com/danielvici/tool-website.git
synced 2026-01-17 06:51:26 +00:00
first content
add: Cards for Generators on startpage. test site, navbar
This commit is contained in:
0
src/app/components/custom-card/custom-card.css
Normal file
0
src/app/components/custom-card/custom-card.css
Normal file
15
src/app/components/custom-card/custom-card.html
Normal file
15
src/app/components/custom-card/custom-card.html
Normal file
@@ -0,0 +1,15 @@
|
||||
@if (enabled()) {
|
||||
<div
|
||||
class="h-full
|
||||
hover:cursor-pointer flex flex-col p-6 rounded-lg border border-gray-700 bg-zinc-800 transition-colors duration-200 hover:border-blue-500"
|
||||
[routerLink]="destination()">
|
||||
<app-custom-title
|
||||
[text]="title()"
|
||||
[textSizeInPx]="titleSizeInPx()"
|
||||
[textColor]="titleColor()"
|
||||
fontWeight="bold"
|
||||
class="mb-2"
|
||||
></app-custom-title>
|
||||
<span [ngStyle]="{'color': descriptionColor()}">{{ description() }}</span>
|
||||
</div>
|
||||
}
|
||||
22
src/app/components/custom-card/custom-card.spec.ts
Normal file
22
src/app/components/custom-card/custom-card.spec.ts
Normal file
@@ -0,0 +1,22 @@
|
||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
|
||||
import { CustomCard } from './custom-card';
|
||||
|
||||
describe('CustomCard', () => {
|
||||
let component: CustomCard;
|
||||
let fixture: ComponentFixture<CustomCard>;
|
||||
|
||||
beforeEach(async () => {
|
||||
await TestBed.configureTestingModule({
|
||||
imports: [CustomCard],
|
||||
}).compileComponents();
|
||||
|
||||
fixture = TestBed.createComponent(CustomCard);
|
||||
component = fixture.componentInstance;
|
||||
fixture.detectChanges();
|
||||
});
|
||||
|
||||
it('should create', () => {
|
||||
expect(component).toBeTruthy();
|
||||
});
|
||||
});
|
||||
28
src/app/components/custom-card/custom-card.ts
Normal file
28
src/app/components/custom-card/custom-card.ts
Normal file
@@ -0,0 +1,28 @@
|
||||
import { Component, input } from '@angular/core';
|
||||
import { CustomTitle } from '../custom-title/custom-title';
|
||||
import {RouterLink} from '@angular/router';
|
||||
import {NgStyle} from '@angular/common';
|
||||
|
||||
@Component({
|
||||
selector: 'app-custom-card',
|
||||
imports: [CustomTitle, RouterLink, NgStyle],
|
||||
templateUrl: './custom-card.html',
|
||||
styleUrl: './custom-card.css',
|
||||
})
|
||||
export class CustomCard {
|
||||
|
||||
title = input.required<string>();
|
||||
titleSizeInPx = input<number>(20);
|
||||
titleColor = input<string>();
|
||||
|
||||
description = input.required<string>();
|
||||
descriptionColor = input<string>();
|
||||
|
||||
destination = input.required<string>();
|
||||
enabled = input.required<boolean>();
|
||||
|
||||
|
||||
ngOnInit() {
|
||||
console.log(this.destination());
|
||||
}
|
||||
}
|
||||
0
src/app/components/custom-title/custom-title.css
Normal file
0
src/app/components/custom-title/custom-title.css
Normal file
6
src/app/components/custom-title/custom-title.html
Normal file
6
src/app/components/custom-title/custom-title.html
Normal file
@@ -0,0 +1,6 @@
|
||||
<a
|
||||
[ngStyle]="{
|
||||
'font-size': textSizeInPx() + 'px',
|
||||
color: textColor(),
|
||||
'font-weight': fontWeight()}"
|
||||
>{{ text() }}</a>
|
||||
22
src/app/components/custom-title/custom-title.spec.ts
Normal file
22
src/app/components/custom-title/custom-title.spec.ts
Normal file
@@ -0,0 +1,22 @@
|
||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
|
||||
import { CustomTitle } from './custom-title';
|
||||
|
||||
describe('CustomTitle', () => {
|
||||
let component: CustomTitle;
|
||||
let fixture: ComponentFixture<CustomTitle>;
|
||||
|
||||
beforeEach(async () => {
|
||||
await TestBed.configureTestingModule({
|
||||
imports: [CustomTitle],
|
||||
}).compileComponents();
|
||||
|
||||
fixture = TestBed.createComponent(CustomTitle);
|
||||
component = fixture.componentInstance;
|
||||
fixture.detectChanges();
|
||||
});
|
||||
|
||||
it('should create', () => {
|
||||
expect(component).toBeTruthy();
|
||||
});
|
||||
});
|
||||
15
src/app/components/custom-title/custom-title.ts
Normal file
15
src/app/components/custom-title/custom-title.ts
Normal file
@@ -0,0 +1,15 @@
|
||||
import { Component, input } from '@angular/core';
|
||||
import {NgClass, NgStyle} from '@angular/common';
|
||||
|
||||
@Component({
|
||||
selector: 'app-custom-title',
|
||||
imports: [NgStyle, NgClass],
|
||||
templateUrl: './custom-title.html',
|
||||
styleUrl: './custom-title.css',
|
||||
})
|
||||
export class CustomTitle {
|
||||
text = input.required<string>();
|
||||
textSizeInPx = input<number>(16);
|
||||
textColor = input<string>();
|
||||
fontWeight = input<string>("normal");
|
||||
}
|
||||
@@ -1,11 +1,17 @@
|
||||
<nav class="h-16 bg-blue-marian">
|
||||
<div class="flex justify-between items-center px-4 bg-blue-marian text-white container mx-auto h-full">
|
||||
<div
|
||||
class="flex justify-between items-center px-4 bg-blue-marian text-white container mx-auto h-full"
|
||||
>
|
||||
<div class="flex items-center h-full">
|
||||
<span class="font-bold text-xl">Home</span>
|
||||
<a class="font-bold text-xl" routerLink="/">Home</a>
|
||||
</div>
|
||||
<div class="flex flex-row space-x-4 gap-6">
|
||||
<a class="hover:text-blue-200" routerLink="/coming-soon" routerLinkActive="active-link">Coming Soon</a>
|
||||
<a class="hover:text-blue-200" routerLink="/changelog" routerLinkActive="active-link">Changelog</a>
|
||||
<a class="hover:text-blue-200" routerLink="/coming-soon" routerLinkActive="active-link"
|
||||
>Coming Soon</a
|
||||
>
|
||||
<a class="hover:text-blue-200" routerLink="/changelog" routerLinkActive="active-link"
|
||||
>Changelog</a
|
||||
>
|
||||
<a class="hover:text-blue-200" routerLink="/about" routerLinkActive="active-link">About</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -8,9 +8,8 @@ describe('Navbar', () => {
|
||||
|
||||
beforeEach(async () => {
|
||||
await TestBed.configureTestingModule({
|
||||
imports: [Navbar]
|
||||
})
|
||||
.compileComponents();
|
||||
imports: [Navbar],
|
||||
}).compileComponents();
|
||||
|
||||
fixture = TestBed.createComponent(Navbar);
|
||||
component = fixture.componentInstance;
|
||||
|
||||
@@ -1,17 +1,11 @@
|
||||
import { Component } from '@angular/core';
|
||||
import {RouterLink, RouterLinkActive} from '@angular/router';
|
||||
import {NgOptimizedImage} from '@angular/common';
|
||||
import { RouterLink, RouterLinkActive } from '@angular/router';
|
||||
import { NgOptimizedImage } from '@angular/common';
|
||||
|
||||
@Component({
|
||||
selector: 'app-navbar',
|
||||
imports: [
|
||||
RouterLinkActive,
|
||||
RouterLink,
|
||||
NgOptimizedImage
|
||||
],
|
||||
imports: [RouterLinkActive, RouterLink],
|
||||
templateUrl: './navbar.html',
|
||||
styleUrl: './navbar.css',
|
||||
})
|
||||
export class Navbar {
|
||||
|
||||
}
|
||||
export class Navbar {}
|
||||
|
||||
Reference in New Issue
Block a user