Advertisement
j0h

Gallery.html

j0h
Jan 4th, 2023 (edited)
1,488
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.62 KB | None | 0 0
  1. #!/bin/bash
  2. echo -e "<!DOCTYPE html>\n<head>\n"
  3. echo -e "<style>\ndiv.gallery {\nmargin: 1px;\nborder: 1px solid #ccc;\nfloat: left;\n"
  4. echo -e" width: 180px;\n}\n\ndiv.gallery:hover {\nborder: 1px solid #777;\n}\n\ndiv.gallery img {\n"
  5. echo -e "width: 10%;\nheight: auto;\n}\n"
  6. echo -e "</style>\n</head>\n"
  7. echo -e "<body>\n"
  8.  
  9. cd /home/user/img
  10. #clean up scratch files made by mypaint
  11. rm *.png~
  12. for i in `ls *.png`
  13. do
  14. echo -e "<div class="gallery">"
  15. echo -e  "<a target="$i" href="$i">"
  16. echo -e   " <img src="$i"  width="300" height="200">"
  17. echo -e  "</a>"
  18. echo -e "</div>"
  19. done
  20.  
  21. echo -e "</body>\n</html>"
  22.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement