<template>
  <div class="link_card_container">
    <div class="card mr" @click="toPage('/')">
      <div class="modal">
        <h1 class="title">整机开发</h1>
        <div class="btn">
          <p class="text">立即前往</p>
          <img :src="Arrow" class="icon" alt="" />
        </div>
        <p class="en">Complete machine</p>
      </div>
      <img class="bg_img" :src="B1" alt="" />
    </div>
    <div class="card mr" @click="toPage('/pc/hardware')">
      <div class="modal blbg">
        <h1 class="title">软硬件定制</h1>
        <div class="btn">
          <p class="text">立即前往</p>
          <img :src="Arrow" class="icon" alt="" />
        </div>
        <p class="en">Hardware</p>
      </div>
      <img class="bg_img" :src="B4" alt="" />
    </div>
    <div class="card" @click="toPage('/pc/metal')">
      <div class="modal">
        <h1 class="title">CNC机加工</h1>
        <div class="btn">
          <p class="text">立即前往</p>
          <img :src="Arrow" class="icon" alt="" />
        </div>
        <p class="en">Machining</p>
      </div>
      <img class="bg_img" :src="B3" alt="" />
    </div>
  </div>
</template>

<script setup>
import B1 from '@/assets/design/link/1.png'
import B2 from '@/assets/design/link/2.png'
import B3 from '@/assets/design/link/3.png'
import B4 from '@/assets/design/link/4.png'
import Arrow from '@/assets/design/link/arrow.png'
import { useRouter, useRoute } from 'vue-router'

const router = useRouter()
const route = useRoute()

const toPage = (path, p) => {
  window.location.href = `http://iflytop.com${path}`
}
</script>

<style lang="scss" scoped>
@keyframes btnAnimation {
  0% {
    transform: translateX(0);
  }
  25% {
    transform: translateX(25px);
  }
  75% {
    transform: translateX(-25px);
  }
  100% {
    transform: translateX(0);
  }
}

.link_card_container {
  padding: 0 48px;
  padding-bottom: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
  .card {
    flex: 1;
    height: 287px;
    position: relative;
    cursor: pointer;
    display: flex;
    align-items: center;
    .bg_img {
      width: 290.42px;
      height: 287px;
      object-fit: cover;
    }
    .modal {
      height: 100%;
      padding-left: 36px;
      box-sizing: border-box;
      display: flex;
      flex-direction: column;
      justify-content: center;
      align-items: flex-start;
      background: #000;
      flex: 1;
      .title {
        font-family: AlibabaPuHuiTi;
        font-size: 40px;
        font-weight: bold;
        line-height: normal;
        letter-spacing: 0.06em;
        color: #f6f6f6;
      }
      .btn {
        margin-top: 15px;
        margin-bottom: 9px;
        border-radius: 324px;
        padding: 4px 24px;
        background: #2a4ee1;
        display: flex;
        align-items: center;
        justify-content: center;
        .text {
          font-family: Source Han Sans CN;
          font-size: 16px;
          font-weight: normal;
          line-height: normal;
          letter-spacing: 0.1em;
          color: #ffffff;
          margin-right: 4px;
        }
        .icon {
          width: 12px;
          height: 2px;
        }
      }
      .en {
        font-family: Poppins;
        font-size: 16px;
        font-weight: 500;
        line-height: normal;
        letter-spacing: 0em;
        color: #ffffff;
      }
    }
    .blbg {
      background: #2a4ee1;
      .btn {
        background: #000;
      }
    }
    &:hover {
      .modal {
        .btn {
          animation-name: btnAnimation;
          animation-duration: 1s;
        }
      }
    }
  }
  .mr {
    margin-right: 20px;
  }
}
</style>
