Permalink
Browse files

feature: Started with MDLAnimation

  • Loading branch information...
MikeMitterer committed Nov 19, 2015
1 parent 32822e4 commit d40a31b6ba007980808b21d6f0aed47dcff8030a
View
@@ -8,8 +8,6 @@ import "package:mdl/mdlformatter.dart";
import "package:mdl/mdldialog.dart";
import "package:mdl/mdlform.dart";
export "package:mdl/mdlcore.dart";
export "package:mdl/mdlcomponets.dart";
export "package:mdl/mdldirective.dart";
View
@@ -0,0 +1,37 @@
/*
* Copyright (c) 2015, Michael Mitterer (office@mikemitterer.at),
* IT-Consulting and Development Limited.
*
* All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/*
* MdlAnimation of was strongly by influenced by
* Dan Parnhams CssAnimation (https://github.com/parnham/css_animation.dart)
* So part of the tribute goes to him!
*/
library mdlanimation;
import 'dart:html' as dom;
import 'dart:html_common';
import 'dart:async';
import 'package:logging/logging.dart';
import 'package:validate/validate.dart';
part 'src/animation/keyframes.dart';
part 'src/animation/animation.dart';
part 'src/animation/StockAnimation.dart';
@@ -0,0 +1,54 @@
/*
* Copyright (c) 2015, Michael Mitterer (office@mikemitterer.at),
* IT-Consulting and Development Limited.
*
* All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
part of mdlanimation;
/**
* Predefined animations.
*
* If you want to define your own keyframes this site could be helpful:
* https://coveloping.com/tools/css-animation-generator
*
* Usage:
* final MdlAnimation bounceInRight = new MdlAnimation.fromStock(StockAnimation.BounceInRight);
* ...
* bounceInRight(element).then((_) => _logger.info("Animation completed!"));
*/
class StockAnimation {
/// Specifies the length of the animation
final Duration duration;
/// The keyframes for the animation
final Map<int, Map<String, Object>> keyframes;
final AnimationTiming timing;
/// Specify your set of [keyframes]
const StockAnimation(this.duration, this.keyframes,this.timing);
static const StockAnimation BounceInRight =
const StockAnimation(const Duration(milliseconds: 500), _BounceInRight,AnimationTiming.EASE_IN_OUT);
static const StockAnimation FadeIn =
const StockAnimation(const Duration(milliseconds: 500), _FadeIn,AnimationTiming.EASE_IN_OUT);
static const StockAnimation FadeOut =
const StockAnimation(const Duration(milliseconds: 500), _FadeOut,AnimationTiming.EASE_IN_OUT);
}
Oops, something went wrong.

0 comments on commit d40a31b

Please sign in to comment.