Model.vue
2.67 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
<!--
* @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>