index.vue
1.9 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
<template>
<ul class="slide-box">
<li />
<li />
<li />
<li />
</ul>
</template>
<script>
export default {
name: 'IndexBg'
}
</script>
<style lang="scss">
.slide-box {
position: fixed;
width: 100%;
height: 100%;
background-image: url(../../assets/bg/bg-default.jpg);
top: 0;
left: 0;
z-index: 0;
margin: 0;
li {
width: 100%;
height: 100%;
position: absolute;
top: 0;
left: 0;
color: transparent;
background-size: cover;
background-position: 50% 50%;
background-repeat: no-repeat;
opacity: 0;
z-index: 0;
-webkit-backface-visibility: hidden;
-webkit-animation: imageAnimation 48s linear infinite 0s;
-moz-animation: imageAnimation 48s linear infinite 0s;
-o-animation: imageAnimation 48s linear infinite 0s;
-ms-animation: imageAnimation 48s linear infinite 0s;
animation: imageAnimation 48s linear infinite 0s;
&:nth-child(1) {
background-image: url(../../assets/bg/bg-1.jpg);
}
&:nth-child(2) {
background-image: url(../../assets/bg/bg-2.jpg);
-webkit-animation-delay: 12s;
-moz-animation-delay: 12s;
-o-animation-delay: 12s;
-ms-animation-delay: 12s;
animation-delay: 12s;
}
&:nth-child(3) {
background-image: url(../../assets/bg/bg-default.jpg);
-webkit-animation-delay: 24s;
-moz-animation-delay: 24s;
-o-animation-delay: 24s;
-ms-animation-delay: 24s;
animation-delay: 24s;
}
&:nth-child(4) {
background-image: url(../../assets/bg/bg-1.jpg);
animation-delay: 36s;
}
}
}
@keyframes imageAnimation {
0% {
opacity: 0;
animation-timing-function: ease-in;
}
8% {
opacity: 1;
transform: scale(1.15);
animation-timing-function: ease-out;
}
17% {
opacity: 1;
transform: scale(1.2);
}
25% {
opacity: 0;
transform: scale(1.4);
}
100% {
opacity: 0;
}
}
</style>