anime官网地址
anime中文官网地址
<template>
<div class="title">基本使用方法div>
<div class="amine-box">
<div class="old">div>
<div class="animation" ref="ani">div>
div>
<br><br>
template>
<script setup>
import { onMounted, onUnmounted, ref } from 'vue';
import anime from 'animejs'
const ani = ref();
let AniObj = null;
onMounted(() => {
AniObj = anime({
targets: ani.value,
translateX: 300,
rotate: {
value: 360,
duration: 700,
easing: 'easeInOutSine'
},
duration: 1000,
delay: 200,
endDelay: 1000,
easing: 'easeInOutExpo',
loop: true,
direction: 'normal',
autoplay: true,
});
})
onUnmounted(() => {
AniObj.pause();
})
script>
<style lang="less" scoped>
.title {
padding: 5px 10px;
margin-bottom: 10px;
font-size: 16px;
border-bottom: 1px solid #999;
}
.amine-box {
width: 100%;
height: 100px;
position: relative;
background-color: rgba(255, 255, 255, 0.1);
}
.old,
.animation {
position: absolute;
top: 35px;
width: 30px;
height: 30px;
background-color: brown;
left: 60px;
}
.old {
opacity: 0.5;
}
style>
- 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