<template>
  <div id="app">
    <Header version="pre-alpha" />
    <Combat :left="left" :right="right" :combatants="combatants" />
  </div>
</template>

<script lang="ts">
import { Component, Vue, Prop } from 'vue-property-decorator'
import Combat from './components/Combat.vue'
import Header from './components/Header.vue'
import * as Creatures from '@/game/creatures'
import { Creature, POV } from '@/game/entity'
import { ProperNoun } from '@/game/language'

@Component({
  components: {
    Combat, Header
  }
})
export default class App extends Vue {
  left: Creature
  right: Creature
  combatants: Array<Creature>
  constructor () {
    super()
    this.left = new Creatures.Wolf()
    this.left.name = new ProperNoun("Wolf")
    this.right = new Creatures.Cafat()
    const wolf1 = new Creatures.Wolf()
    wolf1.name = new ProperNoun("Innermost Wolf")
    const wolf2 = new Creatures.Wolf()
    wolf2.name = new ProperNoun("Inner Wolf")
    this.combatants = [this.left, this.right, wolf1, wolf2]
    this.left.perspective = POV.First
    console.log(this.left)
    console.log(this.right)
  }
}
</script>

<style>
body, html {
  background: #181818;
  width: 100%;
  height: 100%;
  overflow-x: hidden;
}

#app {
  font-family: Avenir, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-align: center;
  color: #ddd;
  background: #111;
  width: 100%;
  max-width: 1000pt;
  margin: auto;
  height: 100%;
  display: flex;
  flex-direction: column;
}

.stat-entry {
  position: relative;
}

.stat-entry::after {
  opacity: 0;
  position: absolute;
  color: #eee;
  font-size: 0pt;
  content: attr(data-tooltip);
  transition: 0.1s;
  pointer-events: none;
  left: 0pt;
  top: 0pt;
  transform: translate(calc(-50% + 16pt), -100%);
  background: #555;
  padding: 8pt;
  border-radius: 8pt;
  z-index: 1;
}

.stat-entry:hover::after {
  font-size: 18pt;
  opacity: 1;
}

.stat-entry::before {
  opacity: 0;
  position: absolute;
  color: #eee;
  font-size: 0pt;
  content: attr(data-tooltip-full);
  pointer-events: none;
  left: 0pt;
  top: 0pt;
  transform: translate(calc(-50% + 16pt), calc(-100% - 18pt - 16pt));
  white-space: nowrap;
  transition: 0.1s;
  background: #555;
  padding: 8pt;
  border-radius: 8pt;
  z-index: 1;
}

.stat-entry:hover::before {
  font-size: 12pt;
  transition: all 1s cubic-bezier(1, 0, 0.75, 0);
  opacity: 1;
}

</style>
