diff --git a/.gitignore b/.gitignore index 861bedf..e1ae86e 100644 --- a/.gitignore +++ b/.gitignore @@ -2,6 +2,9 @@ node_modules app .sass-cache npm-debug.log +package-lock.json + +dist/ # OS generated files # .DS_Store @@ -10,4 +13,7 @@ npm-debug.log .Spotlight-V100 .Trashes ehthumbs.db -Thumbs.db \ No newline at end of file +Thumbs.db + +# IDE files +.idea/* diff --git a/dist/js/DmCarrousel.js b/dist/js/DmCarrousel.js deleted file mode 100644 index 07c6608..0000000 --- a/dist/js/DmCarrousel.js +++ /dev/null @@ -1,176 +0,0 @@ -angular.module('dmCarrousel', []) -.directive('dmCarrousel', ['$compile', function($compile) { - - return { - restrict: 'E', - scope: { - data: '=imageData' - }, - compile: function(tElement, tAttributes) { - - return function(scope, iElement, iAttributes, containerCtrl) { - - var currentIndex = 0; - var totalSlides = scope.data.length; - var animating = false; - var tpl = '
'; - tpl += '"; - - tpl += '
' + - ' ' + - ' ' + - '
'; - - tpl += '
' - - iElement.append($compile(angular.element(tpl))(scope)); - - var slides = iElement[0].querySelectorAll("li"); - var slides2 = angular.element(iElement[0].querySelectorAll("li")); - angular.element(iElement[0].querySelector('.current')) - - if (slides.length > 0) { - - angular.element(slides[slides.length-1]).addClass("prev"); - - var prevImage = angular.element(slides[slides.length-1]).find("img"); - loadImage(prevImage); - - angular.element(slides[0]).addClass("current"); - - var currentImage = angular.element(slides[0]).find("img"); - loadImage(currentImage); - - angular.element(slides[1]).addClass("next"); - - var nextImage = angular.element(slides[1]).find("img"); - loadImage(nextImage); - - } - - scope.goToNext = function() { - - var index = currentIndex; - - //console.log("Go to next slide"); - if(currentIndex < totalSlides-1) { - index ++; - - } - else { - index = 0; - } - - goToSlide(index); - - } - - scope.goToPrev = function() { - - var index = currentIndex; - - //console.log("Go to previous slide"); - if(currentIndex > 0) { - index --; - } - else { - index = slides.length - 1; - //console.log(currentIndex) - } - - goToSlide(index); - } - - function goToSlide(index) { - - //console.log("Go to slide " + index); - - //check if the carrousel already is animating - if(animating) { - //console.error("already animating"); - return; - } - else { - animating = true; - currentIndex = index; - } - - - //TODO - find a better way to remove class names - angular.forEach(slides,function(slide,index){ - angular.element(slide).removeClass("current prev next"); - }) - - if(index < totalSlides && index >= 0) { - - angular.element(slides[index]).addClass("current"); - - var current = slides[index]; - - current.addEventListener('webkitTransitionEnd', function(){transitionDone()}); - current.addEventListener('oTransitionEnd', function(){transitionDone()},false); - current.addEventListener('webkitTransitionEnd', function(){transitionDone()},false); - - } - else { - //console.error("Image index out of range"); - } - - if(index < totalSlides-1) { - angular.element(slides[index+1]).addClass("next"); - var image = angular.element(slides[index+1]).find("img"); - loadImage(image); - } - else { - angular.element(slides[0]).addClass("next"); - var image = angular.element(slides[index+1]).find("img"); - loadImage(image); - } - - if(index > 0) { - angular.element(slides[index-1]).addClass("prev"); - var image = angular.element(slides[index-1]).find("img"); - loadImage(image); - } - else { - angular.element(slides[slides.length-1]).addClass("prev"); - var image = angular.element(slides[index-1]).find("img"); - loadImage(image); - } - - } - - function loadImage(element) { - - if(element.attr('src') === undefined && element.attr("dm-src") != undefined) { - - element.attr('src',element.attr("dm-src")); - - } - - } - - function transitionDone() { - - animating = false; - - var current = slides[currentIndex]; - - current.removeEventListener('webkitTransitionEnd', function(){transitionDone()}); - current.removeEventListener('oTransitionEnd', function(){transitionDone()}); - current.removeEventListener('transitionEnd', function(){transitionDone()}); - - } - - } - - } - }; -}]); \ No newline at end of file diff --git a/dist/sass/style.scss b/dist/sass/style.scss deleted file mode 100644 index 9d80fc1..0000000 --- a/dist/sass/style.scss +++ /dev/null @@ -1,75 +0,0 @@ -@import "compass/css3/transition"; - -ul.dm-car { - display: block; - width: 600px; - height: 300px; - margin: 0; - padding: 0; - position: relative; - overflow: hidden; - - li { - display: block; - position: absolute; - top:0; - @include transition(left 500ms ease-out); - left: 600px; - width: 600px; - height: 300px; - img { - width: 100% - } - &.current { - left: 0; - @include transition(left 500ms ease-out); - z-index: 100; - - } - &.next { - left: 600px; - z-index: 10; - } - - &.prev { - left: -600px; - @include transition(left 500ms ease-out); - z-index: 2; - } - } -} - -.dm-car-controls { - - position: absolute; - top: 0; - left: 0; - width: 600px; - height: 300px; - - .dm-car-control { - display: inline-block; - width: 50px; - height: 300px; - line-height: 300px; - text-align: center; - background-color: #ccc; - background-color: rgba(30,30,30,.37); - position: absolute; - color: white; - font-size: 24px; - font-weight: bold; - cursor: pointer; - z-index: 200; - - &.dm-car-control-next { - right: 0px; - } - } - -} - -.dm-car-container { - position: relative; -} - diff --git a/dist/stylesheets/style.css b/dist/stylesheets/style.css deleted file mode 100644 index 4b83045..0000000 --- a/dist/stylesheets/style.css +++ /dev/null @@ -1,76 +0,0 @@ -ul.dm-car { - display: block; - width: 600px; - height: 300px; - margin: 0; - padding: 0; - position: relative; - overflow: hidden; -} -ul.dm-car li { - display: block; - position: absolute; - top: 0; - -moz-transition: left 500ms ease-out; - -o-transition: left 500ms ease-out; - -webkit-transition: left 500ms ease-out; - transition: left 500ms ease-out; - left: 600px; - width: 600px; - height: 300px; -} -ul.dm-car li img { - width: 100%; -} -ul.dm-car li.current { - left: 0; - -moz-transition: left 500ms ease-out; - -o-transition: left 500ms ease-out; - -webkit-transition: left 500ms ease-out; - transition: left 500ms ease-out; - z-index: 100; -} -ul.dm-car li.next { - left: 600px; - z-index: 10; -} -ul.dm-car li.prev { - left: -600px; - -moz-transition: left 500ms ease-out; - -o-transition: left 500ms ease-out; - -webkit-transition: left 500ms ease-out; - transition: left 500ms ease-out; - z-index: 2; -} - -.dm-car-controls { - position: absolute; - top: 0; - left: 0; - width: 600px; - height: 300px; -} -.dm-car-controls .dm-car-control { - display: inline-block; - width: 50px; - height: 300px; - line-height: 300px; - text-align: center; - background-color: #ccc; - background-color: rgba(30, 30, 30, 0.37); - position: absolute; - color: white; - font-size: 24px; - font-weight: bold; - cursor: pointer; - z-index: 200; -} -.dm-car-controls .dm-car-control.dm-car-control-next { - right: 0px; -} - -.dm-car-container { - position: relative; -} - -/*# sourceMappingURL=style.css.map */ diff --git a/dist/stylesheets/style.css.map b/dist/stylesheets/style.css.map deleted file mode 100644 index 59f3611..0000000 --- a/dist/stylesheets/style.css.map +++ /dev/null @@ -1,7 +0,0 @@ -{ -"version": 3, -"mappings": "AAEA,SAAU;EACT,OAAO,EAAE,KAAK;EACd,KAAK,EAAE,KAAK;EACZ,MAAM,EAAE,KAAK;EACb,MAAM,EAAE,CAAC;EACT,OAAO,EAAE,CAAC;EACV,QAAQ,EAAE,QAAQ;EAClB,QAAQ,EAAE,MAAM;;AAEhB,YAAG;EACF,OAAO,EAAE,KAAK;EACd,QAAQ,EAAE,QAAQ;EAClB,GAAG,EAAC,CAAC;EC8UL,eAAwC,EC/KR,mBAC8D;ED8K9F,aAAwC,EC/KR,mBAC8D;ED8K9F,kBAAwC,EClLL,mBACoD;EAenF,UAAU,EAbkB,mBAC8D;EF9J9F,IAAI,EAAE,KAAK;EACX,KAAK,EAAE,KAAK;EACZ,MAAM,EAAE,KAAK;;AACb,gBAAI;EACH,KAAK,EAAE,IAAI;;AAEZ,oBAAU;EACT,IAAI,EAAE,CAAC;ECqUR,eAAwC,EC/KR,mBAC8D;ED8K9F,aAAwC,EC/KR,mBAC8D;ED8K9F,kBAAwC,EClLL,mBACoD;EAenF,UAAU,EAbkB,mBAC8D;EFrJ7F,OAAO,EAAE,GAAG;;AAGb,iBAAO;EACN,IAAI,EAAE,KAAK;EACX,OAAO,EAAE,EAAE;;AAGZ,iBAAO;EACN,IAAI,EAAE,MAAM;EC0Tb,eAAwC,EC/KR,mBAC8D;ED8K9F,aAAwC,EC/KR,mBAC8D;ED8K9F,kBAAwC,EClLL,mBACoD;EAenF,UAAU,EAbkB,mBAC8D;EF1I7F,OAAO,EAAE,CAAC;;;AAKb,gBAAiB;EAEhB,QAAQ,EAAE,QAAQ;EAClB,GAAG,EAAE,CAAC;EACN,IAAI,EAAE,CAAC;EACP,KAAK,EAAE,KAAK;EACZ,MAAM,EAAE,KAAK;;AAEb,gCAAgB;EACf,OAAO,EAAE,YAAY;EACrB,KAAK,EAAE,IAAI;EACX,MAAM,EAAE,KAAK;EACb,WAAW,EAAE,KAAK;EAClB,UAAU,EAAE,MAAM;EAClB,gBAAgB,EAAE,IAAI;EACtB,gBAAgB,EAAE,sBAAkB;EACpC,QAAQ,EAAE,QAAQ;EAClB,KAAK,EAAE,KAAK;EACZ,SAAS,EAAE,IAAI;EACf,WAAW,EAAE,IAAI;EACjB,MAAM,EAAE,OAAO;EACf,OAAO,EAAE,GAAG;;AAEZ,oDAAsB;EACrB,KAAK,EAAE,GAAG;;;AAMb,iBAAkB;EACjB,QAAQ,EAAE,QAAQ", -"sources": ["../../dev/sass/style.scss","../../../../.rvm/gems/ruby-2.1.0-preview1/gems/compass-core-1.0.1/stylesheets/compass/_support.scss","../../../../.rvm/gems/ruby-2.1.0-preview1/gems/compass-core-1.0.1/stylesheets/compass/css3/_transition.scss"], -"names": [], -"file": "style.css" -} \ No newline at end of file diff --git a/package.json b/package.json index 132fd01..96cd5dc 100644 --- a/package.json +++ b/package.json @@ -24,6 +24,7 @@ "gulp-compass": "~2.0.3 ", "gulp-concat": "~2.4.3 ", "gulp-sourcemaps": "~1.3.0", + "gulp-uglify": "~3.0.2", "jasmine-core": "~2.1.3", "karma-jasmine": "~0.3.4", "karma-chrome-launcher": "~0.1.7"