Convert to component based architecture

This commit is contained in:
Schmelczer András 2019-12-21 22:59:41 +01:00
parent eb2075aec5
commit cdaa423b8a
70 changed files with 1942 additions and 484 deletions

22
src/page/about/about.ts Normal file
View file

@ -0,0 +1,22 @@
import { PageContent } from "../content/content";
import { Header } from "../../model/portfolio";
import "./about.scss";
import { PageElement } from "../../framework/page-element";
import { createElement } from "../../framework/element-factory";
export class PageHeader extends PageElement {
public constructor({ name, picture, about }: Header, aPictureOf: string) {
const root = createElement(`
<section id="about">
<header>
<img alt="${aPictureOf} ${name}" src="${picture}"/>
<h1>${name}</h1>
</header>
</section>
`);
const content = new PageContent(about);
root.appendChild(content.getElement());
super([content]);
this.setElement(root);
}
}