import { ChangeDetectionStrategy, Component, inject } from '@angular/core'; import { ActivatedRoute, RouterLink } from '@angular/router'; import { PageShellComponent } from '../../core/layout/page-shell.component'; import { SeoService } from '../../core/services/seo.service'; import { MAIN_NAVIGATION } from '../../shared/config/navigation.config'; import { PortfolioProjectId } from '../work/portfolio-project.model'; import { getPortfolioProject, PORTFOLIO_PROJECTS } from '../work/portfolio-projects.data'; import { SystemDiagramComponent } from '../work/system-diagram.component'; @Component({ selector: 'app-portfolio-page', standalone: true, imports: [PageShellComponent, RouterLink, SystemDiagramComponent], changeDetection: ChangeDetectionStrategy.OnPush, template: `

{{ project.category }} · {{ project.period }}

{{ project.title }}

{{ project.summary }}

role
{{ project.role }}
period
{{ project.period }}
stack
@for (technology of project.stack; track technology) {{{ technology }}}
// 01 context

The challenge

{{ project.challenge }}

// 02 delivery

What I contributed

    @for (contribution of project.contributions; track contribution; let index = $index) {
  1. {{ contributionNumber(index) }}

    {{ contribution }}

  2. }
// 03 architecture

Key decisions

@for (decision of project.decisions; track decision.title; let index = $index) {
{{ contributionNumber(index) }}

{{ decision.title }}

{{ decision.detail }}

}
// 04 result

The outcome

{{ project.outcome }}

// contact

Have a complex system? Let’s make the next change safer and more useful.

` }) export class PortfolioPageComponent { readonly sections = MAIN_NAVIGATION; readonly project = getPortfolioProject(inject(ActivatedRoute).snapshot.data['projectId'] as PortfolioProjectId); readonly projectIndex = PORTFOLIO_PROJECTS.findIndex(item => item.id === this.project.id); readonly previous = PORTFOLIO_PROJECTS[(this.projectIndex - 1 + PORTFOLIO_PROJECTS.length) % PORTFOLIO_PROJECTS.length]; readonly next = PORTFOLIO_PROJECTS[(this.projectIndex + 1) % PORTFOLIO_PROJECTS.length]; constructor() { inject(SeoService).update({ title: `${this.project.title} — Amar Džanan`, description: this.project.seoDescription, path: `/work/${this.project.slug}`, type: 'article', structuredData: { '@context': 'https://schema.org', '@type': 'Article', headline: this.project.title, description: this.project.seoDescription, author: { '@type': 'Person', name: 'Amar Džanan', url: 'https://dzanan.net/' }, url: `https://dzanan.net/work/${this.project.slug}` } }); } contributionNumber(index: number): string { return String(index + 1).padStart(2, '0'); } }