summaryrefslogtreecommitdiffstats
path: root/gen.sh
blob: 6aaab57a107407f732c1c5538372df1a7644ae26 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
#!/usr/bin/env sh

mkdir -p export
rm -f export/*

mkdir -p export_flip
rm -f export_flip/*

find . -type f \( -iname "*.svg" ! -iname ".*" ! -iname "a*" \) -print0 | parallel -0 'x={.}; inkscape -o "export/${x#./}_raw.png" "{}"' \;
sh ./dundundun.sh ablobfoxdundundun
sh ./dundundun.sh ablobfoxdundundunowo
sh ./hyperize.sh ablobfoxhyperowo
sh ./hyperize.sh ablobfoxhypercofe
sh ./hyperize.sh ablobfoxhyperthinking
sh ./hyperize.sh ablobfoxhypersnugowo
sh ./hyperize.sh ablobfoxhyperwhaaaat
sh ./hyperize.sh ablobfoxree
sh ./animate.sh ablobfoxhyper 3 2:100
sh ./animate.sh ablobfoxloading 36 3:100
cp LICENSE export/

cd export
find . -type f -iname "*_raw.png" -print0 | parallel -0 'x={.}; pngquant -o "${x%_raw}.png" "{}"' \;
rm ./*_raw.png
apngasm -o ablobfoxbongo.png blobfoxbongo.png 100 blobfoxbongostart.png 100
apngasm -o ablobfoxbongohyper.png blobfoxbongo.png 5:100 blobfoxbongostart.png 5:100
apngasm -o ablobfoxbongoterrified.png blobfoxbongoterrified.png 5:100 blobfoxbongoterrifiedstart.png 5:100
cp ./*.png ../export_flip/
cp ./LICENSE ../export_flip/


FILELIST=`find . -type f -iname '*.png' -exec sh -c 'x=${0#./}; printf "%s:%s|" ${x%.png} $x' {} \;`
jq -Rn 'input | split("|") | map(split(":") | { key: .[0], value: .[1] }) | from_entries' <<< "${FILELIST%|}" > blobfox.json

zip blobfox.zip *.png
zip blobfox.zip LICENSE
tar -cvzf blobfox.tar.gz *.png LICENSE
CHECKSUM=`sha256sum -z blobfox.zip | awk '{ print $1 }'`

cd ../export_flip

rm blobfoxsign*.png blobfoxconfused.png blobfoxbreadsnoot*.png blobfoxsleep.png
find . -type f \( -iname "*.png" ! -iname "a*" \) -exec sh -c 'x=${0#./}; mv $x rev$x' {} \;
mogrify -flop rev*.png
find . -type f -iname "a*.png" -exec sh -c 'x=${0#./a}; ffmpeg -i a$x -vf hflip -f apng -plays 0 arev$x' {} \;
rm ablob*.png
FILELIST=`find . -type f -iname '*.png' -exec sh -c 'x=${0#./}; printf "%s:%s|" ${x%.png} $x' {} \;`
jq -Rn 'input | split("|") | map(split(":") | { key: .[0], value: .[1] }) | from_entries' <<< "${FILELIST%|}" > blobfox_flip.json

zip blobfox_flip.zip *.png
zip blobfox_flip.zip LICENSE
tar -cvzf blobfox_flip.tar.gz *.png LICENSE
CHECKSUM_FLIP=`sha256sum -z blobfox_flip.zip | awk '{ print $1 }'`

cd ../export

mv ../export_flip/blobfox_flip.zip ./
mv ../export_flip/blobfox_flip.tar.gz ./
mv ../export_flip/blobfox_flip.json ./

rm -f *.png
rm -f ../export_flip/*

printf '{
    "blobfox": {
        "description": "Like Blobcat, but with foxes",
        "files":       "blobfox.json",
        "homepage":    "https://www.feuerfuchs.dev/projects/blobfox-emojis/",
        "src":         "https://www.feuerfuchs.dev/projects/blobfox-emojis/blobfox.zip",
        "src_sha256":  "%s",
        "license":     "Apache 2.0"
    },
    "blobfox_flip": {
        "description": "Like Blobcat, but with foxes (flipped version)",
        "files":       "blobfox_flip.json",
        "homepage":    "https://www.feuerfuchs.dev/projects/blobfox-emojis/",
        "src":         "https://www.feuerfuchs.dev/projects/blobfox-emojis/blobfox_flip.zip",
        "src_sha256":  "%s",
        "license":     "Apache 2.0"
    }
}' $CHECKSUM $CHECKSUM_FLIP > manifest.json