Skip to content
This repository has been archived by the owner on Jul 11, 2019. It is now read-only.

Commit

Permalink
feature: Started with MDLAnimation
Browse files Browse the repository at this point in the history
  • Loading branch information
MikeMitterer committed Nov 19, 2015
1 parent 32822e4 commit d40a31b
Show file tree
Hide file tree
Showing 6 changed files with 546 additions and 3 deletions.
2 changes: 0 additions & 2 deletions lib/mdl.dart
Expand Up @@ -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";
Expand Down
37 changes: 37 additions & 0 deletions lib/mdlanimation.dart
@@ -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';
54 changes: 54 additions & 0 deletions lib/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);

}

0 comments on commit d40a31b

Please sign in to comment.