<script setup lang="ts">
import pic from '@/page/urge/assets/teacher.png'

interface Staff {
  name: string
  education: string
  tags: string[]
  intro: string
  pic: string
  content: string[]
}

const staffs: Staff[] = [
  {
    name: '李老师',
    education: '人民政法大学 / 本科',
    pic,
    tags: ['高级督学师', '高级督学师', '高级督学师', '高级督学师'],
    intro: '新东方学习成长中心“斜杆青年”',
    content: [
      '简介文案简介文案简介文案简介文案简简介文案简介文案简介文案简介文案简简介文案简介文案简介文案简介文案简介',
      '简介文案简介文案简介文案简介文案简简介文案简介文案简介文案简介文案简简介文案简介文案简介文案简介文案简介',
      '简介文案简介文案简介文案简介',
    ],
  },
  {
    name: '李老师',
    education: '人民政法大学 / 本科',
    pic,
    intro: '新东方学习成长中心“斜杆青年”',
    tags: ['sssssssssss'],
    content: [
      '简介文案简介文案简介文案简介文案简简介文案简介文案简介文案简介文案简简介文案简介文案简介文案简介文案简介',
      '简介文案简介文案简介文案简介文案简简介文案简介文案简介文案简介文案简简介文案简介文案简介文案简介文案简介',
      '简介文案简介文案简介文案简介',
    ],
  },
]
</script>

<template>
  <div class="staff-list">
    <div v-for="item in staffs" :key="item.name" class="card">
      <div class="card-pic">
        <img :src="item.pic" :alt="item.name" />
      </div>
      <div class="card-body">
        <div class="card-title">
          <h2>{{ item.name }}</h2>
          <span v-for="(tag, index) in item.tags" :key="index" class="card-tag">
            {{ tag }}
          </span>
          <span class="card-education">{{ item.education }}</span>
        </div>
        <div class="card-intro">{{ item.intro }}</div>
        <p v-for="(content, index) in item.content" :key="index">{{ content }}</p>
      </div>
    </div>
  </div>
</template>

<style scoped lang="scss">
.staff-list {
  height: calc(100vh - 136px);
  padding-bottom: $space-4_h;
  overflow-y: auto;
  overflow-x: hidden;
  outline: none;
}

.card-title {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  column-gap: 16px;

  &:after {
    display: block;
    content: ' ';
    height: 0.17vh;
    width: 100%;
    background: repeating-linear-gradient(
      to right,
      #ccc,
      #ccc 10px,
      transparent 10px,
      transparent 20px
    );
    margin: 2vh 0;
  }

  .card-tag {
    border-radius: 0.83vh;
    background: #92fc90;
    padding: 0.33vh 24px;

    color: $font-color;
    font-size: 2.33vh;
    font-weight: 400;
    line-height: 3.5vh;
  }

  h2 {
    color: $font-color;
    font-family: $font-special, serif;
    font-size: 4vh;
    font-style: normal;
    font-weight: 400;
    line-height: 6vh;
    display: flex;
    align-items: center;

    & + .card-education {
      margin-left: $space-2;
    }
  }

  .card-education {
    color: #666;
    font-family: OPPOSans, Arial, sans-serif;
    font-size: 2.33vh;
    font-style: normal;
    font-weight: 400;
    line-height: 3.5vh;
  }
}

.card {
  position: relative;

  + .card {
    margin-top: 2vh;
  }
}

.card:nth-child(even) {
  padding-left: 0;

  .card-pic {
    left: auto;
    right: 0;
    transform: scaleX(-1);
  }

  .card-body {
    padding: 2vh 339px 2.67vh 32px;
    border-radius: 2vh 10.25vh 2vh 2vh;
  }
}

.card-pic {
  position: absolute;
  background: linear-gradient(4deg, #b3ffd8 8.53%, #e3ffd3 84.26%);
  border: 0.33vh solid $font-color;
  border-radius: 50%;
  overflow: hidden;
  width: 246px;
  height: 20.5vh;
  z-index: 1;

  img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
  }
}

.card-body {
  background:
    linear-gradient(0deg, #f9fff5 0%, #f9fff5 100%),
    linear-gradient(180deg, #fafafa 0%, #f9f5ff 100%);
  padding: 2vh 32px 2.67vh 339px;
  border: 0.33vh solid $font-color;
  filter: drop-shadow(0px 2px 2px rgba(0, 0, 0, 0.25));
  border-radius: 10.25vh 2vh 2vh;
  position: relative;

  &::after {
    content: ' ';
    display: block;
    width: 410px;
    height: 30.08vh;
    background: url('../../assets/hole.svg') no-repeat;
    position: absolute;
    right: 0;
    bottom: 0;
  }

  p {
    color: #666;
    font-size: 2.33vh;
    font-style: normal;
    font-weight: 400;
    line-height: 3.5vh;
    display: flex;
    margin-top: $space-2_h;

    &::before {
      display: block;
      content: ' ';
      width: 40px;
      flex-shrink: 0;
      height: 3.33vh;
      background: url('../../assets/leaf.svg') center no-repeat;
      margin-right: $space-2;
    }
  }
}

.card-intro {
  margin-top: 0.33vh;
  color: $font-color;
  font-size: 2.67vh;
  font-style: normal;
  font-weight: 400;
  line-height: 4vh;
}
</style>
