Run lint
This commit is contained in:
parent
1b63bbc0da
commit
9f906d1fdf
13 changed files with 17 additions and 17 deletions
|
|
@ -4,7 +4,7 @@
|
||||||
"private": true,
|
"private": true,
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"start": "webpack serve --open --mode development",
|
"start": "webpack serve --open --mode development",
|
||||||
"lint": "npx eslint --fix \"src/**/*.ts\" && npx prettier --write \"src/**/*\"",
|
"lint": "npx eslint --fix \"src/**/*.ts\" && npx prettier --write \"src/**/*.(ts|scss|json|html)\"",
|
||||||
"build": "webpack --mode production"
|
"build": "webpack --mode production"
|
||||||
},
|
},
|
||||||
"repository": {
|
"repository": {
|
||||||
|
|
|
||||||
|
|
@ -12,7 +12,7 @@ import './styles.scss';
|
||||||
import { create } from './portfolio';
|
import { create } from './portfolio';
|
||||||
|
|
||||||
const addSupportForTabNavigation = () =>
|
const addSupportForTabNavigation = () =>
|
||||||
document.addEventListener('keydown', e => {
|
document.addEventListener('keydown', (e) => {
|
||||||
if (e.key === ' ') {
|
if (e.key === ' ') {
|
||||||
(document.activeElement as HTMLElement)?.click();
|
(document.activeElement as HTMLElement)?.click();
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
|
|
|
||||||
|
|
@ -77,7 +77,7 @@ export class PageBackground extends PageElement {
|
||||||
|
|
||||||
private randomizeBlobs(topOffset: number, bottomOffset: number) {
|
private randomizeBlobs(topOffset: number, bottomOffset: number) {
|
||||||
this.random.seed = 50;
|
this.random.seed = 50;
|
||||||
this.blobs.forEach(b => {
|
this.blobs.forEach((b) => {
|
||||||
const z = -Number.parseInt(b.style.zIndex);
|
const z = -Number.parseInt(b.style.zIndex);
|
||||||
const [x, y] = this.randomXY(z, topOffset, bottomOffset);
|
const [x, y] = this.randomXY(z, topOffset, bottomOffset);
|
||||||
b.style.transform = `translate3D(${x}px, ${y}px, ${-z}px) rotate(-20deg)`;
|
b.style.transform = `translate3D(${x}px, ${y}px, ${-z}px) rotate(-20deg)`;
|
||||||
|
|
|
||||||
|
|
@ -18,9 +18,9 @@ export const generate = ({
|
||||||
}): html => `
|
}): html => `
|
||||||
${
|
${
|
||||||
container
|
container
|
||||||
? `<div class="figure-container" style="padding-top:${(imageJpeg.height /
|
? `<div class="figure-container" style="padding-top:${
|
||||||
imageJpeg.width) *
|
(imageJpeg.height / imageJpeg.width) * 100
|
||||||
100}%">`
|
}%">`
|
||||||
: ''
|
: ''
|
||||||
}
|
}
|
||||||
<picture loading="lazy">
|
<picture loading="lazy">
|
||||||
|
|
|
||||||
|
|
@ -30,7 +30,7 @@ export class Image extends PageElement {
|
||||||
return (
|
return (
|
||||||
image.images
|
image.images
|
||||||
.slice(0, -1)
|
.slice(0, -1)
|
||||||
.map(d => `(max-width: ${d.width / Image.imageScreenRatio}px) ${d.width}px,`)
|
.map((d) => `(max-width: ${d.width / Image.imageScreenRatio}px) ${d.width}px,`)
|
||||||
.join('\n') + `\n${last(image.images)!.width}px`
|
.join('\n') + `\n${last(image.images)!.width}px`
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -18,7 +18,7 @@ export class Preview extends PageElement {
|
||||||
}
|
}
|
||||||
|
|
||||||
public setParent(parent: PageElement) {
|
public setParent(parent: PageElement) {
|
||||||
new IntersectionObserver(e => {
|
new IntersectionObserver((e) => {
|
||||||
if (!e[0].isIntersecting) {
|
if (!e[0].isIntersecting) {
|
||||||
this.unloadContent();
|
this.unloadContent();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -12,9 +12,9 @@ export const generate = ({
|
||||||
posterJpeg,
|
posterJpeg,
|
||||||
invertButton,
|
invertButton,
|
||||||
}: VideoParameters): html => `
|
}: VideoParameters): html => `
|
||||||
<div class="figure-container video-container" style="padding-top:${(posterJpeg.height /
|
<div class="figure-container video-container" style="padding-top:${
|
||||||
posterJpeg.width) *
|
(posterJpeg.height / posterJpeg.width) * 100
|
||||||
100}%">
|
}%">
|
||||||
<img image-viewer-ignore class="poster"/>
|
<img image-viewer-ignore class="poster"/>
|
||||||
<div class="loading">${loading}</div>
|
<div class="loading">${loading}</div>
|
||||||
<video playsinline preload="none">
|
<video playsinline preload="none">
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@ import { PageElement } from '../page-element';
|
||||||
export class Body extends PageElement {
|
export class Body extends PageElement {
|
||||||
constructor(...children: Array<PageElement>) {
|
constructor(...children: Array<PageElement>) {
|
||||||
super(document.body, children);
|
super(document.body, children);
|
||||||
children.forEach(c => this.attachElement(c));
|
children.forEach((c) => this.attachElement(c));
|
||||||
this.setParent();
|
this.setParent();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,7 @@ import { PageElement } from '../page-element';
|
||||||
export class PageContent extends PageElement {
|
export class PageContent extends PageElement {
|
||||||
public constructor(content: Array<string>) {
|
public constructor(content: Array<string>) {
|
||||||
super(createElement(generate()));
|
super(createElement(generate()));
|
||||||
content.map(t => {
|
content.map((t) => {
|
||||||
const p = createElement(`<p>${t}</p>`);
|
const p = createElement(`<p>${t}</p>`);
|
||||||
this.htmlRoot.appendChild(p);
|
this.htmlRoot.appendChild(p);
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -5,6 +5,6 @@ import { createElement } from '../../helper/create-element';
|
||||||
export class Main extends PageElement {
|
export class Main extends PageElement {
|
||||||
constructor(...children: Array<PageElement>) {
|
constructor(...children: Array<PageElement>) {
|
||||||
super(createElement(generate()), children);
|
super(createElement(generate()), children);
|
||||||
children.forEach(c => this.attachElement(c));
|
children.forEach((c) => this.attachElement(c));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,7 @@ export abstract class PageElement {
|
||||||
|
|
||||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||||
protected setParent(parent?: PageElement): void {
|
protected setParent(parent?: PageElement): void {
|
||||||
this.children.forEach(c => c.setParent(this));
|
this.children.forEach((c) => c.setParent(this));
|
||||||
}
|
}
|
||||||
|
|
||||||
protected query(query: string): HTMLElement {
|
protected query(query: string): HTMLElement {
|
||||||
|
|
|
||||||
|
|
@ -35,7 +35,7 @@ export class PageTimelineElement extends PageElement {
|
||||||
this.query('.info-button').addEventListener('click', this.toggleOpen.bind(this));
|
this.query('.info-button').addEventListener('click', this.toggleOpen.bind(this));
|
||||||
this.attachElementByReplacing('.figure', timelineElement.figure);
|
this.attachElementByReplacing('.figure', timelineElement.figure);
|
||||||
this.query('.description').innerText = timelineElement.description;
|
this.query('.description').innerText = timelineElement.description;
|
||||||
timelineElement.links.forEach(l => this.attachElementAsChildOf('.buttons', l));
|
timelineElement.links.forEach((l) => this.attachElementAsChildOf('.buttons', l));
|
||||||
|
|
||||||
this.isOpen = false;
|
this.isOpen = false;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -17,7 +17,7 @@ export class PageTimeline extends PageElement {
|
||||||
elements: Array<TimelineElementParameters>;
|
elements: Array<TimelineElementParameters>;
|
||||||
}) {
|
}) {
|
||||||
super(createElement(generate()));
|
super(createElement(generate()));
|
||||||
elements.forEach(e =>
|
elements.forEach((e) =>
|
||||||
this.attachElement(new PageTimelineElement(e, showMoreText, showLessText))
|
this.attachElement(new PageTimelineElement(e, showMoreText, showLessText))
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue