#!/bin/bash # Default values main_folder="poni" main="red" second="orange" third="black" background="white" n_colors_dither="3" footer="" # Parse command line options while getopts ":f:1:2:3:d:b:foot" opt; do case ${opt} in f ) main_folder="$OPTARG" ;; 1 ) main="$OPTARG" ;; 2 ) second="$OPTARG" ;; 3 ) third="$OPTARG" ;; d ) n_colors_dither="$OPTARG" ;; b ) background="$OPTARG" ;; foot ) footer="$OPTARG" ;; \? ) echo "Invalid option: $OPTARG" 1>&2 exit 1 ;; : ) echo "Invalid option: $OPTARG requires an argument" 1>&2 exit 1 ;; esac done shift $((OPTIND -1)) css=' body { width: 100%; height: 100%; margin: 0; font-family: 'arial'; background-color: var(--bck) } h1{ font-weight: 100; text-align: center; color: var(--main); font-style: italic; font-size: 3rem; margin: 1rem; } h2{ color: var(--second); } a{ text-align: center; color: var(--second); } li a{ color: var(--third); } header,footer p{ align-items: center; display: flex; justify-content: space-between; width: 80%; margin-left: 10%; color: var(--second); font-size: 2rem } footer{ border-top: solid var(--main); bottom: 0; position: fixed; margin-top: 2rem; font-size: 1rem; padding: 1rem; background-color: var(--bck); width: 100% } footer p{ font-size: 1rem; color: var(--third); display: block; } .footer a{ display: inline; } .exception{ color: var(--main) } hr{ color: var(--main); width: 100% !important; } .go{ max-width: 75%; gap: 2rem; display: flex; flex-wrap: wrap; line-height: .5; margin-top: 1rem; } .go a{ margin-right: 1.5rem } .contents{ margin-bottom: 10%; width: 80%; margin-left: 10%; display: grid; grid-template-columns: auto auto auto; } .contents div{ padding: 2rem; display: flex; flex-direction: column; align-items: center; justify-content: center; } img, video { width: 100%; } @media only screen and (max-width: 600px) { .contents{ margin-bottom: 50%; display: flex; flex-direction: column; gap: 2rem; } .contents div{ gap: .5rem; } .go{ font-size: 1rem; line-height: 1.5; width: 70%; display: block; } }" ' # Function to compress and generate HTML links compress_and_generate_links() { local folder="$1" local compressed_folder="compressed" mkdir -p "$folder"/"$compressed_folder" declare -a text_files declare -a picture_files declare -a video_files declare -a audio_files declare -a other_files for file in "$folder"/*; do if [ -f "$file" ]; then case "$file" in *.txt|*.md|*.html|*.sh|*.py|*.js|*.php|*.TXT|*.MD) text_files+=("$file") ;; *.jpg|*.png|*.heic|*.svg|*.JPG|*.PNG|*.HEIC|*.SVG) picture_files+=("$file") ;; # |*.gif|*.GIF) # gif_files+=("$file") # ;; *.mp4|*.mov|*.mkv|*.avi|*.MP4|*.M) video_files+=("$file") ;; *.mp3|*.wav|*.WAV|*.aiff|*.AIFF|*.FLAC|*.MP3|*.flac) audio_files+=("$file") ;; *index.html) # Exclude index.html files continue ;; *) other_files+=("$file") ;; esac fi done # Create index.html file index_file="$folder/index.html" echo "