#!/bin/bash # Copyright 2020 Iglou.eu # Copyright 2020 Adrien Kara # license that can be found in the LICENSE file. shopt -s extglob # SIG TRAP trap "quit" 2 3 # FUNCTION err() { echo "($(date --rfc-3339="seconds")) FATAL ERROR: ${1}" exit 1 } msg() { echo "($(date --rfc-3339="seconds")) ${1}" } quit() { msg "Program Termination" exit 0 } initBuilder() { [[ $canvas_r -gt 0 ]] || err "Rows canot be lower or equal 0" [[ $canvas_c -gt 0 ]] || err "Columns canot be lower or equal 0" [[ -r $in_css ]] || err "Cant't find '$in_css' file" [[ -r $in_html ]] || err "Cant't find '$in_html' file" [[ -w $out_dir ]] || err "Folder '$out_dir' not writable for '${USER:-...}'" } buildGrid() { local _gcss local _grid local _cbox local _color="${1}" for id in $(seq "$cells") do _gcss+="#cell-${_color}-${id}[type=\"checkbox\"]:checked ~ #grid-cells #color-${_color} #celldraw-${_color}-${id}, " _cbox+="" _grid+="" done grid_css+="${_gcss::-2} {opacity: 100%} " grid_check+="${_cbox}" grid_cells+="