{{/*  footer  */}}
{{ if ne .Site.Params.footer.enabled false }}
  {{ $author := .Site.Params.author }}
  {{ with .Site.Params.footer }}
    <footer>
      
      {{/*  custom footer  */}}
      {{ if .custom }}
        <div class="footer-line">
          <span> {{ .custom | safeHTML }} </span>
        </div>
      {{ end }}
      {{/*  custom footer ends  */}}

      {{/*  hugo and theme info  */}}
      {{ if ne .hugo false }}
        <div class="footer-line">
          Powered by <a target="_blank" one-link-mark="yes" href="https://gohugo.io" title="Hugo" class="u-theme-f"> Hugo </a> |
          Theme by
          <a target="_blank" one-link-mark="yes" href="https://github.com/SylleoYr/hugo-theme-OriginStart" title="OriginStart" class="u-theme-f">
            <i class="fas fa-heartbeat u-theme-f"></i>&nbsp;OriginStart
          </a>
        </div>
      {{ end }}
      {{/*  hugo and theme info end  */}}

      {{/*  copyright info  */}}
      {{ if ne .copyright false }}
        <div class="footer-line">
          <i class="far fa-copyright fa-fw"></i>
          <span>
            {{ if .since }}
              {{- if lt .since now.Year }} {{ .since }} - {{ end }}
            {{ end }}
            {{ now.Year -}}&nbsp;&nbsp;{{ $author -}}
          </span>
        </div>
      {{ end }}
      {{/*  copyright info ends  */}}

      {{/*  ICP info  */}}
      {{ if .icp }}
        <div class="footer-line">
          <span> {{ .icp | safeHTML }}</span>
        </div>
      {{ end }}
      {{/*  ICP info ends  */}}

    </footer>
  {{ end }}
{{ end }}
{{/*  footer ends  */}}


<script>
  var timer = setInterval(function () {
    localTimer();
  }, 1000);

  function addZero(i) {
    if (i < 10) {
      i = "0" + i;
    }
    return i;
  }

  function localTimer() {
    var today = new Date();
    var time = addZero(today.getHours()) + ":" + addZero(today.getMinutes()) + ":" + addZero(today.getSeconds());
    document.getElementById("current_time").innerHTML = time;

    var date = today.getDate() + ' . ' + (today.getMonth() + 1) + ' . ' + today.getFullYear();
    document.getElementById("current_date").innerHTML = date;
  }
</script>

{{/*  Heweather config */}}
{{ if .Site.Params.heweather }}
<script>
  /**
   * Heweather plugin
   * Thanks the Heweather for supplying this free api
   * https://www.heweather.com/
   * https://dev.heweather.com/
   */
  WIDGET = {
    CONFIG: {
      "modules": "02",
      "background": 5,
      "tmpColor": "rgb(200, 200, 200)",
      "tmpSize": "0.7rem",
      "cityColor": "rgb(200, 200, 200)",
      "citySize": 16,
      "aqiSize": 16,
      "weatherIconSize": "0.7rem",
      "alertIconSize": 18,
      "padding": "0px 0px 0px 0px",
      "shadow": "0",
      "language": "auto",
      "borderRadius": "5",
      "fixed": "false",
      "vertical": "center",
      "horizontal": "center",
      "key": "{{- .Site.Params.heweather -}}"
    }
  }
</script>
<script src="https://widget.heweather.net/simple/static/js/he-simple-common.js?v=1.1"></script>
{{ end }}
{{/*  Heweather config ends  */}}

{{/* ribbon canvas */}}
{{ if .Site.Params.ribbon.enabled }}
  {{ with .Site.Params.ribbon }}
    <script type="text/javascript" size="{{ .size }}" alpha="{{ .alpha }}" zIndex="{{ .zIndex }}" src="./js/ribbon.min.js"></script>
  {{ end }}
{{ end }}
{{/* ribbon canvas ends*/}}

{{/*  custom javascripts  */}}
{{ if .Site.Params.customJS.enabled }}
  {{ range .Site.Params.customJS.items }}
    {{ if ne .activated false}}
      <script src="{{ .url | safeURL }}" defer></script>
    {{ end }}
  {{ end }}
{{ end }}
{{/*  custom javascripts end  */}}
