Comments (4)
Hey man, thanks for checking out Redshift.
With any new framework the best way to integrate Redshift is going to be a matter of exploration, and perhaps when things become more standardised, a new route plugin will be created for it.
However I've just taken my first quick look at virtual-dom and I've rewritten the example there to a version that uses Redshift.
It's a fairly crude example, more sophisticated patterns will emerge, but it should show how you can still use the virtual DOM to render while Redshift drives the properties it's rendering from. The example here also has the added advantage of using Redshift's unified rAF loop, which will bring some performance benefits.
Let me know if you have any comments/questions!
from popmotion.
Good morning. Thanks a lot for the examples, it looks awesome! Comparing both examples, while setting the first ones interval to a minimum, the Redshift one looks a lot more performant indeed. Do you have a general guess about the performance gain? I'll go and play with it later today and tell you, how it works out.
While having a look at .addRoute(), I noticed there is a route for svgPath which made me wonder: Would it be possible to generate an effect with Redshift, that is comparable to Greensocks DrawSVGPlugin?
from popmotion.
Yeah man, excellent spot :)I haven't documented it properly yet, because I haven't done robust testing of that feature. And that route should just be called 'path' so I'll update the docs in a minute. But yeah, in theory you can manipulate SVG paths in the same way as DrawSVGPath by using the length
and offset
properties. These take percentages, by the way.
The performance gain isn't necessarily to do specifically with execution time. Two identical blocks of code will always run at more or less the same speed. The difference with requestAnimationFrame is 1) that it syncs page updates to monitor refresh rate, which makes everything smoother and 2) doesn't run in the background, so it won't drain laptop/phone batteries.
Also a great performance gain compared to that example would to limit the properties you animate to transform and opacity wherever you can. They perform much better on mobile, as per http://csstriggers.com/ (properties with a purple dot are bad)
from popmotion.
@ArnoBuschmann I'm having a few troubles publishing on NPM at the moment, but I've just pushed a fix for the svg path route in version 1.1.3. The redshift.global.min.js file is updated but NPM will probably be tomorrow.
You just have to set dom
to your path
element and you can animate the opacity
, width
, offset
, length
, spacing
and miterlimit
properties ie
yourAction.play({
dom: document.getElementById('yourPath'),
path: {
length: 100
}
});
from popmotion.
Related Issues (20)
- Are there examples? "Green boxes"? HOT 1
- Animation sequence HOT 1
- 'action' is not exported from 'popmotion' HOT 1
- CDN link maybe not working HOT 1
- How to have more values in short duration? HOT 1
- Allow global override of Framesync loop
- Popmotion: React import { animate } from "popmotion"; fails HOT 2
- Popmotion: Animation duration stretched when using pixi.js Ticker as animation driver HOT 2
- Importing Popmotion via "/dist/popmotion.global.min.js" 404 Issue HOT 2
- Stuttering motion on Chrome and Edge
- popmotion 11.0.3 import not working (missing exports) HOT 4
- 一些建议
- Cannot compile in CRA@5
- primary use error by Vue HOT 2
- mixerFactory is not a function
- Modernize build target and eliminating tslib.
- Popmotion.io footer nav link HOT 1
- Pause and rewind capability HOT 7
- Popmotion: Different content on each Modal
- Is there a lifecycle event that can listen to the completion of each repetition?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from popmotion.