BASH photo gallery: Difference between revisions
No edit summary |
No edit summary |
||
Line 39: | Line 39: | ||
EOF | EOF | ||
</source> | </source> | ||
For an example of a result, see: [http://pzwart1.wdka.hro.nl/~mmurtaugh/xpub2019/ xpub2019] |
Revision as of 17:20, 15 July 2019
cat << EOF > index.html
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<style>
body {
background: gray;
}
div.image {
float: left;
transform: scale(0.75, 0.75);
transition-duration: 0.5s;
transition-property: transform;
}
div.image img {
border-radius: 20px;
}
div.image:hover {
transform: scale(1.0, 1.0);
}
</style>
</head>
<body>
EOF
for i in *.JPG
do
t=${i%*.JPG}.thumb.jpg
if [ ! -f $t ]; then
echo convert -resize 360x360 $i $t
convert -resize 360x360 -auto-orient $i $t
fi
echo "<div class=\"image\"><a href=\"$i\"><img src=\"$t\" /></a></div>" >> index.html
done
cat << EOF >> index.html
</body>
</html>
EOF
For an example of a result, see: xpub2019