add primitize image

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

1
.gitignore vendored
View File

@ -1,2 +1,3 @@
dist
node_modules
testing

4
README.md Normal file
View File

@ -0,0 +1,4 @@
primitive images built with:
go install github.com/fogleman/primitive@latest
~/go/bin/primitive -i /mnt/c/Users/Adam/Desktop/laputa-png.png -o output3.svg -n 250 -bg 5F8F58 -s 2471 -j 8 -m 3

8
assets/laputa.svg Normal file

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 14 KiB

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;