Code Monkey home page Code Monkey logo

core-animation's Introduction

core-animation's People

Contributors

addyosmani avatar dfreedm avatar jeffposnick avatar johndagostino avatar keanulee avatar sorvell avatar

Stargazers

 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

core-animation's Issues

Animation sequence doesn't work anymore

The following group animation worked in 0.4.2 but doesn't work in 0.5.1. The first animation doesn't play but after duration delay the second animation plays.

<core-animation-group autoplay="true" type="seq">
  <core-animation target="{{$.box}}" duration="1000" easing="ease">
    <core-animation-keyframe>
      <core-animation-prop name="visibility" value="visible"></core-animation-prop>
      <core-animation-prop name="transform" value="scale(0)"></core-animation-prop>
    </core-animation-keyframe>
    <core-animation-keyframe>
      <core-animation-prop name="visibility" value="visible"></core-animation-prop>
      <core-animation-prop name="transform" value="scale(1.5)"></core-animation-prop>
    </core-animation-keyframe>
    <core-animation-keyframe>
      <core-animation-prop name="visibility" value="visible"></core-animation-prop>
      <core-animation-prop name="transform" value="scale(1)"></core-animation-prop>
    </core-animation-keyframe>
  </core-animation>

  <core-animation target="{{$.box}}" duration="500" iterations="Infinity" direction="alternate" easing="ease">
    <core-animation-keyframe>
      <core-animation-prop name="transform" value="translateY(0)"></core-animation-prop>
    </core-animation-keyframe>
    <core-animation-keyframe>
      <core-animation-prop name="transform" value="translateY(-20px)"></core-animation-prop>
    </core-animation-keyframe>
  </core-animation>
</core-animation-group>

Child animations don't throw finish events

Let's say I have an animation built out of smaller animations:

<core-animation-group type="par" on-core-animation-finish="{{done}}">
  <core-animation-group type="seq" on-core-animation-finish="{{partial}}">
    ... animations
  <core-animation-group>
  ... animations
<core-animation-group>

The done callback gets executed, but the partial callback for the intermediary (inner) animation doesn't. Is it by design ?

error when using `offset`

Not sure if this is intended behavior, but I was wondering if offset is currently supported.

If I take the example from https://www.polymer-project.org/docs/elements/core-elements.html#core-animation and add an offset to the first keyframe, I get the following error message:

Uncaught NotSupportedError: Failed to execute 'animate' on 'Element': Partial keyframes are not supported.web-animations-next-lite.min.js:15 b.newUnderlyingPlayerForAnimationweb-animations-next-lite.min.js:15

(tested in Chrome 40)

Freeze web-animations-js version?

Hello,
I'm worrying that this component depends of the master branch
of web-animations-js library. Can you please specify some fixed version
in dependencies? At least in release branches (tags) of 'core-animation'.

Second keyframe changes how the first one animates

The following example can reproduce the problem.

<style>
    #box {
        position: absolute;
        left: 0;
        width: 300px;
        height: 300px;
    }
</style>

<core-animation id="animation" duration="500">
  <core-animation-keyframe>
    <core-animation-prop name="transform" value="translateX(-100%)"></core-animation-prop>
  </core-animation-keyframe>
  <core-animation-keyframe>
    <core-animation-prop name="background-color" value="blue"></core-animation-prop>
  </core-animation-keyframe>
</core-animation>

We have a box on the left-hand side and the animation which is expected to hide it by translating it 300px left. However, the observed result is the box gets hidden and then it slides onto the screen from the left. Removing the second keyframe yields the correct behaviour.

Broken import, vulcanize fails

Paper-dropdown-transition and core-animation imports the web-animations.html file, which in turn imports the 'web-animations-next/web-animations.html', which no longer exists.

API addition: animation.attrKeyframes for element attributes

It's a shame to have to write all that code [1] to make a custom animation just to animate scrollTop.
How about having an array of hashes similar animation.keyframes but instead css attributes, it would have element attributes like scrollTop, and it would yield a customEffect function:

var animation = new CoreAnimation();
animation.duration = 500;
animation.target = document.getElementById('el');
animation.attrKeyframes = [
  {scrollTop: animation.target.scrollTop},
  {scrollTop: 500}
];
animation.play();

[1] http://stackoverflow.com/a/26852482/283608

`transition-timing-function` property throws error on Safari & Firefox.

The error I got:

[Error] [object Object]
    dispatchOriginalEvent (webcomponents.js, line 957)
    dispatchEvent ([native code], line 0)
    dispatchEvent (webcomponents.js, line 1345)
    up (polymer.js, line 1987)
    gestureTrigger (polymer.js, line 813)
    (anonymous function) ([native code], line 0)
    (anonymous function) (web-animations-next-lite.min.js, line 15)
    forEach ([native code], line 0)
    c (web-animations-next-lite.min.js, line 15)

My animation definition:

<core-animation id="flip-in-x" target="{{ target }}" duration="{{ duration }}" easing="{{ easing }}" delay="{{ delay }}" endDelay="{{ endDelay }}" fill="{{ fill }}" iterations="{{ iterations }}" direction="{{ direction }}">
  <core-animation-keyframe offset="0">
    <core-animation-prop name="opacity" value="0"></core-animation-prop>
    <core-animation-prop name="transform" value="perspective(400px) rotate3d(1, 0, 0, 90deg)"></core-animation-prop>
    <core-animation-prop name="transition-timing-function" value="ease-in"></core-animation-prop>
  </core-animation-keyframe>
  <core-animation-keyframe offset="0.4">
    <core-animation-prop name="transform" value="perspective(400px) rotate3d(1, 0, 0, -20deg)"></core-animation-prop>
    <core-animation-prop name="transition-timing-function" value="ease-in"></core-animation-prop>
  </core-animation-keyframe>
  <core-animation-keyframe offset="0.6">
    <core-animation-prop name="opacity" value="1"></core-animation-prop>
    <core-animation-prop name="transform" value="perspective(400px) rotate3d(1, 0, 0, 10deg)"></core-animation-prop>
  </core-animation-keyframe>
  <core-animation-keyframe offset="0.8">
    <core-animation-prop name="transform" value="perspective(400px) rotate3d(1, 0, 0, -5deg)"></core-animation-prop>
  </core-animation-keyframe>
  <core-animation-keyframe offset="1">
    <core-animation-prop name="opacity" value="1"></core-animation-prop>
    <core-animation-prop name="transform" value="perspective(400px)"></core-animation-prop>
  </core-animation-keyframe>
</core-animation>

Thanks!

Vulcanize fails with file not found error

Vulcanization fails because web-animations-js/web-animations-next-lite.min.js file not found. In web-animations.html this web-animations-next/web-animations.html was changed to web-animations-js/web-animations-next-lite.min.js but bower.json installs it into web-animations-next.

Depends on version of web-animations-js with problematic .gitignore file

core-animation depends on "web-animations/web-animations-js#1.0.1". This release of web-animations-js includes a .gitignore file that ignores the .js files needed for animations to work. It appears that the .gitignore file has been removed in more recent versions. Here's a link to the 1.0.1 release version of that file.

https://github.com/web-animations/web-animations-js/blob/48a192d978202bbd18b4d45804dad54cc48915e7/.gitignore

Group Sequence Not Working in Chrome

I have a very simple parallel animation group nested in a sequential animation group. This configuration works fine in Firefox. But when I test it in Chrome, it does not work correctly. Instead, the inner parallel group runs at the same time as the first animation, then runs a second time in parallel with the second animation. I've commented the sequence here:

<core-animation-group id="transition" type="seq">
  <!-- Runs in parallel with group at end -->
  <core-animation duration="500" fill="both" target="{{ $.loginForm }}">
    <core-animation-keyframe>
      <core-animation-prop name="opacity" value="1"></core-animation-prop>
    </core-animation-keyframe>
    <core-animation-keyframe>
      <core-animation-prop name="opacity" value="0"></core-animation-prop>
    </core-animation-keyframe>
  </core-animation>

  <!-- Doesn't seem to run at all -->
  <core-animation duration="500" fill="both" target="{{ $.profile }}">
    <core-animation-keyframe>
      <core-animation-prop name="opacity" value="0"></core-animation-prop>
    </core-animation-keyframe>
    <core-animation-keyframe>
      <core-animation-prop name="opacity" value="1"></core-animation-prop>
    </core-animation-keyframe>
  </core-animation>

  <!-- Runs in parallel with first animation, and then reverts and runs again a second time -->
  <core-animation-group type="par">

    <core-animation id="occupyTop" duration="500" fill="none" target="{{ $.overlay }}" easing="ease"></core-animation>

    <core-animation duration="500" fill="none" target="{{ $.overlayShadow }}" easing="ease">
      <core-animation-keyframe>
        <core-animation-prop name="marginTop" value="20"></core-animation-prop>
        <core-animation-prop name="marginLeft" value="20"></core-animation-prop>
        <core-animation-prop name="marginRight" value="20"></core-animation-prop>
      </core-animation-keyframe>
      <core-animation-keyframe>
        <core-animation-prop name="marginTop" value="0"></core-animation-prop>
        <core-animation-prop name="marginLeft" value="0"></core-animation-prop>
        <core-animation-prop name="marginRight" value="0"></core-animation-prop>
      </core-animation-keyframe>
    </core-animation>

  </core-animation-group>
</core-animation-group>

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.