Git Product home page Git Product logo

choreographer-js's People

Contributors

callmecavs avatar christinecha avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

choreographer-js's Issues

Scale rgba alpha value?

Apologies if this is clear from the js itself.

Is it possible to scale the alpha value in an rgba color, for example:

{
  range: [-1, 600],
  selector: '#fixy',
  type: 'scale',
  style: 'background-color',
   from: "rgba(255,0,0,0)",
  to: "rgba(255,0,0,1)"
}

Obviously you can't scale a value like that but it should explain what I'm struggling to accomplish.

Thanks!

Not Working in IE 10/11

First-off, brilliant work on this library. I like the API!

I've tested the demo page and it doesn't work in IE 10/11.

Any future plans on making this cross-browser compliant?

Update range on window resize?

I'm doing the following to handle updating animations on window resize:

var Choreographer = require('choreographer-js');

var obj_anim = [
  {
    range: [-1, 500],
    selector: '.object',
    type: 'scale',
    style: 'transform:translateY',
    from: 100,
    to: 0,
    unit: '%'
  },
  {
    range: [document.getElementById('trigger').getBoundingClientRect().top + window.scrollY, document.getElementById('trigger').getBoundingClientRect().top + window.scrollY + 300],
    selector: '.object',
    type: 'scale',
    style: 'left',
    from: 50,
    to: -50,
    unit: '%'
  }
];

var choreographer = new Choreographer({
  animations: obj_anim
});

window.addEventListener('scroll', function() {
  choreographer.runAnimationsAt(window.pageYOffset);
});

window.addEventListener('resize', function() {
  choreographer.updateAnimations(obj_anim);
});

However the animation doesn't begin when the trigger element hits the top of the page as expected unless I hard refresh. It doesn't seem to be respecting the range I've set.

I can confirm that the distance from the top of the document to the top of the trigger element is accurate on resize, so what am I missing here?

Thanks!

Possible to do linear interpolation (LERP) for scroll animations?

It would be great on page scroll if the animations leveraged linear interpolation so they don't appear so choppy/abrupt.

Here's an excerpt from Rachel Smith's codepen article about moving objects on scroll that outlines this more clearly:

Personally, I’m not really in to the ‘moving things at a linear rate as the page scrolls down’ look. For one, linear movement makes me sad. It also looks kind of choppy if you’re scrolling at random speeds. So instead I like to use linear interpolation to move elements to their target. I think this is one of those effects that are down to personal preference, but I definitely think it makes things look a lot smoother and better.

You can check out an example of how this feels here.

Whatcha think?

Updating single animationConfig value

I have an animation that gets set up when my component mounts. I need to update the from value for the animation after a resize event. This is my initial config:

choreographer = new Choreographer({
    animations: [
        {
            range: [-1, 150],
            selector: '#licenseBar',
            type: 'scale',
            style: 'height',
            from: licenseBarExpandedHeight,
            to: licenseBarCollapsedHeight,
            unit: 'px'
        }
    ]
});

What’s the cleanest way to update the from value after the animation has already been set up?

Class don't change

First of all, i love your library. It helps me a lot with scroll-based animation choreographys.
I tried to use it also to change a class, according to your docs… But it do not add the class to my object.

Here's the code i used:
{ range: [first.end, second.end], selector: '#start .second-scene--video', type: 'class', style: 'class', to: 'play' }

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.