#!/bin/bash
echo -e "<!DOCTYPE html>\n<head>\n"
echo -e "<style>\ndiv.gallery {\nmargin: 1px;\nborder: 1px solid #ccc;\nfloat: left;\n"
echo -e" width: 180px;\n}\n\ndiv.gallery:hover {\nborder: 1px solid #777;\n}\n\ndiv.gallery img {\n"
echo -e "width: 10%;\nheight: auto;\n}\n"
echo -e "</style>\n</head>\n"
echo -e "<body>\n"

cd /home/user/img
#clean up scratch files made by mypaint
rm *.png~
for i in `ls *.png`
do
echo -e "<div class="gallery">"
echo -e  "<a target="$i" href="$i">"
echo -e   " <img src="$i"  width="300" height="200">"
echo -e  "</a>"
echo -e "</div>"
done

echo -e "</body>\n</html>"
