Refactor and minor fixes

This commit is contained in:
Andras Schmelczer 2022-09-21 21:57:58 +02:00
parent 2dc9c45642
commit fe75f9af88
No known key found for this signature in database
GPG key ID: 0EA1BC97D0AB076E
31 changed files with 187 additions and 193 deletions

View file

@ -1,11 +1,10 @@
import { html } from '../../../types/html';
import { Image } from '../../basics/image/image';
import { Preview } from '../../basics/preview/preview';
import { Video } from '../../basics/video/video';
export interface TimelineElementParameters {
date: string;
figure: Image | Video | Preview;
figure: html | Video | Preview;
title: string;
description: string;
more: Array<string>;

View file

@ -26,7 +26,7 @@ export const generate = (
more
? `
<div class="more">
${more.map((t) => `<p>${t}</p>`).join('\n')}
${more.map((t) => `<p>${t}</p>`).join('')}
</div>`
: ''
}

View file

@ -109,6 +109,7 @@
h2 {
text-align: center;
margin-bottom: -10px;
> a {
@include sub-title-font();
@ -131,7 +132,8 @@
}
}
.description {
.description,
.info-button {
text-align: center;
}

View file

@ -18,7 +18,12 @@ export class PageTimelineElement extends PageElement {
addEventListener('resize', this.handleResize.bind(this));
this.query('.info-button').addEventListener('click', this.toggleOpen.bind(this));
this.attachElementByReplacing('.figure', timelineElement.figure);
this.attachElementByReplacing(
'.figure',
timelineElement.figure instanceof PageElement
? timelineElement.figure
: new PageElement(createElement(timelineElement.figure))
);
this.isOpen = false;
}