一、网易云
<script src="https://cdn.bootcss.com/vue/2.6.10/vue.js"></script>
<style>
* {
margin: 0;
padding: 0
}
.handle {
position: absolute;
left:37%;
transform-origin: 60px 60px;
transform: rotate(-30deg);
}
.container{
position: relative;
width:600px;
}
.pan{
position: absolute;
top:200px;
}
.move{
animation: move 2s forwards;
}
@keyframes move{
0%{
transform:rotate(-30deg)
}
100%{
transform:rotate(0deg)
}
}
@keyframes unmove{
0%{
transform:rotate(0deg)
}
100%{
transform:rotate(-30deg)
}
}
.unmove{
animation: unmove 2s forwards;
}
</style>
</head>
<body>
<div class="container">
<img @click="handleClick" class="pan" src="images/pan.png" alt="">
<img :class="[isPlay?'move':'unmove','handle']" src="images/shou.png" alt="">
</div>
<script>
new Vue({
el:".container",
data:{
isPlay:false
},
methods:{
handleClick(){
this.isPlay = !this.isPlay;
}
}
})
</script>