add primitize image

This commit is contained in:
2021-12-09 14:47:55 +11:00
parent 10f841d1b7
commit df21e4ffb5
5 changed files with 16 additions and 3 deletions

View File

@ -41,7 +41,8 @@ for (const [name, f] of Object.entries(fonts)) {
const laputa = await readFile('assets/laputa.webp');
const outName = `static/laputa.${makeHash(laputa)}.webp`;
await writeFile('dist/' + outName, laputa);
html = html.replace('LAPUTA', outName);
const svg = await readFile('assets/laputa.svg');
html = html.replace('LAPUTA_WEBP', outName).replace('LAPUTA_SVG', 'data:image/svg+xml;base64,' + svg.toString('base64'));
}
await writeFile('dist/index.html', html);

View File

@ -9,13 +9,12 @@
box-sizing: border-box;
}
body {
background-image: url(LAPUTA);
background-image: url(LAPUTA_WEBP), URL(LAPUTA_SVG);
/* todo: revist image-set */
background-position-x: center;
background-size: cover;
color: white;
margin-top: 2em;
font-family: Inter, sans-serif;
font-size: 14px;