mirror of
https://github.com/adam-benyekkou/my_portfolio.git
synced 2026-01-15 20:20:09 +00:00
Refactoring types / interface in dedicated models
This commit is contained in:
@@ -1,16 +1,6 @@
|
|||||||
import { Component, input, signal, computed } from '@angular/core';
|
import { Component, input, signal, computed } from '@angular/core';
|
||||||
import { CommonModule } from '@angular/common';
|
import { CommonModule } from '@angular/common';
|
||||||
|
import { type NeuralProfileNode } from '../../../shared/models/about.model';
|
||||||
export interface NeuralProfileNode {
|
|
||||||
id: string;
|
|
||||||
title: string;
|
|
||||||
isExpanded: boolean;
|
|
||||||
isSelected: boolean;
|
|
||||||
children?: NeuralProfileNode[];
|
|
||||||
level: number;
|
|
||||||
hasChildren: boolean;
|
|
||||||
visible: boolean;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-neural-profile-tree',
|
selector: 'app-neural-profile-tree',
|
||||||
|
|||||||
@@ -16,14 +16,7 @@ import {
|
|||||||
transition,
|
transition,
|
||||||
animate,
|
animate,
|
||||||
} from '@angular/animations';
|
} from '@angular/animations';
|
||||||
|
import { type TextItem } from '../../../shared/models/header.model';
|
||||||
interface TextItem {
|
|
||||||
readonly id: number;
|
|
||||||
readonly text: string;
|
|
||||||
readonly displayed: string;
|
|
||||||
readonly isTyping: boolean;
|
|
||||||
readonly isComplete: boolean;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Constants for better maintainability
|
// Constants for better maintainability
|
||||||
const TYPING_DELAYS = {
|
const TYPING_DELAYS = {
|
||||||
|
|||||||
@@ -8,27 +8,7 @@ import {
|
|||||||
ElementRef,
|
ElementRef,
|
||||||
} from '@angular/core';
|
} from '@angular/core';
|
||||||
|
|
||||||
export interface Project {
|
import { type Project } from '../../../../shared/models/project.model';
|
||||||
id: string;
|
|
||||||
title: string;
|
|
||||||
status: string;
|
|
||||||
classification: string;
|
|
||||||
objective: string;
|
|
||||||
statusDescription: string;
|
|
||||||
techStack: string[];
|
|
||||||
demoUrl?: string;
|
|
||||||
codeUrl?: string;
|
|
||||||
isRedacted: boolean;
|
|
||||||
caseStudy?: {
|
|
||||||
title: string;
|
|
||||||
sections: CaseStudySection[];
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface CaseStudySection {
|
|
||||||
title: string;
|
|
||||||
content: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-project-card',
|
selector: 'app-project-card',
|
||||||
|
|||||||
@@ -1,11 +1,8 @@
|
|||||||
// project-list.component.ts
|
// project-list.component.ts
|
||||||
import { Component, signal, computed, effect, OnInit } from '@angular/core';
|
import { Component, signal, computed, effect, OnInit } from '@angular/core';
|
||||||
import {
|
import { ProjectCardComponent } from '../project-card/project-card.component';
|
||||||
ProjectCardComponent,
|
|
||||||
Project,
|
|
||||||
CaseStudySection,
|
|
||||||
} from '../project-card/project-card.component';
|
|
||||||
import { SectionTitleComponent } from '../../../../shared/ui/section-title/section-title.component';
|
import { SectionTitleComponent } from '../../../../shared/ui/section-title/section-title.component';
|
||||||
|
import { type Project } from '../../../../shared/models/project.model';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-project-list',
|
selector: 'app-project-list',
|
||||||
|
|||||||
12
src/app/shared/models/about.model.ts
Normal file
12
src/app/shared/models/about.model.ts
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
type NeuralProfileNode = {
|
||||||
|
id: string;
|
||||||
|
title: string;
|
||||||
|
isExpanded: boolean;
|
||||||
|
isSelected: boolean;
|
||||||
|
children?: NeuralProfileNode[];
|
||||||
|
level: number;
|
||||||
|
hasChildren: boolean;
|
||||||
|
visible: boolean;
|
||||||
|
};
|
||||||
|
|
||||||
|
export type { NeuralProfileNode };
|
||||||
9
src/app/shared/models/header.model.ts
Normal file
9
src/app/shared/models/header.model.ts
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
type TextItem = {
|
||||||
|
readonly id: number;
|
||||||
|
readonly text: string;
|
||||||
|
readonly displayed: string;
|
||||||
|
readonly isTyping: boolean;
|
||||||
|
readonly isComplete: boolean;
|
||||||
|
};
|
||||||
|
|
||||||
|
export { type TextItem };
|
||||||
23
src/app/shared/models/project.model.ts
Normal file
23
src/app/shared/models/project.model.ts
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
type Project = {
|
||||||
|
id: string;
|
||||||
|
title: string;
|
||||||
|
status: string;
|
||||||
|
classification: string;
|
||||||
|
objective: string;
|
||||||
|
statusDescription: string;
|
||||||
|
techStack: string[];
|
||||||
|
demoUrl?: string;
|
||||||
|
codeUrl?: string;
|
||||||
|
isRedacted: boolean;
|
||||||
|
caseStudy?: {
|
||||||
|
title: string;
|
||||||
|
sections: CaseStudySection[];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
type CaseStudySection = {
|
||||||
|
title: string;
|
||||||
|
content: string;
|
||||||
|
};
|
||||||
|
|
||||||
|
export { type Project, type CaseStudySection };
|
||||||
@@ -64,6 +64,7 @@ export class SectionTitleComponent implements OnInit, OnDestroy {
|
|||||||
const timeoutId = setTimeout(() => {
|
const timeoutId = setTimeout(() => {
|
||||||
revealedLetters[i] = true;
|
revealedLetters[i] = true;
|
||||||
}, i * letterDelay);
|
}, i * letterDelay);
|
||||||
|
// @ts-ignore
|
||||||
this.timeoutIds.push(timeoutId);
|
this.timeoutIds.push(timeoutId);
|
||||||
} else {
|
} else {
|
||||||
revealedLetters[i] = true; // Spaces are always "revealed"
|
revealedLetters[i] = true; // Spaces are always "revealed"
|
||||||
|
|||||||
Reference in New Issue
Block a user