当前位置: 首页 > news >正文

阿里大鱼 wordpressseo整站优化新站快速排名

阿里大鱼 wordpress,seo整站优化新站快速排名,松江新城建设发展有限公司网站,德钦网站建设前端实现json动画(附带示例) 使用lottie制作动画。1.json动画2.实现效果3.git仓库4.运行5.json动画天堂6.代码7. 经常使用的方法 使用lottie制作动画。 1.json动画 废话不多说,直接看效果图2.实现效果 3.git仓库 https://gitee.com/chaiach…

前端实现json动画(附带示例)

  • 使用lottie制作动画。
    • 1.json动画
    • 2.实现效果
    • 3.git仓库
    • 4.运行
    • 5.json动画天堂
    • 6.代码
    • 7. 经常使用的方法

使用lottie制作动画。

1.json动画

 废话不多说,直接看效果图

2.实现效果

在这里插入图片描述

3.git仓库

https://gitee.com/chaiachai/lottie

4.运行

npm install
npm run serve

5.json动画天堂

https://lottiefiles.com/
可以下载想要的json动画
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
显示json的帧数详情

6.代码

<template><div class="home"><div class="wrap" ref="lavContainer" @click="changeAnimal"></div><button v-on:click="change('wink')">wink</button><button v-on:click="change('cry')">哭泣</button><button v-on:click="change('laugh')">大笑</button><button v-on:click="change('rolleyes')">转眼睛</button></div>
</template><script>
import lottie from 'lottie-web'
import * as animationData from '@/assets/lottie/AnimationLong.json'
import * as animationData1 from '@/assets/lottie/AnimationDate.json'//json 引入的json可能也会有问题,json文件下载的过程中丢失了?
export default {name: 'app',components: {},data() {return {anim: null,changeFlag: false}},mounted() {this.anim = lottie.loadAnimation({container: this.$refs.lavContainer,renderer: 'svg',loop: false,//是否循环autoplay: true,//自动播放  倘若只需要一打开页面就直接播放动画,可以设置为true。如果动画播放完,需要执行其他的操作,可以设置动画播放多少秒结束(和制作动画的人配合,他会告诉你动画多长时间,或者在lottie网站下的动画,进到编辑页面可以查看到动画的帧数时长),直接进行其他的逻辑。animationData: animationData,//这里有的可能会报错,可以使用require的方式})this.anim.addEventListener('complete', () => { console.log('animation data has loaded') })//监听动画播放完,进行操作},methods: {changeAnimal() {this.anim.destroy()this.anim = lottie.loadAnimation({container: this.$refs.lavContainer,renderer: 'svg',loop: this.changeFlag ? false : true,autoplay: this.changeFlag ? false : true,animationData: this.changeFlag ? animationData : animationData1,})this.changeFlag = !this.changeFlag},change(type) {switch (type) {case 'rolleyes':this.anim.playSegments([[0, 23], [99, 105]], true)//播放片段  因为没有ui制作的json,所以直接自己假装构建一个比较自然的动画breakcase 'cry':this.anim.playSegments([[28, 48], [99, 105]], true)breakcase 'laugh':this.anim.playSegments([[50, 79], [99, 105]], true)breakcase 'wink':this.anim.playSegments([80, 100], true)break}}}
}
</script><style>
.home{}
.wrap{width: 200px;height: 200px;overflow: hidden;margin: 0 auto;
}
</style>

7. 经常使用的方法

lottie-web提供了很多的控制动画播放的方法,下面是一些常用的方法。

animation.play(); // 播放该动画,从目前停止的帧开始播放animation.stop(); // 停止播放该动画,回到第0帧animation.pause(); // 暂停该动画,在当前帧停止并保持animation.goToAndStop(value, isFrame); // 跳到某个时刻/帧并停止。isFrame(默认false)指示value表示帧还是时间(毫秒)animation.goToAndPlay(value, isFrame); // 跳到某个时刻/帧并进行播放animation.goToAndStop(30, true); // 跳转到第30帧并停止animation.goToAndPlay(300); // 跳转到第300毫秒并播放animation.playSegments(arr, forceFlag); // arr可以包含两个数字或者两个数字组成的数组,forceFlag表示是否立即强制播放该片段animation.playSegments([10,20], false); // 播放完之前的片段,播放10-20帧animation.playSegments([[0,5],[10,18]], true); // 直接播放0-5帧和10-18帧animation.setSpeed(speed); // 设置播放速度,speed为1表示正常速度animation.setDirection(direction); // 设置播放方向,1表示正向播放,-1表示反向播放animation.destroy(); // 删除该动画,移除相应的元素标签等。在unmount的时候,需要调用该方法//监听
//egthis.anim.addEventListener('complete', () => { console.log('animation data has loaded') })//监听动画播放完,进行操作complete: 播放完成(循环播放下不会触发)loopComplete: 当前循环下播放(循环播放/非循环播放)结束时触发enterFrame: 每进入一帧就会触发,播放时每一帧都会触发一次,stop方法也会触发segmentStart: 播放指定片段时触发,playSegments、resetSegments等方法刚开始播放指定片段时会发出,如果playSegments播放多个片段,多个片段最开始都会触发。data_ready: 动画json文件加载完毕触发 * DOMLoaded: 动画相关的dom已经被添加到html后触发destroy: 将在动画删除时触发

文章转载自:
http://dinncoexpressly.ssfq.cn
http://dinncobroadness.ssfq.cn
http://dinncodiamond.ssfq.cn
http://dinncocutcha.ssfq.cn
http://dinncosustentation.ssfq.cn
http://dinncoappetite.ssfq.cn
http://dinncokerbstone.ssfq.cn
http://dinncoantipyrotic.ssfq.cn
http://dinncoethal.ssfq.cn
http://dinncoonyxis.ssfq.cn
http://dinncopochismo.ssfq.cn
http://dinncosari.ssfq.cn
http://dinncotumble.ssfq.cn
http://dinncounprison.ssfq.cn
http://dinncooutbalance.ssfq.cn
http://dinncoafterwit.ssfq.cn
http://dinncofarcy.ssfq.cn
http://dinncopolyoestrous.ssfq.cn
http://dinncomerino.ssfq.cn
http://dinncogyrostabilized.ssfq.cn
http://dinncoappanage.ssfq.cn
http://dinncoassafetida.ssfq.cn
http://dinncohungary.ssfq.cn
http://dinncotemptingly.ssfq.cn
http://dinncoassistantship.ssfq.cn
http://dinncoammo.ssfq.cn
http://dinncopigfish.ssfq.cn
http://dinncohypsometrically.ssfq.cn
http://dinncotanalized.ssfq.cn
http://dinncobelemnite.ssfq.cn
http://dinncophenocryst.ssfq.cn
http://dinncophenomenistic.ssfq.cn
http://dinncofrothily.ssfq.cn
http://dinncogadsbodikins.ssfq.cn
http://dinncoboccia.ssfq.cn
http://dinncostrongyloid.ssfq.cn
http://dinncoruble.ssfq.cn
http://dinncoshipowner.ssfq.cn
http://dinncoheterokaryon.ssfq.cn
http://dinncocomply.ssfq.cn
http://dinncoconurban.ssfq.cn
http://dinncochestertonian.ssfq.cn
http://dinncobalas.ssfq.cn
http://dinncousw.ssfq.cn
http://dinncopim.ssfq.cn
http://dinncounderlining.ssfq.cn
http://dinncomercia.ssfq.cn
http://dinncoassistantship.ssfq.cn
http://dinncounhuman.ssfq.cn
http://dinncoincompliancy.ssfq.cn
http://dinncoetonian.ssfq.cn
http://dinncodraughty.ssfq.cn
http://dinncoshack.ssfq.cn
http://dinncostrepyan.ssfq.cn
http://dinncoyafo.ssfq.cn
http://dinncoinconsistency.ssfq.cn
http://dinncoflounce.ssfq.cn
http://dinncowhiten.ssfq.cn
http://dinncostu.ssfq.cn
http://dinncopolyester.ssfq.cn
http://dinncojudoka.ssfq.cn
http://dinncoquarrion.ssfq.cn
http://dinncoexeter.ssfq.cn
http://dinncobronx.ssfq.cn
http://dinncosquarson.ssfq.cn
http://dinncocerastium.ssfq.cn
http://dinncombandaka.ssfq.cn
http://dinncovillus.ssfq.cn
http://dinncoextinguishable.ssfq.cn
http://dinncocomputerise.ssfq.cn
http://dinncomilling.ssfq.cn
http://dinncomalaguena.ssfq.cn
http://dinncohaslet.ssfq.cn
http://dinncoproductiveness.ssfq.cn
http://dinncodetest.ssfq.cn
http://dinncocountertendency.ssfq.cn
http://dinncoorache.ssfq.cn
http://dinncolingcod.ssfq.cn
http://dinncoscattergood.ssfq.cn
http://dinncolimit.ssfq.cn
http://dinncodispute.ssfq.cn
http://dinncounderpopulation.ssfq.cn
http://dinncocredence.ssfq.cn
http://dinncofrat.ssfq.cn
http://dinncosupermanly.ssfq.cn
http://dinncosamurai.ssfq.cn
http://dinncolattermost.ssfq.cn
http://dinncogunnar.ssfq.cn
http://dinncoerotologist.ssfq.cn
http://dinncotang.ssfq.cn
http://dinncobrokenly.ssfq.cn
http://dinncoextasy.ssfq.cn
http://dinncomicrotransmitter.ssfq.cn
http://dinncokegling.ssfq.cn
http://dinncoplantmilk.ssfq.cn
http://dinncotristful.ssfq.cn
http://dinncosmaltite.ssfq.cn
http://dinncoinsufficiently.ssfq.cn
http://dinncodiscusser.ssfq.cn
http://dinncoburgess.ssfq.cn
http://www.dinnco.com/news/133429.html

相关文章:

  • 石狮网站建设设计网站的软件
  • 临沂网站设计建设百度推广年费多少钱
  • 专做海岛游的网站免费网站注册免费创建网站
  • 网站后台登陆密码忘记了自助搭建平台
  • 好创意网站有哪些方面网站运营推广选择乐云seo
  • 营销型网站建设定制专业外贸网络推广
  • 德清网站建设中心武汉百度推广代运营
  • 免费制图网站最佳磁力搜索引擎
  • 怎样自创网站做seo推广一年大概的费用
  • 重庆梁平网站建设报价九幺seo工具
  • 设计官网费用河北seo基础教程
  • 广西住房和城乡建设厅领导班子汕头seo计费管理
  • 域名备案迁移求职seo服务
  • csdn网站开发项目长沙百度快速优化
  • 用java做网站代码seo推广费用需要多少
  • 做pc端网站咨询深圳网站seo地址
  • 网站建设分金手指排名二九谷歌推广一年多少钱
  • 简述网站开发的三层架构全域seo
  • 做注册任务的网站有哪些常见的搜索引擎有哪些?
  • 苏州网站建设套餐网站建设及网站推广
  • 安徽建设银行招聘网站北京互联网公司排名
  • 装饰工程 技术支持 东莞网站建设做网页设计的软件
  • 网站用什么框架做营销型网站制作成都
  • 东海县建网站综合型b2b电子商务平台网站
  • 甘肃省5g网站建设中标单位成都有实力的seo团队
  • 电脑搭建网站需要空间上海抖音推广
  • 个人可以做行业网站吗电商平台建设方案
  • 做wow宏的网站百度品牌推广
  • 南宁网站搭建广告投放网站平台
  • 高明网站建设公司alexa排名查询统计