#!/bin/bash

if [ "$1" = "help" ]; then
    echo "Usage: ${0##*/} [options]"
    echo '    start="start"        start the html, import the css and js'
    echo '    end="end"            finalize the html'
    echo '    title="title"        page title'
    echo '    icon="icon.svg"      page icon'
    echo ''
fi

htmlStart() {
    local LANG=C

#It is only necessary to declare the variables that need changes in the content, the file that calls this script already creates the variable that will be used in the script


# Function to start the HTML document
read -d $'' ShowText <<EOF
<!DOCTYPE html>
<html>
    <head>
        <meta charset='UTF-8'>
        <meta name='viewport' content='width=device-width, initial-scale=1'>
        <title>$title</title>
        <link rel='icon' href='$icon'>
        <link rel="stylesheet" href="/usr/share/bigbashview/bcc/css/bootstrap-biglinux.css">
        <link rel="stylesheet" href="/usr/share/javascript/bootstrap/css/bootstrap.css">
        <script src="/usr/share/javascript/bootstrap/js/bootstrap.bundle.js"></script>
        <script src="/usr/share/bigbashview/bcc/js/jquery-3.7.0.js"></script>
        <script src="/usr/share/bigbashview/bcc/js/htmx.js"></script>
    </head>
    <body class="bg-primary">
EOF
echo "$ShowText"
}

# header

# read -d $'' ShowText <<EOF
# <!--<header class="col-sm d-flex align-items-center justify-content-center py-3">
#     <nav class="nav nav-pills nav-justified">
#       <div class="nav nav-tabs" id="nav-tab" role="tablist">
#         
#         <button class="nav-link active" id="nav-home-tab" data-bs-toggle="tab" data-bs-target="#nav-home" type="button" role="tab" aria-controls="nav-home" aria-selected="true"><img src="icons/temas.svg" width="35px" height="35px" class="mx-1 me-2"/>Temas</button>
#         
#         <button class="nav-link" id="nav-profile-tab" data-bs-toggle="tab" data-bs-target="#nav-profile" type="button" role="tab" aria-controls="nav-profile" aria-selected="false"><img src="icons/desktops.svg" width="35px" height="35px" class="mx-1 me-2"/>Desktops</button>
# 
#       </div>
#     </nav>
# </header>
# <div class="tab-content bg-secondary" id="nav-tabContent" >
#   <div class="tab-pane fade show active" id="nav-home" role="tabpanel" aria-labelledby="nav-home-tab" tabindex="0">
#       <label class="form-check-label" for="${id}">XPTO</label>
#   </div>
#   <div class="tab-pane fade" id="nav-profile" role="tabpanel" aria-labelledby="nav-profile-tab" tabindex="0">
#       <label class="form-check-label" for="${id}">otpx</label>
#   </div>
# </div>-->
#
#
# EOF
# echo "$ShowText"


# Function to end the HTML document
# end
htmlEnd() {
echo '</html>'
}
