-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfaxMachine.vue
156 lines (154 loc) · 3.14 KB
/
faxMachine.vue
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
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
<template>
<view>
<view class="share-user flex-center">
<view class="user-avatar">
<image class="avatar" src="/static/icon/logo.png"></image>
</view>
<view class="chat-dialog"></view>
</view>
<view class="area">
<view class="box">
<view class="up"></view>
<view class="down">
<view class="card" :animation="animationData">
<view class="cards" v-for="item in list" :key="item"></view>
</view>
</view>
</view>
<view class="fill" v-for="item in fill" :key="item"></view>
</view>
<button @click="begin">click me</button>
</view>
</template>
<script>
export default {
name: 'example',
data() {
return {
animation: null,
animationData: null,
list: [1],
fill: []
}
},
onLoad() {
this.animation = uni.createAnimation({
duration: 1000,
timingFunction: 'linear',
delay: 0
})
},
methods: {
begin() {
this.list.push(this.list[this.list.length - 1] + 1)
if (this.list.length >= 3) {
this.fill.push(this.list[this.list.length - 1] + 1)
}
let distance = 100 - (this.list.length - 1) * 85
this.animation.bottom(distance).step()
this.animationData = this.animation.export()
}
}
}
</script>
<style lang="scss" scoped>
.area {
margin: 80px auto 0;
width: 500px;
overflow: hidden;
.fill {
width: 100%;
height: 160px;
background-color: rgb(62, 70, 80);
}
}
.box {
position: relative;
width: 100%;
height: 400px;
.up, .down {
position: absolute;
left: 0;
width: 100%;
}
.up {
top: 0;
height: 180px;
background-color: #adc2eb;
z-index: 19;
}
.down {
top: 180px;
position: relative;
height: 220px;
background-color: #2952a3;
z-index: 9;
.card {
display: flex;
align-items: center;
flex-direction: column-reverse;
position: absolute;
left: 50%;
transform: translateX(-50%);
bottom: 200px;
z-index: 15;
.cards {
width: 300px;
height: 150px;
}
.cards:first-child{
background-color: #ffffff;
}
.cards:nth-child(2) {
background-color: #ffe5ff;
}
.cards:nth-child(3) {
background-color: #ffccff;
}
.cards:nth-child(4) {
background-color: #ffb3ff;
}
.cards:nth-child(5) {
background-color: #ff99ff;
}
.cards:last-child {
background-color: lemonchiffon;
}
.cards+.cards {
margin-bottom: 20px;
}
}
}
}
.share-user {
width: 100%;
height: 160px;
.user-avatar {
width: 100px;
height: 100px;
border-radius: 50%;
overflow: hidden;
.avatar {
width: 100%;
}
}
.chat-dialog {
position: relative;
width: 500px;
height: 140px;
border-radius: 16px;
background-color: lightgreen;
margin-left: 40px;
&::after {
content: '';
position: absolute;
left: -40px;
top: 40px;
width: 0;
height: 0;
border: 20px solid transparent;
border-right: 20px solid lightgreen;
}
}
}
</style>