Arrow.vue
1.46 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
<template>
<div>
<!-- 左箭头 开始 -->
<div class="left_arrow">
<img src="@/assets/images/arrow_left.png" class="img" alt="" />
<img src="@/assets/images/arrow_circle.png" class="circle" alt="" />
</div>
<!-- 左箭头 end -->
<!-- 右箭头 开始 -->
<div class="right_arrow">
<img src="@/assets/images/arrow_right.png" class="img" alt="" />
<img src="@/assets/images/arrow_circle.png" class="circle" alt="" />
</div>
<!-- 右箭头 end -->
</div>
</template>
<script>
export default {
name: 'FixedArrow',
data() {
return {}
}
}
</script>
<style lang="scss" scoped>
.left_arrow,
.right_arrow {
position: fixed;
top: 0;
bottom: 0;
z-index: 10;
width: 100px;
.img {
width: 48px;
height: 48px;
opacity: 0;
cursor: pointer;
position: fixed;
top: 50%;
transform: translateY(-50%);
z-index: 12;
}
.circle {
width: 84px;
height: 84px;
position: fixed;
top: 50%;
// transform: translateY(-50%);
margin-top: -42px;
z-index: 11;
opacity: 0;
}
}
.left_arrow {
left: 0;
.img {
left: 18px;
}
.circle {
left: 0;
}
}
.right_arrow {
right: 0;
.img {
right: 18px;
}
.circle {
right: 0;
}
}
.left_arrow:hover,
.right_arrow:hover {
.img {
opacity: 1;
}
.circle {
opacity: 1;
animation: rotate360 1.2s ease-out 0s;
}
}
@keyframes rotate360 {
100% {
transform: rotate(360deg);
}
}
</style>