<template>
  <div class="describe">
    <div class="d-name animation" :class="{'l-animation':isLeft&&showAni,'r-animation':!isLeft&&showAni}">{{title}}</div>
    <div class="d-describe animation" :class="{'l-animation':isLeft&&showAni,'r-animation':!isLeft&&showAni}" :style="{transitionDelay:`${(i+1)*0.1*Math.random()}s`}" v-for="(item,i) in sub" :key="i">
      <span>{{item.detail}}</span>
    </div>
  </div>
</template>

<script>
export default {
  props: ['title', 'sub', 'isLeft', 'showAni']
}
</script>

<style scoped>
  .describe{
    text-align: left;
  }
  .d-name{
    font-size: 40px;
    font-weight: bold;
    transition: transform 0.5s ease;
    margin-bottom: 25px;
  }
  .d-describe{
    font-size: 14px;
    width: 350px;
    line-height: 2;
    transition: transform 0.5s ease;
  }
  .l-animation{
    transform: translateX(-900px);
    transition: transform 0.5s ease;
  }
  .r-animation{
    transform: translateX(900px);
    transition: transform 0.5s ease;
  }

  @media screen and (max-width: 1200px) {
      .d-name{
        font-size: 32px;
      }
      .d-describe{
        font-size: 12px;
        width: 320px;
      }
  }
  @media screen and (max-width: 770px) {
    .d-describe{
      width: 268px;
    }
  }
</style>
