我该如何实现与以下codepen链接相似的动画效果?
https://codepen.io/whusterj/pres/bdYKop
HTML代码:
CSS 代码
<div class="floating"
style="height: 50px; width: 50px; background: rgb(200,200,200);">
</div>
CSS 代码
.floating {
animation-name: floating;
animation-duration: 3s;
animation-iteration-count: infinite;
animation-timing-function: ease-in-out;
margin-left: 30px;
margin-top: 5px;
}
@keyframes floating {
from { transform: translate(0, 0px); }
65% { transform: translate(0, 15px); }
to { transform: translate(0, -0px); }
}
在React Native(Android应用)中
我尝试使用react-native Animated进行探索,但没有成功
有人能展示一下实现相同效果的代码吗?
那将非常有帮助
谢谢