-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgenerate.sh
37 lines (35 loc) · 903 Bytes
/
generate.sh
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
echo "<!DOCTYPE html>"
echo "<html>"
echo "<head>"
echo "<meta charset=\"UTF-8\">"
echo "<title>Image Gallery</title>"
echo "<style>"
echo " .gallery {"
echo " display: grid;"
echo " grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));"
echo " grid-gap: 10px;"
echo " }"
echo " .gallery img {"
echo " width: 100%;"
echo " height: 100%;"
echo " object-fit: cover;"
echo " }"
echo " .glb-name {"
echo " font-size: 12px;"
echo " text-align: center;"
echo " }"
echo "</style>"
echo "</head>"
echo "<body>"
echo "<div class=\"gallery\">"
find . -type f -name "*.png" | sort | while read -r file; do
glb_file="${file%.*}.glb"
base_name="$(basename "$glb_file" .glb)"
echo " <div>"
echo " <a href=\"$glb_file\"><img src=\"$file\"></a>"
echo " <div class=\"glb-name\">$base_name</div>"
echo " </div>"
done
echo "</div>"
echo "</body>"
echo "</html>"