gsap

Animate Fabric js using GSAP?

不想你离开。 提交于 2019-12-23 04:54:25
问题 I have been playing with the Fabric.js library for a little while. What like about it is the ease of transforming objects and a couple more. I am wondering if there is a plugin or any way to animate Fabric elements using GSAP? 回答1: It can be done by passing the fabric objects into the GSAP const tl = new TimelineLite(); tl.staggerFromTo( [fabricObject], 1, {left: -config.width}, {left: config.width, onUpdate: () => canvas.renderAll()}, 0.4); 来源: https://stackoverflow.com/questions/46324061

Fading in different items and different times using Greensock Tween

房东的猫 提交于 2019-12-23 04:15:49
问题 I am really new with GSAP and I think it is amazing. However I cannot work out how to fade in these items separately. 1st one (this is fine) for the 2nd wish to fade in at a certain time and 3rd at a certain time. JavaScript: function startFinalAnimation(){ var fa = new TimelineLite(); fa.to(finalAvatar, 2, {scale: 0.45, delay: 0, opacity: 1, transformOrigin:"-3% 8.8%"}); fa.to(finalContent, 4, {delay: 0, opacity: 1}); fa.to(logo, 5, {delay: 0, opacity: 1}); } 回答1: TimelineLite 's .to()

How to animate and change a slider counter position in a clean way?

强颜欢笑 提交于 2019-12-22 05:24:06
问题 I have a Swiper slider and a counter position like "1/10". I would like to change that current slide number (the 1) with an animation. I know how to replace the number but with this animation, it's like another story: As you can see on the gif, it's working nicely if I click moderately on my slider, but when I double-triple-or-crazy click on the next link, that totally breaks the counter, due to the clone made in this gif example. Do you know how can I do that in a better way? I made a

Full screen slider with zoom in/out transition effect

半腔热情 提交于 2019-12-22 01:08:21
问题 I mean something like this. How can I obtain that result with a library like GSAP, Transit or VelocityJS? http://www.echocapital.com/ Thanks in advance :) 回答1: Dunno about GSAP and Velocity Cause all you need is a bit of CSS and some JS or jQuery, I mean you can rewrite easily the below in vanilla JS: var $gal = $("#gallery"), $img = $gal.find("> div"), n = $img.length, i = 0, t; $img.eq(i).addClass('on'); (function loop() { t = setTimeout(function(){ $img.removeClass("on").eq(i++%n).addClass

TimelineMax doesn't seem to work for me. Do timelines require any additional config beyond, target, time, and attribute value?

淺唱寂寞╮ 提交于 2019-12-13 05:47:19
问题 So I'm working on porting an animation of clouds from css animation to a js animation using TimelineMax. however, I've always found myself problems with Timeline[Max/Lite]. This time is quite the same. I've gone over the docs, but can't seem to find the problem. is there anything i'm missing from the arguments I pass or other parts of my code. any suggestions help as this is preventing me from moving forwards. thanks! just to clarify, the animation is means to be a looped animation clouds

How can I import and use GSAP in an Ionic/Angular project?

可紊 提交于 2019-12-13 05:14:43
问题 I have a fresh Ionic project ('blank' template). I have run npm install gsap --save . This is my app.module.ts : import { BrowserModule } from '@angular/platform-browser'; import { ErrorHandler, NgModule } from '@angular/core'; import { IonicApp, IonicErrorHandler, IonicModule } from 'ionic-angular'; import { SplashScreen } from '@ionic-native/splash-screen'; import { StatusBar } from '@ionic-native/status-bar'; import { MyApp } from './app.component'; import { HomePage } from '../pages/home

Shallow rendering a component which depends on TweenLite

…衆ロ難τιáo~ 提交于 2019-12-12 21:38:43
问题 I'm trying to make a simple unit test with a React component but I keep getting: C:\work\portfolio\node_modules\gsap\TweenMax.js:13 import TweenLite, { TweenPlugin, Ease, Power0, Power1, Power2, Power3, Power4, Linear } from "./TweenLite.js"; ^^^^^^^^^ Which is an error with an import of one of children's of 'App' components 3rd party libraries. import React from "react"; import { shallow } from 'enzyme'; import App from "./App"; fit("renders without crashing", () => { const wrapper = shallow

JQuery/GSAP - Moving multiple elements parallel to each other

被刻印的时光 ゝ 提交于 2019-12-12 03:37:16
问题 What I want to do is this: I want to generate boxes on the Y or X axis of the page (the bottom and left border) and make them move parallel to each other until they've gone off-screen, where I want to delete them. This is what I've done so far: Codepen . function generate(){ var $element = $("<div>", {class: "box"}); //Generate random x and y coordinates var posy = (Math.random() * ($('body').height() - $element.width())).toFixed(); var posx = (Math.random() * ($('body').width() - $element

GSAP with React.js

▼魔方 西西 提交于 2019-12-11 17:38:01
问题 I encounter this problem. I use GSAP in react project to do some complicated animation. I want to ask that how can I clear the style applied on the DOM whenever the component re-render. It still keeps the old state which is the tl.reverse(). I set it it to Null again and re-define but i doesnt work. I'm also new to react. Below is code. Hope anyone can help componentDidMount () { this.menu_init() this.cta_animation_init() // this.cta_animation_active() this.hover_effect() $(window).on('scroll

On scroll animation using GSAP

陌路散爱 提交于 2019-12-11 15:07:04
问题 I am using GSAP for animation, I need on scroll animation when the user scrolls the mouse wheel. Now animation is working on page load. I need content should animate on the scroll. First two articles are working but when I scroll it than animation is not working. (function() { var content = document.getElementById("content"); var xScroll = 0; // initialize function scrollHorizontally(e) { xScroll = xScroll+e.deltaY*20; // set limits to avoid overshooting and stucking at beginning or end var