From 7b83af88c1b21664483a3a22e6757cb5221fa1ec Mon Sep 17 00:00:00 2001 From: axherrm Date: Fri, 26 Jan 2024 19:23:36 +0100 Subject: [PATCH] refactor code --- src/app/app.component.html | 4 ++-- .../about-card/about-card.component.html | 4 ++-- .../about-card/about-card.component.ts | 6 ++++-- src/app/sections/about/about.component.html | 4 ++-- src/app/sections/about/about.component.ts | 9 ++++----- .../sections/sidebar/sidebar.component.html | 4 ++-- src/app/sections/sidebar/sidebar.component.ts | 19 ++++--------------- 7 files changed, 20 insertions(+), 30 deletions(-) diff --git a/src/app/app.component.html b/src/app/app.component.html index 7674a77..220ce01 100644 --- a/src/app/app.component.html +++ b/src/app/app.component.html @@ -19,7 +19,7 @@
- +
@@ -68,7 +68,7 @@

- +
diff --git a/src/app/components/about-card/about-card.component.html b/src/app/components/about-card/about-card.component.html index b8b8337..86d0e52 100644 --- a/src/app/components/about-card/about-card.component.html +++ b/src/app/components/about-card/about-card.component.html @@ -18,8 +18,8 @@
- {{ langPack.showMore }} - {{ langPack.showLess }} + {{ dataService.languagePack.showMore }} + {{ dataService.languagePack.showLess }}
diff --git a/src/app/components/about-card/about-card.component.ts b/src/app/components/about-card/about-card.component.ts index 4a6e33a..dac5a52 100644 --- a/src/app/components/about-card/about-card.component.ts +++ b/src/app/components/about-card/about-card.component.ts @@ -1,7 +1,8 @@ import {Component, ElementRef, HostBinding, Input, ViewChild} from '@angular/core'; import {NgIf} from "@angular/common"; -import {AboutCard, LanguagePack} from "../../data/model"; +import {AboutCard} from "../../data/model"; import {ScrollTrigger} from "gsap/ScrollTrigger"; +import {DataService} from "../../data/data.service"; @Component({ selector: 'about-card', @@ -15,7 +16,6 @@ import {ScrollTrigger} from "gsap/ScrollTrigger"; export class AboutCardComponent { @Input({required: true}) content: AboutCard; - @Input({required: true}) langPack: LanguagePack; @ViewChild("text", {read: ElementRef}) textElement: ElementRef; @@ -23,6 +23,8 @@ export class AboutCardComponent { extended: boolean = false; + constructor(readonly dataService: DataService) {} + toggleExtension() { this.extended = !this.extended; if (this.extended) { diff --git a/src/app/sections/about/about.component.html b/src/app/sections/about/about.component.html index a26c5e8..8d9aac6 100644 --- a/src/app/sections/about/about.component.html +++ b/src/app/sections/about/about.component.html @@ -1,5 +1,5 @@ - - + +

Folgende Technologien wurden für die Erstellung dieses Projekts verwendet: diff --git a/src/app/sections/about/about.component.ts b/src/app/sections/about/about.component.ts index 6b7a14b..93021b2 100644 --- a/src/app/sections/about/about.component.ts +++ b/src/app/sections/about/about.component.ts @@ -1,11 +1,11 @@ -import {Component, Input} from '@angular/core'; +import {Component} from '@angular/core'; import {AboutCardComponent} from "../../components/about-card/about-card.component"; -import {AboutCard, LanguagePack} from "../../data/model"; import {appName, appVersion, githubURL} from "../../js/global.vars"; import {BadgeModule} from "primeng/badge"; import {BadgeComponent} from "../../components/badge/badge.component"; import {NgForOf, NgIf} from "@angular/common"; import {CustomButtonComponent} from "../../components/custom-button/custom-button.component"; +import {DataService} from "../../data/data.service"; @Component({ selector: 'about', @@ -23,11 +23,10 @@ import {CustomButtonComponent} from "../../components/custom-button/custom-butto }) export class AboutComponent { - @Input({required: true}) content: AboutCard[]; - @Input({required: true}) langPack: LanguagePack; - appVersion: string = appVersion; appName: string = appName; githubURL: string = githubURL; + constructor(readonly dataService: DataService) {} + } diff --git a/src/app/sections/sidebar/sidebar.component.html b/src/app/sections/sidebar/sidebar.component.html index 4f4fca8..b6fc18e 100644 --- a/src/app/sections/sidebar/sidebar.component.html +++ b/src/app/sections/sidebar/sidebar.component.html @@ -1,14 +1,14 @@