Refactor portfolio
This commit is contained in:
parent
eda999107d
commit
5592828c92
7 changed files with 309 additions and 328 deletions
15
src/page/header/header.ts
Normal file
15
src/page/header/header.ts
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
import { PageContent } from '../content/content';
|
||||
import { Header } from '../../types/portfolio';
|
||||
import { generate } from './header.html';
|
||||
import { createElement } from '../../helper/create-element';
|
||||
import { PageThemeSwitcher } from '../theme-switcher/theme-switcher';
|
||||
import { PageElement } from '../page-element';
|
||||
|
||||
export class PageHeader extends PageElement {
|
||||
public constructor(header: Header) {
|
||||
super(createElement(generate(header)));
|
||||
this.attachElementByReplacing('.picture', header.picture);
|
||||
this.attachElement(new PageContent(header.about));
|
||||
this.attachElement(new PageThemeSwitcher());
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue