<template>
  <section id="content">
    <div id="content-header">
      <pre :class="[darkMode ? 'pre-darkmode' : 'pre-lightmode']" id="page-name-login"></pre>
    </div>
    <div id="content-body">
      <LoginForm />
    </div>
  </section>
</template>


<script setup>
import { ref, onMounted } from 'vue';

import LoginForm from "../components/LoginForm.vue";

definePageMeta({
  layout: 'empty',
  title: 'Login',
  auth: false,
})

const darkMode = ref('');

const getSession = async () => {
  const loggedInUserDarkModeBool = getItem('logged-in-user-darkMode');
  if (loggedInUserDarkModeBool == 1) {
    darkMode.value = true;
  } else {
    darkMode.value = false;
  }
}

function getItem(item) {
  if (process.client) {
    return localStorage.getItem(item)
  } else {
    return undefined
  }
}

onMounted(async () => {
  await getSession();
});
</script>

<script>
export default {
  name: "LoginPage",
}
</script>



<style scoped>
* {
  box-sizing: border-box;
}


#content {
  display: flex;
  flex-direction: column;
  float: left;
  justify-content: stretch;
  align-items: center;
  width: 100%;
  flex-grow: 1;
  gap: 0.625rem;
  padding: 0 1.25rem;
}

#content-header {
  display: flex;
  flex-direction: row;
  justify-content: center;
  align-items: center;
  width: 100%;
  height: 3.125rem;
}

#page-name-login {
  text-decoration: none;
  letter-spacing: 5%;
  font: 400 1.5rem/125% Overpass, -apple-system, Roboto, Helvetica, sans-serif;
}

.pre-darkmode {
  color: #fff;
}

.pre-lightmode {
  color: #000;
}

#content-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  width: fit-content;
  height: fit-content;
  gap: 1.25rem;
  margin-bottom: 0.625rem;
  border-radius: 0.625rem;
}
</style>