<template>
  <div>
    <div id="logo-container">
      <img src="./media/logo_small.png" alt="Splitfair-Logo" height="56px"/>
    </div>
    <div>
      <div id="app">
        <div id="parent-container">
          <div id="container">
            <div id="title-container">
              <h1>{{ this.$route.name }}</h1>
              <nav v-if="shouldShowNavigation()">
                <router-link v-if="this.$route.path==='/'" to="/createGroup">New Group</router-link>
                <router-link v-else to="/">My Groups</router-link>
                <router-link to="/user">User</router-link>
              </nav>
            </div>
            <router-view/>
          </div>
        </div>
      </div>
    </div>
    <div id="footer-container">
      <p id="p-app"> Developed@Ost </p>
      <img src="./media/logo-ost.svg" alt="developed@OST" height="48px"/>
    </div>
  </div>
</template>

<script>
export default {
  methods: {
    shouldShowNavigation() {
      return !(this.$route.path === '/login' || this.$route.path === '/register');
    }
  }
}
</script>

<style>
* {
  margin: 0;
  padding: 0;
  font-family: adelle-sans, sans-serif;
  box-sizing: border-box;
}

#parent-container {
  display: flex;
  justify-content: center;
}

#container {
  border-radius: 20px;
  background: rgb(231, 231, 231);
  width: 80vw;
  height: 80vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  position: absolute;
  top: 50%;
  transform: translate(0, -50%);
  padding: 13rem 3.7rem 3.7rem;
}

#logo-container {
  position: absolute;
  top: 12px;
  right: 24px;
  z-index: 100;
  height: 100px;
  justify-content: space-around;
  margin-right: auto;
}

#footer-container {
  position: absolute;
  bottom: 6px;
  right: 24px;
  z-index: 100;
  height: 80px;
  justify-content: space-around;
  margin-right: auto;
}

#p-app {
font-size: 0.5rem;
}

h1 {
  font-size: 2.4rem;
  letter-spacing: 1px;
  text-transform: uppercase;
  font-weight: 700;
}

h2 {
  font-size: 1.2rem;
  text-decoration: underline;
  text-decoration-color: gray;
  letter-spacing: 1px;
  font-weight: bolder;
  text-transform: uppercase;
}

#title-container {
  display: flex;
  width: 90%;
  justify-content: space-between;
  margin-bottom: 5rem;
  position: absolute;
  top: 5%;
  border-bottom: 1px solid black;
}

#title-container nav {
  display: flex;
  list-style-type: none;
  justify-content: space-between;
  width: 18rem;
}

#title-container nav a {
  background: #d72765;
  border-radius: 40px;
  color: white;
  padding: 1.5rem;
  text-decoration: none;
  margin: 10px;
}

#title-container nav a:first-child {
  background: #8c185f;
}

label {
  font-size: 1.2rem;
  margin-bottom: 0.2rem;
  margin-top: 0.5rem;
}

input {
  display: flex;
  margin-top: 10px;
  height: 3rem;
  border: none;
  border-radius: 10px;
  margin-bottom: 1rem;
}

input:focus {
  background-color: #d72765;
  border-radius: 10px;
  border-color: #8c195f;
}

.column-container {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

#logo-container > img {
  opacity: 1;
}

#app {
  display: block;
}

a {
  text-decoration: none;
}
</style>
