Model.vue 2.67 KB
<!--
 * @Description: 
 * @Author: huyue
 * @Date: 2023-07-04 13:55:35
 * @LastEditors: yangming yangming@didihu.com.cn
 * @LastEditTime: 2024-01-26 20:58:36
-->
<template>
  <div class="model-box">
    <div class="model-title">{{ modelTitle }}</div>
    <div class="model-line">
      <img src="@/assets/images/car/line.png" />
    </div>
    <div class="model-body">
      <div
        class="model-item"
        v-for="(item, index) in modelList"
        :key="'model'+index"
        :class="{ p16: index < 5 ? true : false }"
        :style="{
          backgroundImage: 'url(' + require(`@/assets/images/car/car_${item.order}.png`) + ')',
          height: toTransform(item.height),
          width: toTransform(item.width),
          top: toTransform(item.top),
          right: toTransform(item.right)
        }"
      >
        <div class="model-item-title" :class="{ filter_7: item.filter ? true : false }">{{ item.title }}</div>
        <div class="model-item-content">{{ item.content }}</div>
      </div>
    </div>
  </div>
</template>

<script>
import { modelTitle, modelList,VW } from './data'
export default {
  name: 'Model',
  data() {
    return { modelTitle, modelList }
  },
  created() {},
  methods: {
    toTransform(val) {
      return ((100 * val) / VW).toFixed(2) + 'vw'
    }
  }
}
</script>

<style lang="scss" scoped>
.model-box {
  position: absolute;
  top: 167px;
  right: 70px;
  .model-title {
    font-weight: 700;
    font-size: 24px;
    color: #77e9ff;
    letter-spacing: 0;
    text-align: center;
    width: 804.82px;
    margin-left: calc(100% - 800px);
    background: linear-gradient(to right, #01a4f9, #6df5f9);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
  }
  .model-line {
    margin: 5px 0px 0px calc(100% - 800px);
    width: 804.82px;
    height: 12.23px;
  }
  .model-body {
    position: relative;
    width: 1575.18px;
    height: 915.9px;
    background: url('../../assets/images/car/road.png');
    background-size: 100% 100%;
    .model-item {
      position: absolute;
      background-size: 100% 100%;
      padding: 13px 10px;
      box-sizing: border-box;
      &.p16 {
        padding: 16px;
      }
      &-title {
        font-weight: 700;
        font-size: 18px;
        color: #44ffff;
        letter-spacing: 0;
        background: linear-gradient(to right, #01a4f9, #6df5f9);
        background-clip: text;
        -webkit-background-clip: text;
        -webkit-text-fill-color: transparent;
        margin-bottom: 4px;
        &.filter_7 {
          opacity: 0.7;
        }
      }
      &-content {
        font-size: 15px;
        color: #ffffff;
        line-height: 20px;
      }
    }
  }
}
</style>