当前位置:网站首页>GSAP animation library
GSAP animation library
2022-07-07 18:38:00 【Vegetable bird learning code··】
gsap Animation library
First, import. gsap Animation library
npm i gsap -S
After installation, reference in the projectimport gsap from "gsap"
Normal page usage 

gsap.to(' Class name ',{
Animation properties })
// We can also use timeline to write animation
// Create a timeline , Then use chain grammar , Students who have done video clips may understand better
var tl = gsap.timeline();
tl.to(".box1", {
rotation: 27, x: 100, duration: 10 }).to(".box1", {
rotation: 27, x: 100, duration: 10 });
THREE Use of interface
//cube Is instantiated 3d goods gsap.to The reaction is the result of the object
let tl = gsap.timeline()
let ani = tl.to(cube.position, {
x: 500, duration: 3,
ease: "power1.inOut",
yoyo: true,
repeat: -1,
delay: 2,
onComplete: () => {
console.log(1); },
onStart: () => {
console.log(' Here we go ');
}
})
// Double click screen monitor
window.addEventListener('dblclick', () => {
console.log(ani.isActive());// Whether it is in motion
if (ani.isActive()) {
ani.pause() // Animation stops
} else {
ani.resume()// Animation recovery
}
})
easeIt's speedrepeatRepeat the number -1 Infinite loopyoyoBack and forth movementdelayDelayed motiononCompleteIt is a callback function done when it is finishedonStartIt is a callback function done at the beginning
边栏推荐
- 科学家首次观察到“电子漩涡” 有助于设计出更高效的电子产品
- Live broadcast software construction, canvas Text Bold
- 现在网上期货开户安全吗?国内有多少家正规的期货公司?
- Discuss | frankly, why is it difficult to implement industrial AR applications?
- Thread pool and singleton mode and file operation
- pip相关命令
- nest.js入门之 database
- 小试牛刀之NunJucks模板引擎
- Ten thousand words nanny level long article -- offline installation guide for datahub of LinkedIn metadata management platform
- Datasimba launched wechat applet, and datanuza accepted the test of the whole scene| StartDT Hackathon
猜你喜欢

【Unity Shader】插入Pass实现模型遮挡X光透视效果

手撕Nacos源码(先撕客户端源码)

3分钟学会制作动态折线图!
![[trusted computing] Lesson 12: TPM authorization and conversation](/img/ce/619141fa0387ba42528f93b1781038.png)
[trusted computing] Lesson 12: TPM authorization and conversation

现货白银分析中的一些要点

你真的理解粘包与半包吗?3分钟搞懂它

Industry case | digital operation base helps the transformation of life insurance industry
![[principles and technologies of network attack and Defense] Chapter 5: denial of service attack](/img/18/ac8b4c0dba4dd972df119d2f670416.png)
[principles and technologies of network attack and Defense] Chapter 5: denial of service attack

用存储过程、定时器、触发器来解决数据分析问题

Skills of embedded C language program debugging and macro use
随机推荐
Yunjing network technology interview question [Hangzhou multi tester] [Hangzhou multi tester _ Wang Sir]
4种常见的缓存模式,你都知道吗?
Pro2: modify the color of div block
Tips for this week 134: make_ Unique and private constructors
不能忽略的现货白银短线操作小技巧
持续测试(CT)实战经验分享
Improve application security through nonce field of play integrity API
Simple configuration of single arm routing and layer 3 switching
ICer知识点杂烩(后附大量题目,持续更新中)
RIP和OSPF的区别和配置命令
小程序中实现付款功能
AI 击败了人类,设计了更好的经济机制
[principles and technologies of network attack and Defense] Chapter 5: denial of service attack
Tips for this week 140: constants: safety idioms
The report of the state of world food security and nutrition was released: the number of hungry people in the world increased to 828million in 2021
科学家首次观察到“电子漩涡” 有助于设计出更高效的电子产品
Idea completely uninstalls installation and configuration notes
[论文分享] Where’s Crypto?
Tear the Nacos source code by hand (tear the client source code first)
DataSimba推出微信小程序,DataNuza接受全场景考验? | StartDT Hackathon