-
Notifications
You must be signed in to change notification settings - Fork 0
/
transition-css.html
66 lines (51 loc) · 1.53 KB
/
transition-css.html
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
<!DOCTYPE html>
<html lang="pt-BR">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Transições CSS</title>
<link rel="stylesheet" href="node_modules/bootstrap/dist/css/bootstrap.min.css">
<style>
.first-enter-active {
transition: opacity .5s ease;
}
.first-leave-active {
transition: opacity .5s ease-out;
}
.first-enter, .first-leave-to {
opacity: 0;
}
.second-enter-active {
transition: all .3s linear;
}
.second-leave-active {
transition: all .5s linear;
}
.second-enter, .second-leave-to {
opacity: 0;
}
</style>
</head>
<body>
<div id="transitions">
<transition name="first">
<h2 v-if="show">Hcode Treinamentos</h2>
</transition>
<hr>
<transition name="second">
<div v-if="show2">Lorem ipsum dolor sit amet consectetur adipisicing elit. Magnam dolorum cupiditate obcaecati officia ratione autem laboriosam est eveniet adipisci? Doloremque reprehenderit ipsam rerum hic fuga laborum earum consequuntur molestias beatae.</div>
</transition>
<button @click="show2 = !show2">Clique aqui</button>
</div>
<script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
<script>
let app = new Vue({
el: '#transitions',
data: {
show: true,
show2: false
}
})
</script>
</body>
</html>