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

杞县网站建设常州城投建设招标网站

杞县网站建设,常州城投建设招标网站,厦门物业备案建设局登什么网站,如何创建网站快捷方式到桌面之前写过一篇lottie动效的文章#xff1a;web端动效 lottie-web 使用#xff0c;本篇写一下PAG-web的基础使用。 PAG是腾讯开发#xff0c;支持移动端、桌面端以及Web端的动效工作流解决方案。目标是降低或消除动效相关的研发成本#xff0c;能够一键将设计师在 AE#x…之前写过一篇lottie动效的文章web端动效 lottie-web 使用本篇写一下PAG-web的基础使用。 PAG是腾讯开发支持移动端、桌面端以及Web端的动效工作流解决方案。目标是降低或消除动效相关的研发成本能够一键将设计师在 AEAdobe After Effects中制作的动效内容导出成素材文件并快速上线应用于几乎所有的主流平台。 安装 官方文档 yarn add libpagvue.config.js 加入以下代码 // ... const path require(path) const CopyWebpackPlugin require(copy-webpack-plugin)module.exports defineConfig({// ...configureWebpack: {plugins: [// ...new CopyWebpackPlugin({patterns: [{from: path.resolve(__dirname, ./node_modules/libpag/lib/libpag.wasm),to: ./js/}]})]} })简单的接入示例和 Vue / React / PixiJS 等配置示例 可以点击 这里 查看。 使用 创建一个组件MyPag/index.vue templatecanvas classpag idpag/canvas /templatescript import { PAGInit } from libpagexport default {data () {return {pagView: null}},created () {this.initPag()},methods: {async initPag () {const url /static/like.pag // pag文件放在了静态文件夹下 /public/staticconst PAG await PAGInit()const { PAGFile, PAGView } PAG// 示例 fetch 请求const buffer await fetch(url).then(res res.arrayBuffer())const pagFile await PAGFile.load(buffer)document.getElementById(pag).width pagFile.width()document.getElementById(pag).height pagFile.height()this.pagView await PAGView.init(pagFile, #pag)this.pagView.setRepeatCount(0)this.pagView.play()}} } /scriptstyle langscss scoped .pag {width: 200px;height: 200px; } /style示例中pag文件路径测试素材下载 一个基本的pag动效就出来了 结合实例方法加入简单的鼠标事件移入播放移出暂停。查看API文档 templatediv classlottie mouseenteronMouseenter mouseleaveonMouseleave/div /templatescript import lottie from lottie-webexport default {props: {animationData: {type: Object,required: true},autoplay: {type: Boolean,default: true},loop: {type: Boolean,default: true}},data () {return {lottie: null}},mounted () {this.intLottie()},methods: {intLottie () {let { animationData, autoplay, loop } thisif (!autoplay) {loop false}this.lottie lottie.loadAnimation({container: this.$el, // 渲染容器renderer: svg, // 渲染方式loop, // 是否循环autoplay, // 自动播放animationData // lottie json文件})},onMouseenter () {if (!this.autoplay) {this.lottie.setDirection(1)this.lottie.play()this.lottie.addEventListener(complete, e {this.lottie.stop()})}},onMouseleave () {this.lottie.removeEventListener(complete)if (!this.autoplay) {this.lottie.setDirection(-1)}}} } /scriptstyle langscss scoped .lottie {width: 200px;height: 200px; } /stylePAGViewer 目前 PAG 预览支持 Web、macOS 和 Windows 平台其中 Web 平台为一个页面macOS 和 Windows 平台为桌面端应用。进入下载
http://www.huolong8.cn/news/332429/

相关文章:

  • 网站如何做品牌宣传海报wordpress内容页文件名
  • 公司营销网站建设个人做网站语言
  • 网站界面分类做网站生意多吗
  • 网站优化排名软件网wordpress搭建单机版
  • 山东高端网站建设方案因酷西安网站建设公司怎么样
  • 成品网站模板下载软件制作助手
  • 商业网站设计与制作西安建设工程交易信息网
  • 做网站确定什么主题好个人小程序开发教程
  • 自己如何做团购网站云信网站建设
  • 网站做任务包括什么500强企业排名(2022最新名单)
  • 网站动态加速谷歌网站优化推广
  • cookie做网站登录400个成品短视频
  • 设计师找图网站上海企业建站公司哪家好
  • 昆明建设网站多少钱asp.net 网站启动慢
  • 网站建设经营服务合同范本织梦网站教程
  • 网站建设所需费用明细企业网站创建小结
  • 怎样建网站才赚钱wordpress全站固定链接
  • 手机网站 优化房屋备案信息查询入口
  • 高端网站建设公司新鸿儒我在学校志愿队做网站的经历
  • 利用c 做网站大气公司网站源码
  • 网站推广基本预算定制类做网站多少钱
  • 做营销网站制作wordpress 两个域名
  • 网站建设管理工作经验介绍昆明网站设计制造
  • 网站平台建设是什么网站建设教程微云网盘
  • 可以做国外购物的网站无锡网站制作优化推广
  • 文化建设 设计公司网站建设厅网站注册后多长时间开通
  • wex5做网站wordpress 全宽页面
  • 怎么做网站简单的单页网站seo优化
  • 苏州网站设计公司兴田德润在哪里呢重庆网站
  • 秒收录网站网站空间可以自己做服务器