ネオンアニメーションページは限られた成功を収めています。私はそれを属性のエントリアニメーションと終了アニメーションを使用してアニメーション化することができます。これは素晴らしいですが、私はそれがとてもPolymer Dart 1.0でネオンアニメーションを動作させるにはどうすればいいですか
<neon-animated-pages class="waterfront" selected="{{ selected }}"
entry-animation="slide-down-animation"
exit-animation="slide-right-animation"
>
....
</neon-animated-pages>
のように、出口のための1つのアニメーションエントリのルーチンと1で実行されている取得し、アニメーションを制定するために選択された変数の変化を持ってすることができました。
JavaScriptバージョンのすべてのチュートリアルに気付き、洗練されたアニメーションを可能にする要素を作成するためにビヘイビアを使用します。だから私は、これはJavaScriptをされていたならば、これは私が私しようとするものに関係なく働いていない、しかしだろう、ポリマーダートミックスイン同等
@HtmlImport('animated_picture.html')
library wellington.elements.animated_picture;
import 'package:polymer/polymer.dart';
import 'package:web_components/web_components.dart';
import 'package:polymer_elements/neon_animation_runner_behavior.dart';
import 'package:polymer_elements/neon_shared_element_animatable_behavior.dart';
import 'package:polymer_elements/neon_animation/animations/fade_in_animation.dart';
import 'package:polymer_elements/neon_animation/animations/fade_out_animation.dart';
import 'package:polymer_elements/neon_animation/animations/transform_animation.dart';
import 'package:polymer_elements/neon_animation/animations/slide_from_left_animation.dart';
import 'package:polymer_elements/neon_animation/animations/slide_left_animation.dart';
@PolymerRegister('animated-picture')
class AnimatedPicture extends PolymerElement with
NeonAnimationRunnerBehavior,
NeonSharedElementAnimatableBehavior {
String _src;
@Property(reflectToAttribute: true, notify: true)
String get src => _src;
@reflectable
void set src(val) {
_src = val;
notifyPath('src', src);
}
String _alt;
@Property(reflectToAttribute: true, notify: true)
String get alt => _alt;
@reflectable
void set alt(val) {
_alt = val;
notifyPath('alt', alt);
}
@Property(reflectToAttribute: true, notify: true)
Map get animationConfig => {
'value':() => {
'entry': [{
'name': 'slide-from-left',
'node': this
},
{
'name': 'transform-animation',
'node': this,
'transformAnimation': 'translateX(-100vh)'
}],
'exit': [{
'name': 'fade-out-animation',
'node': this
}]
}
};
AnimatedPicture.created() : super.created();
}
と私は見てきたものからテンプレート
<dom-module id="animated-picture">
<style>
:host {
display: block;
}
.picture {
width: 1000px;
height: auto;
}
</style>
<template>
<picture id="container">
<source srcset="[[src]]">
<img class="picture" src="[[src]]" alt="[[alt]]">
</picture>
</template>
<script type="application/dart" src="animated_picture.dart"></script>
</dom-module>
を使用しますこれを動作させることはできません。ネオンアニメーションページで選択されたときにアニメーションがなく、アニメーションピクチャの可視性が変化することを除いて、この要素をネイティブアニメーションページ要素内に配置し、JavaScriptデモで行うようには何も起こりません。普通の鉄製ページセレクタと同じように。 Polymer Dart 1.0と同等の機能を実行するにはどうすればよいですか?
に使用である希望に。 JavaScriptデモへのリンクがありますか?それはDartに移植する必要がありますか? –
アニメーションでは、JSとDartの間の変換に問題がある可能性があります。したがって、デバッグのためにconvertToDartまたはconvertToJsは追加情報を与えることができます。 http://stackoverflow.com/questions/35694355/customize-animation-in-dart –
JavaScriptバージョンのチュートリアルへのリンクをリクエストしました。ここに1つのhttps://youtu.be/wMhq1o0DULMと別のhttps://youtu.be/Lwvi1u4XXzcがあります。他にもいくつかありますが、Rob Dodsonはあなたが知る必要があるものをカバーするうえで優れています。 –