Improve build process and remove WebP support
This commit is contained in:
parent
3649a033b0
commit
4f47bb639a
21 changed files with 31 additions and 102 deletions
|
|
@ -8,16 +8,13 @@ import './preview.scss';
|
|||
export const generate = ({
|
||||
alt,
|
||||
posterWebP,
|
||||
posterJpeg,
|
||||
}: {
|
||||
alt: string;
|
||||
posterWebP: ResponsiveImage;
|
||||
posterJpeg: ResponsiveImage;
|
||||
}): html => `
|
||||
<div class="preview">
|
||||
${Image({
|
||||
imageWebP: posterWebP,
|
||||
imageJpeg: posterJpeg,
|
||||
alt,
|
||||
container: true,
|
||||
isIgnoredByImageViewer: true,
|
||||
|
|
|
|||
|
|
@ -6,11 +6,10 @@ import { generate } from './preview.html';
|
|||
export class Preview extends PageElement {
|
||||
public constructor(
|
||||
posterWebP: ResponsiveImage,
|
||||
posterJpeg: ResponsiveImage,
|
||||
private readonly url: string,
|
||||
alt: string
|
||||
) {
|
||||
super(createElement(generate({ posterWebP, posterJpeg, alt })));
|
||||
super(createElement(generate({ posterWebP, alt })));
|
||||
this.url += '?portfolioView';
|
||||
this.query('.start-button').addEventListener('click', this.loadContent.bind(this));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,6 +5,5 @@ export interface VideoParameters {
|
|||
mp4: url;
|
||||
webm: url;
|
||||
posterWebP: ResponsiveImage;
|
||||
posterJpeg: ResponsiveImage;
|
||||
invertButton?: boolean;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -9,15 +9,13 @@ export const generate = ({
|
|||
webm,
|
||||
mp4,
|
||||
posterWebP,
|
||||
posterJpeg,
|
||||
invertButton,
|
||||
}: VideoParameters): html => `
|
||||
<div class="figure-container video-container" style="padding-top:${
|
||||
(posterJpeg.height / posterJpeg.width) * 100
|
||||
(posterWebP.height / posterWebP.width) * 100
|
||||
}%">
|
||||
${Image({
|
||||
imageWebP: posterWebP,
|
||||
imageJpeg: posterJpeg,
|
||||
alt: `thumbnail for the video`,
|
||||
isIgnoredByImageViewer: true,
|
||||
})}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue