-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
16 changed files
with
238 additions
and
288 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
"use strict"; | ||
/** | ||
* Angular wrapper for velocityjs animation library | ||
* @requires velocityjs {@link https://github.com/julianshapiro/velocity} | ||
* @module sn.velocity | ||
* @author SOON_ | ||
*/ | ||
angular.module("sn.velocity", [ | ||
"sn.velocity.snVelocity", | ||
"sn.velocity.snVelocityGroup" | ||
]); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
"use strict"; | ||
/** | ||
* @author SOON_ | ||
* @module sn.velocity.snVelocityGroup | ||
* @class snVelocityGroup | ||
* @example <sn-velocity-group data-keyframes=""></sn-velocity-group> | ||
*/ | ||
angular.module("sn.velocity.snVelocityGroup", [ | ||
"sn.velocity.snVelocity" | ||
]) | ||
|
||
.directive("snVelocityGroup",[ | ||
"$compile", | ||
"$rootScope", | ||
/** | ||
* @constructor | ||
* | ||
* @param {Service} $compile angular template compiler | ||
* @param {Object} $rootScope | ||
*/ | ||
function($compile, $rootScope) { | ||
return { | ||
restrict: "E", | ||
scope: { | ||
"keyframes": "=" | ||
}, | ||
link: function($scope, $element){ | ||
|
||
angular.forEach($scope.keyframes, function(keyframes, key){ | ||
var animateElement = angular.element($element[0].querySelector(key)); | ||
var scope = $rootScope.$new(); | ||
scope.keyframes = keyframes; | ||
|
||
animateElement.attr("sn-velocity", ""); | ||
animateElement.attr("data-keyframes", "keyframes"); | ||
|
||
$compile(animateElement)(scope); | ||
}); | ||
|
||
} | ||
}; | ||
} | ||
]); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
"use strict"; | ||
/** | ||
* Angular wrapper for velocityjs | ||
* @author SOON_ | ||
* @module sn.velocity.snVelocity | ||
* @class snVelocity | ||
* @example <sn-velocity data-keyframes="[{'properties': { opacity: 0 }, 'options': { duration: 1000 }},{'properties': { opacity: 1 },'options': { duration: 1000 }}]"></sn-velocity> | ||
*/ | ||
angular.module("sn.velocity.snVelocity", []).directive("snVelocity",[ | ||
"$window", | ||
/** | ||
* @constructor | ||
*/ | ||
function($window) { | ||
return { | ||
restrict: "A", | ||
scope: { | ||
"keyframes": "=" | ||
}, | ||
link: function($scope, $element){ | ||
|
||
angular.forEach($scope.keyframes, function(value){ | ||
$window.Velocity($element, value.properties, value.options); | ||
}); | ||
|
||
} | ||
}; | ||
} | ||
]); |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.