<!--
    Copyright © 2021 Adrien Agez <adrien.agez@pm.me>

    This file is part of Nexus Timers.

    Nexus Timers is free software: you can redistribute it and/or modify
    it under the terms of the GNU Affero General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    Nexus Timers is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU Affero General Public License for more details.

    You should have received a copy of the GNU Affero General Public License
    along with Nexus Timers.  If not, see <https://www.gnu.org/licenses/>.
-->

<template>
  <div id="app">
    <header v-if="showHeader">
      <span>Nexus Timers</span>
    </header>
    <main>
      <router-view></router-view>
    </main>
  </div>
</template>

<script>
  // The header will be shown if the path match this regex
  const ROUTES_WITH_HEADER = /\/(battlegrounds)?$/

  export default {
    name: 'app',
    computed: {
      showHeader () {
        return ROUTES_WITH_HEADER.test(this.$route.path)
      }
    }
  }
</script>

<style lang="sass" scoped>
  header
    margin: 0
    height: 56px
    padding: 0 16px 0 24px
    @include blizzard-header-gradient
    text-shadow: 0 0 1rem #009cff
    color: #fff
    span
      display: block
      position: relative
      font-size: 20px
      line-height: 1
      letter-spacing: .02em
      font-weight: 400
      box-sizing: border-box
      padding-top: 16px


</style>

<style lang="sass">
  body
    margin: 0

  html
    font-family: Avenir, Helvetica, Arial, sans-serif
    -webkit-font-smoothing: antialiased
    -moz-osx-font-smoothing: grayscale
    color: $blizzard-font-color
    text-shadow: 0 0 1rem #009cff
    background-color: $blizzard-background-color

</style>
