html jsgif效果类似,18种基于anime.js的文字动画特效

该博客介绍了一种利用anime.js库制作文字动画特效的方法。通过前后导航按钮切换文字时,可以实现不同动画效果。文章提供了代码示例,展示了如何初始化和展示、隐藏文字动画,并建议读者参考anime.js的官方文档以了解更多详细信息。
摘要由CSDN通过智能技术生成

这是一款基于anime.js的文字动画特效。这些文字效果是通过前后导航按钮切换文字时,制作不同的文字动画特效。

使用方法

下面是其中一种文字动画特效的GIF动态图片演示效果:

b80ef7bdd249746db93f9051784020ca.gif

制作这组文字动画特效的js代码类似下面的样子:

// Initialize

var txt = new TextFx(this.el.querySelector('.title'));

// Show letters:

// txt.show([effect] [,callback]);

// If nothing is passed, then there's no animation.

// ´effect´ can either be one of the predefined effects: ['fx1',...,'fx17'] or

// an object literal representing both, in and out animations (anime.js based).

// Example:

effect = {

in: {

duration: 500,

delay: function(el, index) {

return 250+index*40;

},

easing: 'easeOutExpo',

opacity: 1,

translateY: ['50%','0%']

},

out: {

duration: 500,

delay: function(el, index) {

return index*40;

},

easing: 'easeOutExpo',

opacity: 0,

translateY: '-50%'

}

}

// ´callback´ is the callback function, after all the letters finished the animation.

// Hide letters:

// txt.hide([effect] [,callback]); (same logic of show)

关于anime.js更详细的用法,可以参考它的说明文档。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值