Simple hex excercises

app.js 1.2KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. 'use strict';
  2. angular.module("hexmeh", [])
  3. .config(["$routeProvider", "$locationProvider", function ($routeProvider, $locationProvider) {
  4. $locationProvider.html5Mode(true);
  5. $routeProvider.when("/", {
  6. controller: MainController,
  7. templateUrl: "partials/intro.html"
  8. })
  9. .otherwise({
  10. controller: MainController,
  11. templateUrl: "partials/intro.html"
  12. });
  13. //.otherwise({ redirectTo: "/" });
  14. }])
  15. .directive('fadey', function() {
  16. return {
  17. restrict: 'A',
  18. link: function(scope, elm, attrs) {
  19. var duration = parseInt(attrs.fadey);
  20. if (isNaN(duration)) {
  21. duration = 500;
  22. }
  23. elm = jQuery(elm);
  24. elm.hide();
  25. elm.fadeIn(duration)
  26. scope.destroy = function(complete) {
  27. elm.fadeOut(duration, function() {
  28. if (complete) {
  29. complete.apply(scope);
  30. }
  31. });
  32. };
  33. }
  34. };
  35. });;