<template>
  <PageMeta
      title="Olivier Massot - Fullstack developer"
      description=""
  />

  <div class="banner">
    <h1>
      {{ $t('Fullstack developer') }}
    </h1>

    <h2>
      {{ $t('x_years_experience', { years: XP_YEARS }) }}
    </h2>
  </div>

  <div class="introduction">
    <div>
      {{ $t('intro_short') }}
    </div>

    <div v-html="$t('intro_part_4')" />

    <v-expand-transition>
      <div v-if="showLongIntro">
        <div>
          {{ $t('intro_part_1') }}
        </div>

        <div>
          {{ $t('intro_part_2') }}
        </div>

        <div>
          {{ $t('intro_part_3') }}
        </div>
      </div>
    </v-expand-transition>

    <v-btn
      size="small"
      variant="text"
      :prepend-icon="showLongIntro ? 'fas fa-caret-up' : 'fas fa-caret-down'"
      @click="showLongIntro=!showLongIntro"
    >
      {{ showLongIntro ? $t('show_less') : $t('show_more') }}
    </v-btn>

    <div class="logos mt-3">
      <BannerLogo
        href="https://github.com/olinox14"
        :img="theme.global.name.value === 'light' ? '/images/logos/github_large_light.png' : '/images/logos/github_large_dark.png'"
        :alt="i18n.t('Find me on Github')"
      />

      <BannerLogo
        href="https://stackoverflow.com/users/4279120/olinox14"
        :img="theme.global.name.value === 'light' ? '/images/logos/stackoverflow.svg' : '/images/logos/stackoverflow-dark.svg'"
        :alt="i18n.t('Find me on Stackoverflow')"
        class="so-logo"
      />

      <BannerLogo
        href="https://www.linkedin.com/in/olivier-massot-60b87b181"
        img="/images/logos/linkedin.png"
        :alt="i18n.t('Find me on LinkedIn')"
      />

      <BannerLogo
        href="https://www.codingame.com/profile/75dcc329745def530c02ddb4485f22235683081"
        img="/images/logos/codingame.svg"
        :alt="i18n.t('Find me on Codingame')"
      />
    </div>
  </div>

  <div class="content">
    <div class="badges">
      <h3>{{ $t("Competences") }}</h3>

      <BadgeSection />
    </div>

    <div class="cursus">
      <h3>{{ $t("Cursus") }}</h3>

      <Cursus />
    </div>
  </div>

  <div class="contact">
    <h3>{{ $t("Contact") }}</h3>

    <Contact />
  </div>

</template>

<script setup lang="ts">

import { useTheme } from 'vuetify'
import type { Ref } from '@vue/reactivity'
import BadgeSection from '~/components/BadgeSection.vue'

const i18n = useI18n()

const theme = useTheme()

const START_YEAR = 2011
const CURRENT_YEAR = new Date().getFullYear();

const XP_YEARS = CURRENT_YEAR - START_YEAR

const showLongIntro: Ref<boolean> = ref(false)

</script>

<style scoped lang="scss">
.banner {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 20px;

  h2 {
    margin: 18px 0 36px 0;
    border-bottom: none;
  }
}

.introduction {
  text-align: justify;
  padding: 36px 64px;
  border-radius: 16px;
  background: rgba(var(--v-theme-primary-alt), 0.1);
  margin-bottom: 36px;

  div {
    margin-bottom: 16px;
  }

  .v-btn {
    width: 100%;
    margin: 8px auto;
  }

  :deep(a) {
    color: rgb(var(--v-theme-on-neutral));
    font-weight: 900;
    text-decoration: none;
  }

  .logos {
    display: flex;
    flex-direction: row;
    max-width: 600px;
    margin: 0 auto;
  }
}

h3 {
  margin: 12px 0 24px 0;
}

.content {
  display: flex;
  flex-direction: row;
  justify-content: space-around;

  .badges {
    max-width: 65%;
  }

  .cursus {
    max-width: 35%;
    padding: 24px;
  }

  @media (max-width: 1280px) {
    flex-direction: column;

    .badges {
      max-width: 100%;
    }

    .cursus {
      max-width: 100%;
    }
  }
}

.badges {
  padding: 18px;
}
</style>