diff --git a/Gruntfile.js b/Gruntfile.js index 81f86cb..9499d68 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -7,24 +7,6 @@ module.exports = function ( grunt ) { grunt.initConfig( { pkg: grunt.file.readJSON('package.json'), - files: { - js: [ - './src/js/*.js', - './demo/js/*.js' - ], - css: [ - './src/css/*.css', - './demo/css/*.css' - ], - html: [ - './index.html', - './demo/xhr/*.html' - ], - json: [ - 'package.json' - ] - }, - banner: '/*\n * <%= pkg.name %> v<%= pkg.version %> - <%= grunt.template.today("yyyy-mm-dd") %>\n' + ' * Modal Window Effects with transitions CSS3.\n' + ' * http://dixso.github.io/custombox/\n' + @@ -49,33 +31,23 @@ module.exports = function ( grunt ) { ' * Under MIT License - http://opensource.org/licenses/MIT\n' + ' */\n', - connect: { - default: { - options: { - hostname: 'localhost', - port: 9001, - keepalive: true, - open: true + browserSync: { + options: { + server: { + baseDir: './' } - } - }, - - watch: { - default: { - files: [ - '<%= files.js %>', - '<%= files.css %>', - '<%= files.html %>', - '<%= files.json %>' - ], - options: { - livereload: true - }, - tasks: ['dev'] }, - karma: { - files: ['test/spec/*.js'], - tasks: ['karma:default'] + dev: { + bsFiles: { + src: [ + 'src/*/**', + 'demo/*/**' + ] + }, + options: { + codeSync: true, + port: 3001 + } } }, @@ -242,7 +214,7 @@ module.exports = function ( grunt ) { Task init ---------------------------- */ - grunt.registerTask('init', ['dev', 'connect']); + grunt.registerTask('init', ['dev', 'browserSync']); /* ---------------------------- diff --git a/bower.json b/bower.json index fceffd8..0547dee 100644 --- a/bower.json +++ b/bower.json @@ -18,7 +18,7 @@ "mobile", "ui" ], - "version": "3.0.1", + "version": "3.0.2", "author": { "name": "Julio de la Calle", "email": "juliodlcp@gmail.com" diff --git a/dist/custombox.min.css b/dist/custombox.min.css index 3d06e0c..c7e6d71 100644 --- a/dist/custombox.min.css +++ b/dist/custombox.min.css @@ -1,5 +1,5 @@ /* - * custombox v3.0.1 - 2015-09-19 + * custombox v3.0.2 - 2015-12-05 * Modal Window Effects with transitions CSS3. * http://dixso.github.io/custombox/ * (c) 2015 Julio de la Calle - @dixso9 @@ -7,4 +7,4 @@ * Under MIT License - http://opensource.org/licenses/MIT */ -.custombox-modal-wrapper,.custombox-overlay{right:0;top:0;bottom:0;left:0;position:fixed}.custombox-open,.custombox-open body{overflow:hidden}.custombox-perspective,.custombox-perspective body{-webkit-perspective:600px;perspective:600px;height:100%}.custombox-modal-container-fall,.custombox-modal-container-flip,.custombox-modal-container-rotate,.custombox-modal-container-sidefall,.custombox-modal-container-sign,.custombox-modal-container-slit{-webkit-perspective:1300px;perspective:1300px}.custombox-overlay-open{visibility:visible;opacity:1}.custombox-overlay{-webkit-transition-delay:0s;transition-delay:0s}.custombox-overlay-default{-webkit-transition-timing-function:linear;transition-timing-function:linear;-webkit-transition-property:opacity;transition-property:opacity;opacity:0}.custombox-modal-wrapper{outline:0;overflow:auto;text-align:center}.custombox-modal-container{margin:0 auto;position:relative}.custombox-modal img{max-width:100%;height:auto}.custombox-scrollbar{position:absolute;top:-9999px;width:50px;height:50px;overflow:scroll}.custombox-loading{position:fixed;-webkit-transform:translateY(-50%)translateX(-50%);-ms-transform:translateY(-50%)translateX(-50%);transform:translateY(-50%)translateX(-50%);top:50%;left:50%}.custombox-overlay-letmein{-webkit-transition-property:all;transition-property:all;-webkit-transition-timing-function:ease;transition-timing-function:ease;visibility:hidden}.custombox-overlay-open.custombox-overlay-slidetogether,.custombox-overlay-slidetogether{-webkit-transition-property:-webkit-transform ease-in-out;transition-property:transform ease-in-out}.custombox-overlay-open.custombox-overlay-letmein{-webkit-transform:rotateX(-2deg);transform:rotateX(-2deg);-webkit-transform-origin:50% 0;-ms-transform-origin:50% 0;transform-origin:50% 0;-webkit-transform-style:preserve-3d;transform-style:preserve-3d;visibility:visible;opacity:1}.custombox-overlay-slidetogether{-webkit-transform:translateY(-100%);-ms-transform:translateY(-100%);transform:translateY(-100%)}.custombox-overlay-open.custombox-overlay-slidetogether{-webkit-transform:translateY(0);-ms-transform:translateY(0);transform:translateY(0)}.custombox-overlay-corner{-webkit-transform:translateY(150px)translateX(150px);-ms-transform:translateY(150px)translateX(150px);transform:translateY(150px)translateX(150px);-webkit-transition-property:opacity,-webkit-transform,visibility;transition-property:opacity,transform,visibility}.custombox-overlay-open.custombox-overlay-corner{-webkit-transform:translateY(0);-ms-transform:translateY(0);transform:translateY(0);-webkit-transition-property:opacity,-webkit-transform;transition-property:opacity,transform}.custombox-overlay-open.custombox-overlay-scale,.custombox-overlay-scale{-webkit-transition-property:-webkit-transform;transition-property:transform}.custombox-overlay-scale{-webkit-transform:scale(.9);-ms-transform:scale(.9);transform:scale(.9)}.custombox-overlay-open.custombox-overlay-scale{-webkit-transform:scale(1);-ms-transform:scale(1);transform:scale(1)}.custombox-overlay-door,.custombox-overlay-open.custombox-overlay-door{-webkit-transition-property:width ease-in-out;transition-property:width ease-in-out}.custombox-overlay-door{visibility:hidden;width:0;left:50%;-webkit-transform:translateX(-50%);-ms-transform:translateX(-50%);transform:translateX(-50%)}.custombox-overlay-open.custombox-overlay-door{visibility:visible;width:100%}.custombox-container-push{overflow-x:hidden;-webkit-transition-property:-webkit-transform;transition-property:transform}.custombox-overlay-open.custombox-overlay-push,.custombox-overlay-push{-webkit-transition-property:-webkit-transform ease-in-out;transition-property:transform ease-in-out}.custombox-container-open.custombox-container-push{-webkit-transform:translateX(100%);-ms-transform:translateX(100%);transform:translateX(100%)}.custombox-overlay-push{-webkit-backface-visibility:hidden;backface-visibility:hidden;-webkit-transform:translateX(-100%);-ms-transform:translateX(-100%);transform:translateX(-100%)}.custombox-overlay-open.custombox-overlay-push{-webkit-transform:translateX(0);-ms-transform:translateX(0);transform:translateX(0)}.custombox-open-contentscale body{background-color:#DDD}.custombox-container-contentscale{-webkit-transition:-webkit-transform .5s;transition:transform .5s;overflow:hidden;height:100%}.custombox-overlay-contentscale,.custombox-overlay-open.custombox-overlay-contentscale{-webkit-transition-property:-webkit-transform ease-in-out;transition-property:transform ease-in-out}.custombox-container-open.custombox-container-contentscale{-webkit-transform:scale(.8);-ms-transform:scale(.8);transform:scale(.8)}.custombox-overlay-contentscale{-webkit-transform:translateY(100%);-ms-transform:translateY(100%);transform:translateY(100%)}.custombox-overlay-open.custombox-overlay-contentscale{-webkit-transform:translateY(0);-ms-transform:translateY(0);transform:translateY(0)}.custombox-modal-container-blur,.custombox-modal-fadein,.custombox-modal-flip-horizontal,.custombox-modal-flip-vertical,.custombox-modal-newspaper,.custombox-modal-open .custombox-modal-fall,.custombox-modal-rotate-bottom,.custombox-modal-rotate-left,.custombox-modal-superscaled,.custombox-overlay-blur,.custombox-overlay-newspaper,.custombox-overlay-open.custombox-overlay-makeway,.custombox-overlay-open.custombox-overlay-slip{-webkit-transition-property:all;transition-property:all}.custombox-container-open.custombox-container-makeway{height:100%;overflow:hidden}.custombox-container-open.custombox-container-makeway,.custombox-overlay-open.custombox-overlay-makeway{-webkit-transform-style:preserve-3d;transform-style:preserve-3d;-webkit-transform-origin:0 50%;-ms-transform-origin:0 50%;transform-origin:0 50%;-webkit-animation:rotateRightSideFirst .5s forwards ease-in;animation:rotateRightSideFirst .5s forwards ease-in}@-webkit-keyframes rotateRightSideFirst{50%{-webkit-transform:translateZ(-50px)rotateY(5deg);transform:translateZ(-50px)rotateY(5deg);-webkit-animation-timing-function:ease-out;animation-timing-function:ease-out}100%{-webkit-transform:translateZ(-200px);transform:translateZ(-200px)}}@keyframes rotateRightSideFirst{50%{-webkit-transform:translateZ(-50px)rotateY(5deg);transform:translateZ(-50px)rotateY(5deg);-webkit-animation-timing-function:ease-out;animation-timing-function:ease-out}100%{-webkit-transform:translateZ(-200px);transform:translateZ(-200px)}}.custombox-container-open.custombox-container-slip,.custombox-overlay-open.custombox-overlay-slip{-webkit-transform-style:preserve-3d;transform-style:preserve-3d;-webkit-transform-origin:50% 100%;-ms-transform-origin:50% 100%;transform-origin:50% 100%;-webkit-animation:OpenTop .5s forwards ease-in-out;animation:OpenTop .5s forwards ease-in-out}@-webkit-keyframes OpenTop{50%{-webkit-transform:rotateX(10deg);transform:rotateX(10deg);-webkit-animation-timing-function:ease-out;animation-timing-function:ease-out}}@keyframes OpenTop{50%{-webkit-transform:rotateX(10deg);transform:rotateX(10deg);-webkit-animation-timing-function:ease-out;animation-timing-function:ease-out}}.custombox-modal-fadein{-webkit-transform:scale(.7);-ms-transform:scale(.7);transform:scale(.7);opacity:0;visibility:hidden}.custombox-modal-open .custombox-modal-fadein{-webkit-transform:scale(1);-ms-transform:scale(1);transform:scale(1);opacity:1;visibility:visible}.custombox-modal-container-slide>div,.custombox-modal-container-slidetogether>div{opacity:0;float:left}.custombox-modal-open>.custombox-modal-container-slide>div,.custombox-modal-open>.custombox-modal-container-slidetogether>div{opacity:1}.custombox-modal-slide-top{-webkit-transform:translateY(-300%);-ms-transform:translateY(-300%);transform:translateY(-300%)}.custombox-modal-open .custombox-modal-slide-top{-webkit-transform:translateY(0);-ms-transform:translateY(0);transform:translateY(0)}.custombox-modal-slide-left{-webkit-transform:translateX(-300%);-ms-transform:translateX(-300%);transform:translateX(-300%)}.custombox-modal-open .custombox-modal-slide-left{-webkit-transform:translateX(0);-ms-transform:translateX(0);transform:translateX(0)}.custombox-modal-slide-right{-webkit-transform:translateX(300%);-ms-transform:translateX(300%);transform:translateX(300%)}.custombox-modal-open .custombox-modal-slide-right{-webkit-transform:translateX(0);-ms-transform:translateX(0);transform:translateX(0)}.custombox-modal-slide-bottom{-webkit-transform:translateY(300%);-ms-transform:translateY(300%);transform:translateY(300%)}.custombox-modal-open .custombox-modal-slide-bottom{-webkit-transform:translateY(0);-ms-transform:translateY(0);transform:translateY(0)}.custombox-modal-newspaper{-webkit-transform:scale(0)rotate(720deg);-ms-transform:scale(0)rotate(720deg);transform:scale(0)rotate(720deg);opacity:0;position:absolute}.custombox-modal-open .custombox-modal-newspaper{-webkit-transform:scale(1)rotate(0);-ms-transform:scale(1)rotate(0);transform:scale(1)rotate(0);opacity:1}.custombox-modal-fall{-webkit-transform-style:preserve-3d;transform-style:preserve-3d;-webkit-transform:translateZ(600px)rotateX(20deg);transform:translateZ(600px)rotateX(20deg);opacity:0}.custombox-modal-open .custombox-modal-fall{-webkit-transition-timing-function:ease-in;transition-timing-function:ease-in;-webkit-transform:translateZ(0)rotateX(0);transform:translateZ(0)rotateX(0);opacity:1}.custombox-modal-wrapper-sidefall{overflow-x:hidden}.custombox-modal-sidefall{-webkit-transform-style:preserve-3d;transform-style:preserve-3d;-webkit-transform:translate(30%)translateZ(600px)rotate(10deg);transform:translate(30%)translateZ(600px)rotate(10deg);opacity:0}.custombox-modal-open .custombox-modal-sidefall{-webkit-transition-timing-function:ease-in;transition-timing-function:ease-in;-webkit-transition-property:all;transition-property:all;-webkit-transform:translate(0)translateZ(0)rotate(0);transform:translate(0)translateZ(0)rotate(0);opacity:1}.custombox-open-blur .custombox-container-blur{-webkit-filter:blur(3px);filter:blur(3px)}@media all and (-ms-high-contrast:none){.custombox-open-blur .custombox-container-blur{text-shadow:0 0 8px #000;color:rgba(255,255,255,0);filter:progid:DXImageTransform.Microsoft.Blur(PixelRadius='3');zoom:1}}.custombox-modal-blur{-webkit-transform:translateY(-5%);-ms-transform:translateY(-5%);transform:translateY(-5%);opacity:0;position:absolute}.custombox-modal-open .custombox-modal-blur{-webkit-transform:translateY(0);-ms-transform:translateY(0);transform:translateY(0);opacity:1}.custombox-modal-flip-horizontal{position:absolute;-webkit-transform-style:preserve-3d;transform-style:preserve-3d;-webkit-transform:rotateY(-70deg);transform:rotateY(-70deg);opacity:0}.custombox-modal-open .custombox-modal-flip-horizontal{-webkit-transform:rotateY(0);transform:rotateY(0);opacity:1}.custombox-modal-flip-vertical{position:absolute;-webkit-transform-style:preserve-3d;transform-style:preserve-3d;-webkit-transform:rotateX(-70deg);transform:rotateX(-70deg);opacity:0}.custombox-modal-open .custombox-modal-flip-vertical{-webkit-transform:rotateX(0);transform:rotateX(0);opacity:1}.custombox-modal-sign{-webkit-transform-style:preserve-3d;transform-style:preserve-3d;-webkit-transform:rotateX(-60deg);transform:rotateX(-60deg);-webkit-transform-origin:50% 0;-ms-transform-origin:50% 0;transform-origin:50% 0;opacity:0;-webkit-transition-property:all;transition-property:all}.custombox-modal-open .custombox-modal-sign{-webkit-transform:rotateX(0);transform:rotateX(0);opacity:1}.custombox-modal-superscaled{-webkit-transform:scale(2);-ms-transform:scale(2);transform:scale(2);opacity:0;position:absolute}.custombox-modal-open .custombox-modal-superscaled{-webkit-transform:scale(1);-ms-transform:scale(1);transform:scale(1);opacity:1}.custombox-modal-slit{-webkit-transform-style:preserve-3d;transform-style:preserve-3d;-webkit-transform:translateZ(-3000px)rotateY(90deg);transform:translateZ(-3000px)rotateY(90deg);opacity:0}.custombox-modal-open .custombox-modal-slit{-webkit-animation:slit .7s forwards ease-out;animation:slit .7s forwards ease-out}.custombox-modal-rotatedown,.custombox-modal-swell{-webkit-animation-fill-mode:forwards;animation-fill-mode:forwards}@-webkit-keyframes slit{50%{-webkit-transform:translateZ(-250px)rotateY(89deg);transform:translateZ(-250px)rotateY(89deg);opacity:1;-webkit-animation-timing-function:ease-out;animation-timing-function:ease-out}100%{-webkit-transform:translateZ(0)rotateY(0);transform:translateZ(0)rotateY(0);opacity:1}}@keyframes slit{50%{-webkit-transform:translateZ(-250px)rotateY(89deg);transform:translateZ(-250px)rotateY(89deg);opacity:1;-webkit-animation-timing-function:ease-out;animation-timing-function:ease-out}100%{-webkit-transform:translateZ(0)rotateY(0);transform:translateZ(0)rotateY(0);opacity:1}}.custombox-modal-rotate-bottom{-webkit-transform-style:preserve-3d;transform-style:preserve-3d;-webkit-transform:translateY(100%)rotateX(90deg);transform:translateY(100%)rotateX(90deg);-webkit-transform-origin:0 100%;-ms-transform-origin:0 100%;transform-origin:0 100%;opacity:0;-webkit-transition-timing-function:ease-out;transition-timing-function:ease-out;position:absolute}.custombox-modal-open .custombox-modal-rotate-bottom{-webkit-transform:translateY(0)rotateX(0);transform:translateY(0)rotateX(0);opacity:1}.custombox-modal-rotate-left{-webkit-transform-style:preserve-3d;transform-style:preserve-3d;-webkit-transform:translateZ(100px)translateX(-30%)rotateY(90deg);transform:translateZ(100px)translateX(-30%)rotateY(90deg);-webkit-transform-origin:0 100%;-ms-transform-origin:0 100%;transform-origin:0 100%;opacity:0;position:absolute}.custombox-modal-open .custombox-modal-rotate-left{-webkit-transform:translateZ(0)translateX(0)rotateY(0);transform:translateZ(0)translateX(0)rotateY(0);opacity:1}.custombox-modal-container-letmein{-webkit-transition-property:-webkit-transform;transition-property:transform;-webkit-transform:rotateX(-2deg);transform:rotateX(-2deg);-webkit-transform-origin:50% 0;-ms-transform-origin:50% 0;transform-origin:50% 0;-webkit-transform-style:preserve-3d;transform-style:preserve-3d;opacity:1}.custombox-modal-letmein{opacity:0;-webkit-transform:translateY(300%);-ms-transform:translateY(300%);transform:translateY(300%);float:left}.custombox-modal-open .custombox-modal-letmein{-webkit-transform:translateY(0);-ms-transform:translateY(0);transform:translateY(0);opacity:1;-webkit-transition-property:all;transition-property:all}.custombox-modal-makeway{-webkit-transform:translateX(200%);-ms-transform:translateX(200%);transform:translateX(200%);opacity:0;float:left}.custombox-modal-open .custombox-modal-makeway{-webkit-transform:translateX(0);-ms-transform:translateX(0);transform:translateX(0);opacity:1}.custombox-modal-wrapper-makeway{overflow:hidden}.custombox-modal-slip{-webkit-transform:translateY(-350%);-ms-transform:translateY(-350%);transform:translateY(-350%)}.custombox-modal-open .custombox-modal-slip{-webkit-transform:translateY(0);-ms-transform:translateY(0);transform:translateY(0);-webkit-transition-property:all;transition-property:all}.custombox-modal-corner{opacity:0;-webkit-transform:translateY(150px)translateX(150px);-ms-transform:translateY(150px)translateX(150px);transform:translateY(150px)translateX(150px);-webkit-transition-property:opacity,-webkit-transform,visibility;transition-property:opacity,transform,visibility}.custombox-modal-open .custombox-modal-corner{-webkit-transform:translateY(0);-ms-transform:translateY(0);transform:translateY(0);opacity:1;-webkit-transition-property:opacity,-webkit-transform;transition-property:opacity,transform}.custombox-modal-slidetogether{-webkit-transform:translateY(-600%);-ms-transform:translateY(-600%);transform:translateY(-600%)}.custombox-modal-open .custombox-modal-slidetogether{-webkit-transform:translateY(0);-ms-transform:translateY(0);transform:translateY(0)}.custombox-modal-scale{-webkit-transform:scale(.9);-ms-transform:scale(.9);transform:scale(.9);-webkit-transition:-webkit-transform;transition:transform;opacity:0}.custombox-modal-open .custombox-modal-scale{-webkit-transform:scale(1);-ms-transform:scale(1);transform:scale(1);-webkit-transition:-webkit-transform;transition:transform;opacity:1}.custombox-modal-door{visibility:hidden;opacity:0}.custombox-modal-open .custombox-modal-door{opacity:1;visibility:visible}.custombox-modal-push{-webkit-transform:translateX(-300%);-ms-transform:translateX(-300%);transform:translateX(-300%)}.custombox-modal-open .custombox-modal-push{-webkit-transform:translateX(0);-ms-transform:translateX(0);transform:translateX(0)}.custombox-modal-contentscale{-webkit-transform:translateY(600%);-ms-transform:translateY(600%);transform:translateY(600%);-webkit-transition-property:-webkit-transform ease-in-out;transition-property:transform ease-in-out;position:absolute}.custombox-modal-open .custombox-modal-contentscale{-webkit-transform:translateY(0);-ms-transform:translateY(0);transform:translateY(0)}.custombox-modal-swell{-webkit-animation-duration:.5s;animation-duration:.5s;-webkit-animation-timing-function:ease-out;animation-timing-function:ease-out;-webkit-animation-name:swell-close;animation-name:swell-close}.custombox-modal-open .custombox-modal-swell{-webkit-animation-name:swell-open;animation-name:swell-open}@-webkit-keyframes swell-open{0%{opacity:0;-webkit-transform:translate3d(-webkit-calc(-100vw - 50%),0,0);transform:translate3d(calc(-100vw - 50%),0,0)}50%{opacity:1;-webkit-transform:translate3d(100px,0,0);transform:translate3d(100px,0,0)}100%{opacity:1;-webkit-transform:translate3d(0,0,0);transform:translate3d(0,0,0)}}@keyframes swell-open{0%{opacity:0;-webkit-transform:translate3d(-webkit-calc(-100vw - 50%),0,0);transform:translate3d(calc(-100vw - 50%),0,0)}50%{opacity:1;-webkit-transform:translate3d(100px,0,0);transform:translate3d(100px,0,0)}100%{opacity:1;-webkit-transform:translate3d(0,0,0);transform:translate3d(0,0,0)}}@-webkit-keyframes swell-close{0%{opacity:1;-webkit-transform:translate3d(0,0,0);transform:translate3d(0,0,0)}50%{opacity:1;-webkit-transform:translate3d(-100px,0,0)scale3d(1.1,1.1,1);transform:translate3d(-100px,0,0)scale3d(1.1,1.1,1)}100%{opacity:0;-webkit-transform:translate3d(-webkit-calc(100vw + 50%),0,0);transform:translate3d(calc(100vw + 50%),0,0)}}@keyframes swell-close{0%{opacity:1;-webkit-transform:translate3d(0,0,0);transform:translate3d(0,0,0)}50%{opacity:1;-webkit-transform:translate3d(-100px,0,0)scale3d(1.1,1.1,1);transform:translate3d(-100px,0,0)scale3d(1.1,1.1,1)}100%{opacity:0;-webkit-transform:translate3d(-webkit-calc(100vw + 50%),0,0);transform:translate3d(calc(100vw + 50%),0,0)}}.custombox-modal-rotatedown{-webkit-animation-duration:.4s;animation-duration:.4s;-webkit-animation-timing-function:cubic-bezier(.7,0,.3,1);animation-timing-function:cubic-bezier(.7,0,.3,1);-webkit-transform-origin:-150% 50%;-ms-transform-origin:-150% 50%;transform-origin:-150% 50%;-webkit-animation-name:rotatedown-close;animation-name:rotatedown-close;overflow:hidden}.custombox-modal-open .custombox-modal-rotatedown{-webkit-animation-name:rotatedown-open;animation-name:rotatedown-open}.custombox-modal-open .custombox-modal-rotatedown div>*{-webkit-animation:rotatedown-elem .4s both;animation:rotatedown-elem .4s both;-webkit-transform-origin:-50% 50%;-ms-transform-origin:-50% 50%;transform-origin:-50% 50%;-webkit-animation-timing-function:cubic-bezier(.7,0,.3,1);animation-timing-function:cubic-bezier(.7,0,.3,1);-webkit-animation-delay:.15s;animation-delay:.15s}@-webkit-keyframes rotatedown-open{0%{opacity:0;-webkit-transform:rotate3d(0,0,1,-45deg);transform:rotate3d(0,0,1,-45deg)}100%{opacity:1;-webkit-transform:rotate3d(0,0,1,0deg);transform:rotate3d(0,0,1,0deg)}}@keyframes rotatedown-open{0%{opacity:0;-webkit-transform:rotate3d(0,0,1,-45deg);transform:rotate3d(0,0,1,-45deg)}100%{opacity:1;-webkit-transform:rotate3d(0,0,1,0deg);transform:rotate3d(0,0,1,0deg)}}@-webkit-keyframes rotatedown-close{0%{opacity:1}100%{opacity:0;-webkit-transform:rotate3d(0,0,1,45deg);transform:rotate3d(0,0,1,45deg)}}@keyframes rotatedown-close{0%{opacity:1}100%{opacity:0;-webkit-transform:rotate3d(0,0,1,45deg);transform:rotate3d(0,0,1,45deg)}}@-webkit-keyframes rotatedown-elem{0%{opacity:0;-webkit-transform:translate3d(0,-150px,0)rotate3d(0,0,1,-20deg);transform:translate3d(0,-150px,0)rotate3d(0,0,1,-20deg)}100%{opacity:1;-webkit-transform:translate3d(0,0,0)rotate3d(0,0,1,0deg);transform:translate3d(0,0,0)rotate3d(0,0,1,0deg)}}@keyframes rotatedown-elem{0%{opacity:0;-webkit-transform:translate3d(0,-150px,0)rotate3d(0,0,1,-20deg);transform:translate3d(0,-150px,0)rotate3d(0,0,1,-20deg)}100%{opacity:1;-webkit-transform:translate3d(0,0,0)rotate3d(0,0,1,0deg);transform:translate3d(0,0,0)rotate3d(0,0,1,0deg)}}.custombox-modal-flash{-webkit-animation-duration:.4s;animation-duration:.4s;-webkit-animation-fill-mode:forwards;animation-fill-mode:forwards;-webkit-animation-timing-function:cubic-bezier(.7,0,.3,1);animation-timing-function:cubic-bezier(.7,0,.3,1);-webkit-animation-name:flash-close;animation-name:flash-close;overflow:hidden}.custombox-modal-open .custombox-modal-flash{-webkit-animation-name:flash-open;animation-name:flash-open}.custombox-modal-open .custombox-modal-flash div>*{-webkit-animation:flash-elem-open .4s cubic-bezier(.7,0,.3,1)both;animation:flash-elem-open .4s cubic-bezier(.7,0,.3,1)both}.custombox-modal-flash div>*{-webkit-animation:flash-elem-close .4s cubic-bezier(.7,0,.3,1)both;animation:flash-elem-close .4s cubic-bezier(.7,0,.3,1)both}@-webkit-keyframes flash-open{0%{opacity:0;-webkit-transform:translate3d(-400px,0,0)scale3d(1.4,0,1);transform:translate3d(-400px,0,0)scale3d(1.4,0,1)}100%{opacity:1;-webkit-transform:translate3d(0,0,0)scale3d(1,1,1);transform:translate3d(0,0,0)scale3d(1,1,1)}}@keyframes flash-open{0%{opacity:0;-webkit-transform:translate3d(-400px,0,0)scale3d(1.4,0,1);transform:translate3d(-400px,0,0)scale3d(1.4,0,1)}100%{opacity:1;-webkit-transform:translate3d(0,0,0)scale3d(1,1,1);transform:translate3d(0,0,0)scale3d(1,1,1)}}@-webkit-keyframes flash-close{0%,20%{opacity:1;-webkit-transform:translate3d(0,0,0)scale3d(1,1,1);transform:translate3d(0,0,0)scale3d(1,1,1)}100%{opacity:0;-webkit-transform:translate3d(-400px,0,0)scale3d(1.4,0,1);transform:translate3d(-400px,0,0)scale3d(1.4,0,1)}}@keyframes flash-close{0%,20%{opacity:1;-webkit-transform:translate3d(0,0,0)scale3d(1,1,1);transform:translate3d(0,0,0)scale3d(1,1,1)}100%{opacity:0;-webkit-transform:translate3d(-400px,0,0)scale3d(1.4,0,1);transform:translate3d(-400px,0,0)scale3d(1.4,0,1)}}@-webkit-keyframes flash-elem-open{0%,20%{opacity:0;-webkit-transform:translate3d(-100px,0,0);transform:translate3d(-100px,0,0)}100%{opacity:1;-webkit-transform:translate3d(0,0,0);transform:translate3d(0,0,0)}}@keyframes flash-elem-open{0%,20%{opacity:0;-webkit-transform:translate3d(-100px,0,0);transform:translate3d(-100px,0,0)}100%{opacity:1;-webkit-transform:translate3d(0,0,0);transform:translate3d(0,0,0)}}@-webkit-keyframes flash-elem-close{0%{opacity:1;-webkit-transform:translate3d(0,0,0);transform:translate3d(0,0,0)}100%{opacity:0;-webkit-transform:translate3d(-100px,0,0);transform:translate3d(-100px,0,0)}}@keyframes flash-elem-close{0%{opacity:1;-webkit-transform:translate3d(0,0,0);transform:translate3d(0,0,0)}100%{opacity:0;-webkit-transform:translate3d(-100px,0,0);transform:translate3d(-100px,0,0)}} \ No newline at end of file +.custombox-modal-wrapper,.custombox-overlay{right:0;top:0;bottom:0;left:0;position:fixed}.custombox-open,.custombox-open body{overflow:hidden}.custombox-perspective,.custombox-perspective body{-webkit-perspective:600px;perspective:600px;height:100%}.custombox-overlay-open{visibility:visible;opacity:1}.custombox-overlay{-webkit-transition-delay:0s;transition-delay:0s}.custombox-overlay-default{-webkit-transition-timing-function:linear;transition-timing-function:linear;-webkit-transition-property:opacity;transition-property:opacity;opacity:0}.custombox-modal-wrapper{outline:0;overflow:auto;text-align:center}.custombox-modal-container{margin:0 auto;position:relative}.custombox-modal img{max-width:100%;height:auto}.custombox-scrollbar{position:absolute;top:-9999px;width:50px;height:50px;overflow:scroll}.custombox-loading{position:fixed;-webkit-transform:translateY(-50%) translateX(-50%);-ms-transform:translateY(-50%) translateX(-50%);transform:translateY(-50%) translateX(-50%);top:50%;left:50%}.custombox-overlay-letmein{-webkit-transition-property:all;transition-property:all;-webkit-transition-timing-function:ease;transition-timing-function:ease;visibility:hidden}.custombox-overlay-open.custombox-overlay-letmein{-webkit-transform:rotateX(-2deg);transform:rotateX(-2deg);-webkit-transform-origin:50% 0;-ms-transform-origin:50% 0;transform-origin:50% 0;-webkit-transform-style:preserve-3d;transform-style:preserve-3d;visibility:visible;opacity:1}.custombox-overlay-slidetogether{-webkit-transform:translateY(-100%);-ms-transform:translateY(-100%);transform:translateY(-100%);-webkit-transition-property:-webkit-transform ease-in-out;transition-property:transform ease-in-out}.custombox-overlay-open.custombox-overlay-slidetogether{-webkit-transform:translateY(0);-ms-transform:translateY(0);transform:translateY(0);-webkit-transition-property:-webkit-transform ease-in-out;transition-property:transform ease-in-out}.custombox-overlay-corner{-webkit-transform:translateY(150px) translateX(150px);-ms-transform:translateY(150px) translateX(150px);transform:translateY(150px) translateX(150px);-webkit-transition-property:opacity,-webkit-transform,visibility;transition-property:opacity,transform,visibility}.custombox-overlay-open.custombox-overlay-corner{-webkit-transform:translateY(0);-ms-transform:translateY(0);transform:translateY(0);-webkit-transition-property:opacity,-webkit-transform;transition-property:opacity,transform}.custombox-overlay-scale{-webkit-transform:scale(.9);-ms-transform:scale(.9);transform:scale(.9);-webkit-transition-property:-webkit-transform;transition-property:transform}.custombox-overlay-open.custombox-overlay-scale{-webkit-transform:scale(1);-ms-transform:scale(1);transform:scale(1);-webkit-transition-property:-webkit-transform;transition-property:transform}.custombox-overlay-door{visibility:hidden;width:0;left:50%;-webkit-transform:translateX(-50%);-ms-transform:translateX(-50%);transform:translateX(-50%);-webkit-transition-property:width ease-in-out;transition-property:width ease-in-out}.custombox-overlay-open.custombox-overlay-door{visibility:visible;width:100%;-webkit-transition-property:width ease-in-out;transition-property:width ease-in-out}.custombox-container-push{overflow-x:hidden;-webkit-transition-property:-webkit-transform;transition-property:transform}.custombox-container-open.custombox-container-push{-webkit-transform:translateX(100%);-ms-transform:translateX(100%);transform:translateX(100%)}.custombox-overlay-push{-webkit-backface-visibility:hidden;backface-visibility:hidden;-webkit-transform:translateX(-100%);-ms-transform:translateX(-100%);transform:translateX(-100%);-webkit-transition-property:-webkit-transform ease-in-out;transition-property:transform ease-in-out}.custombox-overlay-open.custombox-overlay-push{-webkit-transform:translateX(0);-ms-transform:translateX(0);transform:translateX(0);-webkit-transition-property:-webkit-transform ease-in-out;transition-property:transform ease-in-out}.custombox-open-contentscale body{background-color:#DDD}.custombox-container-contentscale{-webkit-transition:-webkit-transform .5s;transition:transform .5s;overflow:hidden;height:100%}.custombox-container-open.custombox-container-contentscale{-webkit-transform:scale(.8);-ms-transform:scale(.8);transform:scale(.8)}.custombox-overlay-contentscale{-webkit-transform:translateY(100%);-ms-transform:translateY(100%);transform:translateY(100%);-webkit-transition-property:-webkit-transform ease-in-out;transition-property:transform ease-in-out}.custombox-overlay-open.custombox-overlay-contentscale{-webkit-transform:translateY(0);-ms-transform:translateY(0);transform:translateY(0);-webkit-transition-property:-webkit-transform ease-in-out;transition-property:transform ease-in-out}.custombox-container-open.custombox-container-makeway{height:100%;overflow:hidden}.custombox-overlay-open.custombox-overlay-makeway{-webkit-transition-property:all;transition-property:all}.custombox-container-open.custombox-container-makeway,.custombox-overlay-open.custombox-overlay-makeway{-webkit-transform-style:preserve-3d;transform-style:preserve-3d;-webkit-transform-origin:0 50%;-ms-transform-origin:0 50%;transform-origin:0 50%;-webkit-animation:rotateRightSideFirst .5s forwards ease-in;animation:rotateRightSideFirst .5s forwards ease-in}@-webkit-keyframes rotateRightSideFirst{50%{-webkit-transform:translateZ(-50px) rotateY(5deg);transform:translateZ(-50px) rotateY(5deg);-webkit-animation-timing-function:ease-out;animation-timing-function:ease-out}100%{-webkit-transform:translateZ(-200px);transform:translateZ(-200px)}}@keyframes rotateRightSideFirst{50%{-webkit-transform:translateZ(-50px) rotateY(5deg);transform:translateZ(-50px) rotateY(5deg);-webkit-animation-timing-function:ease-out;animation-timing-function:ease-out}100%{-webkit-transform:translateZ(-200px);transform:translateZ(-200px)}}.custombox-overlay-open.custombox-overlay-slip{-webkit-transition-property:all;transition-property:all}.custombox-container-open.custombox-container-slip,.custombox-overlay-open.custombox-overlay-slip{-webkit-transform-style:preserve-3d;transform-style:preserve-3d;-webkit-transform-origin:50% 100%;-ms-transform-origin:50% 100%;transform-origin:50% 100%;-webkit-animation:OpenTop .5s forwards ease-in-out;animation:OpenTop .5s forwards ease-in-out}@-webkit-keyframes OpenTop{50%{-webkit-transform:rotateX(10deg);transform:rotateX(10deg);-webkit-animation-timing-function:ease-out;animation-timing-function:ease-out}}@keyframes OpenTop{50%{-webkit-transform:rotateX(10deg);transform:rotateX(10deg);-webkit-animation-timing-function:ease-out;animation-timing-function:ease-out}}.custombox-modal-fadein{-webkit-transform:scale(.7);-ms-transform:scale(.7);transform:scale(.7);-webkit-transition-property:all;transition-property:all;opacity:0;visibility:hidden}.custombox-modal-open .custombox-modal-fadein{-webkit-transform:scale(1);-ms-transform:scale(1);transform:scale(1);opacity:1;visibility:visible}.custombox-modal-container-slide>div,.custombox-modal-container-slidetogether>div{opacity:0;float:left}.custombox-modal-open>.custombox-modal-container-slide>div,.custombox-modal-open>.custombox-modal-container-slidetogether>div{opacity:1}.custombox-modal-slide-top{-webkit-transform:translateY(-300%);-ms-transform:translateY(-300%);transform:translateY(-300%)}.custombox-modal-open .custombox-modal-slide-top{-webkit-transform:translateY(0);-ms-transform:translateY(0);transform:translateY(0)}.custombox-modal-slide-left{-webkit-transform:translateX(-300%);-ms-transform:translateX(-300%);transform:translateX(-300%)}.custombox-modal-open .custombox-modal-slide-left{-webkit-transform:translateX(0);-ms-transform:translateX(0);transform:translateX(0)}.custombox-modal-slide-right{-webkit-transform:translateX(300%);-ms-transform:translateX(300%);transform:translateX(300%)}.custombox-modal-open .custombox-modal-slide-right{-webkit-transform:translateX(0);-ms-transform:translateX(0);transform:translateX(0)}.custombox-modal-slide-bottom{-webkit-transform:translateY(300%);-ms-transform:translateY(300%);transform:translateY(300%)}.custombox-modal-open .custombox-modal-slide-bottom{-webkit-transform:translateY(0);-ms-transform:translateY(0);transform:translateY(0)}.custombox-modal-newspaper{-webkit-transform:scale(0) rotate(720deg);-ms-transform:scale(0) rotate(720deg);transform:scale(0) rotate(720deg);opacity:0;-webkit-transition-property:all;transition-property:all;position:absolute}.custombox-overlay-newspaper{-webkit-transition-property:all;transition-property:all}.custombox-modal-open .custombox-modal-newspaper{-webkit-transform:scale(1) rotate(0);-ms-transform:scale(1) rotate(0);transform:scale(1) rotate(0);opacity:1}.custombox-modal-container-fall{-webkit-perspective:1300px;perspective:1300px}.custombox-modal-fall{-webkit-transform-style:preserve-3d;transform-style:preserve-3d;-webkit-transform:translateZ(600px) rotateX(20deg);transform:translateZ(600px) rotateX(20deg);opacity:0}.custombox-modal-open .custombox-modal-fall{-webkit-transition-timing-function:ease-in;transition-timing-function:ease-in;-webkit-transition-property:all;transition-property:all;-webkit-transform:translateZ(0) rotateX(0);transform:translateZ(0) rotateX(0);opacity:1}.custombox-modal-container-sidefall{-webkit-perspective:1300px;perspective:1300px}.custombox-modal-wrapper-sidefall{overflow-x:hidden}.custombox-modal-sidefall{-webkit-transform-style:preserve-3d;transform-style:preserve-3d;-webkit-transform:translate(30%) translateZ(600px) rotate(10deg);transform:translate(30%) translateZ(600px) rotate(10deg);opacity:0}.custombox-modal-open .custombox-modal-sidefall{-webkit-transition-timing-function:ease-in;transition-timing-function:ease-in;-webkit-transition-property:all;transition-property:all;-webkit-transform:translate(0) translateZ(0) rotate(0);transform:translate(0) translateZ(0) rotate(0);opacity:1}.custombox-open-blur .custombox-container-blur{-webkit-filter:blur(3px);filter:blur(3px)}@media all and (-ms-high-contrast:none){.custombox-open-blur .custombox-container-blur{text-shadow:0 0 8px #000;color:rgba(255,255,255,0);filter:progid:DXImageTransform.Microsoft.Blur(PixelRadius='3');zoom:1}}.custombox-modal-blur{-webkit-transform:translateY(-5%);-ms-transform:translateY(-5%);transform:translateY(-5%);opacity:0;position:absolute}.custombox-modal-container-blur,.custombox-overlay-blur{-webkit-transition-property:all;transition-property:all}.custombox-modal-open .custombox-modal-blur{-webkit-transform:translateY(0);-ms-transform:translateY(0);transform:translateY(0);opacity:1}.custombox-modal-container-flip{-webkit-perspective:1300px;perspective:1300px}.custombox-modal-flip-horizontal{position:absolute;-webkit-transform-style:preserve-3d;transform-style:preserve-3d;-webkit-transform:rotateY(-70deg);transform:rotateY(-70deg);-webkit-transition-property:all;transition-property:all;opacity:0}.custombox-modal-open .custombox-modal-flip-horizontal{-webkit-transform:rotateY(0);transform:rotateY(0);opacity:1}.custombox-modal-flip-vertical{position:absolute;-webkit-transform-style:preserve-3d;transform-style:preserve-3d;-webkit-transform:rotateX(-70deg);transform:rotateX(-70deg);-webkit-transition-property:all;transition-property:all;opacity:0}.custombox-modal-open .custombox-modal-flip-vertical{-webkit-transform:rotateX(0);transform:rotateX(0);opacity:1}.custombox-modal-container-sign{-webkit-perspective:1300px;perspective:1300px}.custombox-modal-sign{-webkit-transform-style:preserve-3d;transform-style:preserve-3d;-webkit-transform:rotateX(-60deg);transform:rotateX(-60deg);-webkit-transform-origin:50% 0;-ms-transform-origin:50% 0;transform-origin:50% 0;opacity:0;-webkit-transition-property:all;transition-property:all}.custombox-modal-open .custombox-modal-sign{-webkit-transform:rotateX(0);transform:rotateX(0);opacity:1}.custombox-modal-superscaled{-webkit-transform:scale(2);-ms-transform:scale(2);transform:scale(2);opacity:0;-webkit-transition-property:all;transition-property:all;position:absolute}.custombox-modal-open .custombox-modal-superscaled{-webkit-transform:scale(1);-ms-transform:scale(1);transform:scale(1);opacity:1}.custombox-modal-container-slit{-webkit-perspective:1300px;perspective:1300px}.custombox-modal-slit{-webkit-transform-style:preserve-3d;transform-style:preserve-3d;-webkit-transform:translateZ(-3000px) rotateY(90deg);transform:translateZ(-3000px) rotateY(90deg);opacity:0}.custombox-modal-open .custombox-modal-slit{-webkit-animation:slit .7s forwards ease-out;animation:slit .7s forwards ease-out}@-webkit-keyframes slit{50%{-webkit-transform:translateZ(-250px) rotateY(89deg);transform:translateZ(-250px) rotateY(89deg);opacity:1;-webkit-animation-timing-function:ease-out;animation-timing-function:ease-out}100%{-webkit-transform:translateZ(0) rotateY(0);transform:translateZ(0) rotateY(0);opacity:1}}@keyframes slit{50%{-webkit-transform:translateZ(-250px) rotateY(89deg);transform:translateZ(-250px) rotateY(89deg);opacity:1;-webkit-animation-timing-function:ease-out;animation-timing-function:ease-out}100%{-webkit-transform:translateZ(0) rotateY(0);transform:translateZ(0) rotateY(0);opacity:1}}.custombox-modal-container-rotate{-webkit-perspective:1300px;perspective:1300px}.custombox-modal-rotate-bottom{-webkit-transform-style:preserve-3d;transform-style:preserve-3d;-webkit-transform:translateY(100%) rotateX(90deg);transform:translateY(100%) rotateX(90deg);-webkit-transform-origin:0 100%;-ms-transform-origin:0 100%;transform-origin:0 100%;opacity:0;-webkit-transition-timing-function:ease-out;transition-timing-function:ease-out;-webkit-transition-property:all;transition-property:all;position:absolute}.custombox-modal-open .custombox-modal-rotate-bottom{-webkit-transform:translateY(0) rotateX(0);transform:translateY(0) rotateX(0);opacity:1}.custombox-modal-rotate-left{-webkit-transform-style:preserve-3d;transform-style:preserve-3d;-webkit-transform:translateZ(100px) translateX(-30%) rotateY(90deg);transform:translateZ(100px) translateX(-30%) rotateY(90deg);-webkit-transform-origin:0 100%;-ms-transform-origin:0 100%;transform-origin:0 100%;opacity:0;-webkit-transition-property:all;transition-property:all;position:absolute}.custombox-modal-open .custombox-modal-rotate-left{-webkit-transform:translateZ(0) translateX(0) rotateY(0);transform:translateZ(0) translateX(0) rotateY(0);opacity:1}.custombox-modal-container-letmein{-webkit-transition-property:-webkit-transform;transition-property:transform;-webkit-transform:rotateX(-2deg);transform:rotateX(-2deg);-webkit-transform-origin:50% 0;-ms-transform-origin:50% 0;transform-origin:50% 0;-webkit-transform-style:preserve-3d;transform-style:preserve-3d;opacity:1}.custombox-modal-letmein{opacity:0;-webkit-transform:translateY(300%);-ms-transform:translateY(300%);transform:translateY(300%);float:left}.custombox-modal-open .custombox-modal-letmein{-webkit-transform:translateY(0);-ms-transform:translateY(0);transform:translateY(0);opacity:1;-webkit-transition-property:all;transition-property:all}.custombox-modal-makeway{-webkit-transform:translateX(200%);-ms-transform:translateX(200%);transform:translateX(200%);opacity:0;float:left}.custombox-modal-open .custombox-modal-makeway{-webkit-transform:translateX(0);-ms-transform:translateX(0);transform:translateX(0);opacity:1}.custombox-modal-wrapper-makeway{overflow:hidden}.custombox-modal-slip{-webkit-transform:translateY(-350%);-ms-transform:translateY(-350%);transform:translateY(-350%)}.custombox-modal-open .custombox-modal-slip{-webkit-transform:translateY(0);-ms-transform:translateY(0);transform:translateY(0);-webkit-transition-property:all;transition-property:all}.custombox-modal-corner{opacity:0;-webkit-transform:translateY(150px) translateX(150px);-ms-transform:translateY(150px) translateX(150px);transform:translateY(150px) translateX(150px);-webkit-transition-property:opacity,-webkit-transform,visibility;transition-property:opacity,transform,visibility}.custombox-modal-open .custombox-modal-corner{-webkit-transform:translateY(0);-ms-transform:translateY(0);transform:translateY(0);opacity:1;-webkit-transition-property:opacity,-webkit-transform;transition-property:opacity,transform}.custombox-modal-slidetogether{-webkit-transform:translateY(-600%);-ms-transform:translateY(-600%);transform:translateY(-600%)}.custombox-modal-open .custombox-modal-slidetogether{-webkit-transform:translateY(0);-ms-transform:translateY(0);transform:translateY(0)}.custombox-modal-scale{-webkit-transform:scale(.9);-ms-transform:scale(.9);transform:scale(.9);-webkit-transition:-webkit-transform;transition:transform;opacity:0}.custombox-modal-open .custombox-modal-scale{-webkit-transform:scale(1);-ms-transform:scale(1);transform:scale(1);-webkit-transition:-webkit-transform;transition:transform;opacity:1}.custombox-modal-door{visibility:hidden;opacity:0}.custombox-modal-open .custombox-modal-door{opacity:1;visibility:visible}.custombox-modal-push{-webkit-transform:translateX(-300%);-ms-transform:translateX(-300%);transform:translateX(-300%)}.custombox-modal-open .custombox-modal-push{-webkit-transform:translateX(0);-ms-transform:translateX(0);transform:translateX(0)}.custombox-modal-contentscale{-webkit-transform:translateY(600%);-ms-transform:translateY(600%);transform:translateY(600%);-webkit-transition-property:-webkit-transform ease-in-out;transition-property:transform ease-in-out;position:absolute}.custombox-modal-open .custombox-modal-contentscale{-webkit-transform:translateY(0);-ms-transform:translateY(0);transform:translateY(0)}.custombox-modal-swell{-webkit-animation-duration:.5s;animation-duration:.5s;-webkit-animation-fill-mode:forwards;animation-fill-mode:forwards;-webkit-animation-timing-function:ease-out;animation-timing-function:ease-out;-webkit-animation-name:swell-close;animation-name:swell-close}.custombox-modal-open .custombox-modal-swell{-webkit-animation-name:swell-open;animation-name:swell-open}@-webkit-keyframes swell-open{0%{opacity:0;-webkit-transform:translate3d(-webkit-calc(-100vw - 50%),0,0);transform:translate3d(calc(-100vw - 50%),0,0)}50%{opacity:1;-webkit-transform:translate3d(100px,0,0);transform:translate3d(100px,0,0)}100%{opacity:1;-webkit-transform:translate3d(0,0,0);transform:translate3d(0,0,0)}}@keyframes swell-open{0%{opacity:0;-webkit-transform:translate3d(-webkit-calc(-100vw - 50%),0,0);transform:translate3d(calc(-100vw - 50%),0,0)}50%{opacity:1;-webkit-transform:translate3d(100px,0,0);transform:translate3d(100px,0,0)}100%{opacity:1;-webkit-transform:translate3d(0,0,0);transform:translate3d(0,0,0)}}@-webkit-keyframes swell-close{0%{opacity:1;-webkit-transform:translate3d(0,0,0);transform:translate3d(0,0,0)}50%{opacity:1;-webkit-transform:translate3d(-100px,0,0) scale3d(1.1,1.1,1);transform:translate3d(-100px,0,0) scale3d(1.1,1.1,1)}100%{opacity:0;-webkit-transform:translate3d(-webkit-calc(100vw + 50%),0,0);transform:translate3d(calc(100vw + 50%),0,0)}}@keyframes swell-close{0%{opacity:1;-webkit-transform:translate3d(0,0,0);transform:translate3d(0,0,0)}50%{opacity:1;-webkit-transform:translate3d(-100px,0,0) scale3d(1.1,1.1,1);transform:translate3d(-100px,0,0) scale3d(1.1,1.1,1)}100%{opacity:0;-webkit-transform:translate3d(-webkit-calc(100vw + 50%),0,0);transform:translate3d(calc(100vw + 50%),0,0)}}.custombox-modal-rotatedown{-webkit-animation-duration:.4s;animation-duration:.4s;-webkit-animation-timing-function:cubic-bezier(.7,0,.3,1);animation-timing-function:cubic-bezier(.7,0,.3,1);-webkit-animation-fill-mode:forwards;animation-fill-mode:forwards;-webkit-transform-origin:-150% 50%;-ms-transform-origin:-150% 50%;transform-origin:-150% 50%;-webkit-animation-name:rotatedown-close;animation-name:rotatedown-close;overflow:hidden}.custombox-modal-open .custombox-modal-rotatedown{-webkit-animation-name:rotatedown-open;animation-name:rotatedown-open}.custombox-modal-open .custombox-modal-rotatedown div>*{-webkit-animation:rotatedown-elem .4s both;animation:rotatedown-elem .4s both;-webkit-transform-origin:-50% 50%;-ms-transform-origin:-50% 50%;transform-origin:-50% 50%;-webkit-animation-timing-function:cubic-bezier(.7,0,.3,1);animation-timing-function:cubic-bezier(.7,0,.3,1);-webkit-animation-delay:.15s;animation-delay:.15s}@-webkit-keyframes rotatedown-open{0%{opacity:0;-webkit-transform:rotate3d(0,0,1,-45deg);transform:rotate3d(0,0,1,-45deg)}100%{opacity:1;-webkit-transform:rotate3d(0,0,1,0deg);transform:rotate3d(0,0,1,0deg)}}@keyframes rotatedown-open{0%{opacity:0;-webkit-transform:rotate3d(0,0,1,-45deg);transform:rotate3d(0,0,1,-45deg)}100%{opacity:1;-webkit-transform:rotate3d(0,0,1,0deg);transform:rotate3d(0,0,1,0deg)}}@-webkit-keyframes rotatedown-close{0%{opacity:1}100%{opacity:0;-webkit-transform:rotate3d(0,0,1,45deg);transform:rotate3d(0,0,1,45deg)}}@keyframes rotatedown-close{0%{opacity:1}100%{opacity:0;-webkit-transform:rotate3d(0,0,1,45deg);transform:rotate3d(0,0,1,45deg)}}@-webkit-keyframes rotatedown-elem{0%{opacity:0;-webkit-transform:translate3d(0,-150px,0) rotate3d(0,0,1,-20deg);transform:translate3d(0,-150px,0) rotate3d(0,0,1,-20deg)}100%{opacity:1;-webkit-transform:translate3d(0,0,0) rotate3d(0,0,1,0deg);transform:translate3d(0,0,0) rotate3d(0,0,1,0deg)}}@keyframes rotatedown-elem{0%{opacity:0;-webkit-transform:translate3d(0,-150px,0) rotate3d(0,0,1,-20deg);transform:translate3d(0,-150px,0) rotate3d(0,0,1,-20deg)}100%{opacity:1;-webkit-transform:translate3d(0,0,0) rotate3d(0,0,1,0deg);transform:translate3d(0,0,0) rotate3d(0,0,1,0deg)}}.custombox-modal-flash{-webkit-animation-duration:.4s;animation-duration:.4s;-webkit-animation-fill-mode:forwards;animation-fill-mode:forwards;-webkit-animation-timing-function:cubic-bezier(.7,0,.3,1);animation-timing-function:cubic-bezier(.7,0,.3,1);-webkit-animation-name:flash-close;animation-name:flash-close;overflow:hidden}.custombox-modal-open .custombox-modal-flash{-webkit-animation-name:flash-open;animation-name:flash-open}.custombox-modal-open .custombox-modal-flash div>*{-webkit-animation:flash-elem-open .4s cubic-bezier(.7,0,.3,1) both;animation:flash-elem-open .4s cubic-bezier(.7,0,.3,1) both}.custombox-modal-flash div>*{-webkit-animation:flash-elem-close .4s cubic-bezier(.7,0,.3,1) both;animation:flash-elem-close .4s cubic-bezier(.7,0,.3,1) both}@-webkit-keyframes flash-open{0%{opacity:0;-webkit-transform:translate3d(-400px,0,0) scale3d(1.4,0,1);transform:translate3d(-400px,0,0) scale3d(1.4,0,1)}100%{opacity:1;-webkit-transform:translate3d(0,0,0) scale3d(1,1,1);transform:translate3d(0,0,0) scale3d(1,1,1)}}@keyframes flash-open{0%{opacity:0;-webkit-transform:translate3d(-400px,0,0) scale3d(1.4,0,1);transform:translate3d(-400px,0,0) scale3d(1.4,0,1)}100%{opacity:1;-webkit-transform:translate3d(0,0,0) scale3d(1,1,1);transform:translate3d(0,0,0) scale3d(1,1,1)}}@-webkit-keyframes flash-close{0%,20%{opacity:1;-webkit-transform:translate3d(0,0,0) scale3d(1,1,1);transform:translate3d(0,0,0) scale3d(1,1,1)}100%{opacity:0;-webkit-transform:translate3d(-400px,0,0) scale3d(1.4,0,1);transform:translate3d(-400px,0,0) scale3d(1.4,0,1)}}@keyframes flash-close{0%,20%{opacity:1;-webkit-transform:translate3d(0,0,0) scale3d(1,1,1);transform:translate3d(0,0,0) scale3d(1,1,1)}100%{opacity:0;-webkit-transform:translate3d(-400px,0,0) scale3d(1.4,0,1);transform:translate3d(-400px,0,0) scale3d(1.4,0,1)}}@-webkit-keyframes flash-elem-open{0%,20%{opacity:0;-webkit-transform:translate3d(-100px,0,0);transform:translate3d(-100px,0,0)}100%{opacity:1;-webkit-transform:translate3d(0,0,0);transform:translate3d(0,0,0)}}@keyframes flash-elem-open{0%,20%{opacity:0;-webkit-transform:translate3d(-100px,0,0);transform:translate3d(-100px,0,0)}100%{opacity:1;-webkit-transform:translate3d(0,0,0);transform:translate3d(0,0,0)}}@-webkit-keyframes flash-elem-close{0%{opacity:1;-webkit-transform:translate3d(0,0,0);transform:translate3d(0,0,0)}100%{opacity:0;-webkit-transform:translate3d(-100px,0,0);transform:translate3d(-100px,0,0)}}@keyframes flash-elem-close{0%{opacity:1;-webkit-transform:translate3d(0,0,0);transform:translate3d(0,0,0)}100%{opacity:0;-webkit-transform:translate3d(-100px,0,0);transform:translate3d(-100px,0,0)}} \ No newline at end of file diff --git a/dist/custombox.min.js b/dist/custombox.min.js index 9bfc36f..28bcbee 100644 --- a/dist/custombox.min.js +++ b/dist/custombox.min.js @@ -1,5 +1,5 @@ /* - * custombox v3.0.1 - 2015-09-19 + * custombox v3.0.2 - 2015-12-05 * Modal Window Effects with transitions CSS3. * http://dixso.github.io/custombox/ * (c) 2015 Julio de la Calle - @dixso9 @@ -7,4 +7,4 @@ * Under MIT License - http://opensource.org/licenses/MIT */ -!function(a,b){"object"==typeof exports&&"undefined"!=typeof module?module.exports=b():"function"==typeof define&&define.amd?define(b):a.Custombox=b()}(this,function(){"use strict";var a={target:null,cache:!1,escKey:!0,zIndex:9999,overlay:!0,overlayColor:"#000",overlayOpacity:.8,overlayClose:!0,overlaySpeed:300,overlayEffect:"auto",width:null,effect:"fadein",position:["center","center"],animation:null,speed:500,loading:!1,open:null,complete:null,close:null},b={oldIE:navigator.appVersion.indexOf("MSIE 8.")>-1||navigator.appVersion.indexOf("MSIE 9.")>-1,oldMobile:/(iPhone|iPad|iPod)\sOS\s6/.test(navigator.userAgent),overlay:{perspective:["letmein","makeway","slip"],together:["corner","slidetogether","scale","door","push","contentscale","simplegenie","slit","slip"]},modal:{position:["slide","flip","rotate"],animationend:["swell","rotatedown","flash"]}},c={set:function(c){if(this.cb&&this.cb.length||(this.cb=[],this.item=-1),this.item++,c&&"auto"===c.zIndex){for(var d=0,e=0,f=document.getElementsByTagName("*"),g=f.length;g>e;e+=1){var h=window.getComputedStyle(f[e]).getPropertyValue("z-index");h&&(h=+h,h>d&&(d=h))}c.zIndex=d}this.cb.push({settings:b.oldIE&&"undefined"!=typeof cbExtendObjects?cbExtendObjects({},a,c):Object.assign({},a,c)}),"auto"===this.cb[this.item].settings.overlayEffect&&(this.cb[this.item].settings.overlayEffect=this.cb[this.item].settings.effect)},get:function(){return this.cb[this.cb.length-1]||null},init:function(){document.documentElement.classList.add("custombox-open"),document.documentElement.classList.add("custombox-open-"+this.cb[this.item].settings.overlayEffect),b.overlay.perspective.indexOf(this.cb[this.item].settings.overlayEffect)>-1&&(this.cb[this.item].scroll=document.documentElement&&document.documentElement.scrollTop||document.body&&document.body.scrollTop||0,document.documentElement.classList.add("custombox-perspective"),window.scrollTo(0,0)),this.main||this.built("container"),this.cb[this.item].settings.loading&&this.cb[this.item].settings.loading.parent&&this.built("loading"),this.cb[this.item].settings.overlay?this.built("overlay").built("modal").open():this.built("modal").open(),this.binds()},built:function(a){var c;switch("undefined"!=typeof this.item&&(c=this.cb[this.item]),a){case"container":for(this.main=document.createElement("div");document.body.firstChild;)this.main.appendChild(document.body.firstChild);document.body.appendChild(this.main);break;case"overlay":c.overlay||(c.overlay={}),c.overlay=document.createElement("div"),c.overlay.classList.add("custombox-overlay"),c.overlay.classList.add("custombox-overlay-"+c.settings.overlayEffect),c.overlay.style.zIndex=c.settings.zIndex+2,c.overlay.style.backgroundColor=c.settings.overlayColor,b.overlay.perspective.indexOf(c.settings.overlayEffect)>-1||b.overlay.together.indexOf(c.settings.overlayEffect)>-1?c.overlay.style.opacity=c.settings.overlayOpacity:c.overlay.classList.add("custombox-overlay-default"),c.overlay.style.transitionDuration=b.overlay.together.indexOf(c.settings.overlayEffect)>-1?c.settings.speed+"ms":c.settings.overlaySpeed+"ms",document.body.insertBefore(c.overlay,document.body.lastChild.nextSibling);break;case"modal":"push"===c.settings.overlayEffect&&(this.main.style.transitionDuration=c.settings.speed+"ms"),this.main.classList.add("custombox-container"),this.main.classList.add("custombox-container-"+c.settings.overlayEffect),c.wrapper=document.createElement("div"),c.wrapper.classList.add("custombox-modal-wrapper"),c.wrapper.classList.add("custombox-modal-wrapper-"+c.settings.effect),c.wrapper.style.zIndex=c.settings.zIndex+3,document.body.insertBefore(c.wrapper,document.body.lastChild.nextSibling),c.container=document.createElement("div"),c.container.classList.add("custombox-modal-container"),c.container.classList.add("custombox-modal-container-"+c.settings.effect),c.container.style.zIndex=c.settings.zIndex+4,b.modal.position.indexOf(c.settings.effect)>-1&&null===c.settings.animation&&(c.settings.animation="slide"===c.settings.effect?["top"]:"flip"===c.settings.effect?["horizontal"]:["bottom"]),c.modal=document.createElement("div"),c.modal.classList.add("custombox-modal"),c.modal.classList.add("custombox-modal-"+c.settings.effect+(b.modal.position.indexOf(c.settings.effect)>-1?"-"+c.settings.animation[0].trim():"")),c.modal.style.transitionDuration=c.settings.speed+"ms",c.modal.style.zIndex=c.settings.zIndex+4,c.wrapper.appendChild(c.container).appendChild(c.modal);break;case"loading":this.loading=document.createElement("div"),this.loading.classList.add("custombox-loading");for(var d=document.createElement("div"),e=0,f=this.cb[this.item].settings.loading.parent.length;f>e;e++)d.classList.add(this.cb[this.item].settings.loading.parent[e]);if(this.loading.appendChild(d),this.loading.style.zIndex=c.settings.zIndex+3,this.cb[this.item].settings.loading.childrens)for(var g=0,h=this.cb[this.item].settings.loading.childrens.length;h>g;g++){for(var i=document.createElement("div"),j=0,k=this.cb[this.item].settings.loading.childrens[g].length;k>j;j++)i.classList.add(this.cb[this.item].settings.loading.childrens[g][j]);d.appendChild(i)}document.body.appendChild(this.loading)}return this},load:function(){var a=this.cb[this.item];if("function"==typeof a.settings.open&&a.settings.open.call(),document.createEvent){var b=document.createEvent("Event");b.initEvent("custombox.open",!0,!0),document.dispatchEvent(b)}return null!==a.settings.target&&Array.isArray(a.settings.position)?"#"===a.settings.target.charAt(0)||"."===a.settings.target.charAt(0)&&"/"!==a.settings.target.charAt(1)?document.querySelector(a.settings.target)?(a.inline=document.createElement("div"),a.content=document.querySelector(a.settings.target),a.display="none"===a.content.style.display,a.content.style.display="block",a.content.parentNode.insertBefore(a.inline,a.content),this.size()):this.error():this.ajax():this.error(),this},size:function(){var a=this.cb[this.item],c=a.content.offsetWidth;if(b.oldIE&&(window.innerHeight=document.documentElement.clientHeight),a.inline||(b.oldIE?a.content.style.styleFloat="none":a.content.style.cssFloat="none"),null!==a.settings.width&&(isNaN(a.settings.width)?(c=window.innerWidth,a.content.style.height=window.innerHeight+"px"):c=parseInt(a.settings.width,0)),a.size=c,a.size+60>=window.innerWidth){a.container.style.width="auto","full"!==a.settings.width&&(a.container.style.margin="5%"),a.wrapper.style.width=window.innerWidth+"px";for(var d=0,e=a.content.querySelectorAll(":scope > *"),f=e.length;f>d;d++)e[d].offsetWidth>window.innerWidth&&(e[d].style.width="auto")}else{switch(a.settings.position[0].trim()){case"left":a.container.style.marginLeft=0;break;case"right":a.container.style.marginRight=0}a.container.style.width=a.size+"px"}if(a.content.style.width="auto",a.modal.appendChild(a.content),a.content.offsetHeight>=window.innerHeight&&"full"!==a.settings.width)a.container.style.marginTop="5%",a.container.style.marginBottom="5%";else{var g;switch(a.settings.position[1].trim()){case"top":g=0;break;case"bottom":g=window.innerHeight-a.content.offsetHeight+"px";break;default:g=window.innerHeight/2-a.content.offsetHeight/2+"px"}a.container.style.marginTop=g}this.loading&&(document.body.removeChild(this.loading),delete this.loading),a.wrapper.classList.add("custombox-modal-open")},ajax:function(){var a=this,c=a.cb[a.item],d=new XMLHttpRequest,e=document.createElement("div");d.onreadystatechange=function(){4===d.readyState&&(200===d.status?(e.innerHTML=d.responseText,c.content=e,c.content.style.display="block",b.oldIE?c.content.style.styleFloat="left":c.content.style.cssFloat="left",c.container.appendChild(c.content),a.size()):a.error())},d.open("GET",c.settings.target+(c.settings.cache?"":(/[?].+=/.test(c.settings.target)?"&_=":"?_=")+Date.now()),!0),d.setRequestHeader("X-Requested-With","XMLHttpRequest"),d.send(null)},scrollbar:function(){var a=document.createElement("div");a.classList.add("custombox-scrollbar"),document.body.appendChild(a);var b=a.offsetWidth-a.clientWidth;return document.body.removeChild(a),b},open:function(){var a=this,c=0,d=a.cb[a.item],e=a.scrollbar();if(e&&(document.body.style.paddingRight=e+"px"),a.main.classList.add("custombox-container-open"),a.cb[a.item].settings.loading&&(c=a.cb[a.item].settings.loading.delay&&!isNaN(1*a.cb[a.item].settings.loading.delay)?1*a.cb[a.item].settings.loading.delay:1e3),d.settings.overlay){b.overlay.perspective.indexOf(d.settings.overlayEffect)>-1||b.overlay.together.indexOf(d.settings.overlayEffect)>-1?d.overlay.classList.add("custombox-overlay-open"):d.overlay.style.opacity=d.settings.overlayOpacity;var f=function(){d.overlay.removeEventListener("transitionend",f),a.load(),d.inline&&d.wrapper.classList.add("custombox-modal-open")};a.cb[a.item].settings.loading?setTimeout(function(){f()},c):b.overlay.together.indexOf(d.settings.overlayEffect)>-1||b.oldIE?a.cb[a.item].settings.loading&&setTimeout(function(){a.load(),d.inline&&d.wrapper.classList.add("custombox-modal-open")},c):d.overlay.addEventListener("transitionend",f,!1)}else a.cb[a.item].settings.loading&&setTimeout(function(){a.load(),d.inline&&d.wrapper.classList.add("custombox-modal-open")},c);return a},clean:function(a){var c=this,d=this.cb[a];if(document.documentElement.classList.remove("custombox-open-"+d.settings.overlayEffect),d.settings.overlay&&(d.overlay.style.opacity&&(d.overlay.style.opacity=0),d.overlay.classList.remove("custombox-overlay-open"),c.main.classList.remove("custombox-container-open")),b.oldIE||b.oldMobile||!d.overlay)c.remove(a);else{var e=function(){d.overlay.removeEventListener("transitionend",e),c.remove(a)};d.overlay.addEventListener("transitionend",e,!1)}},remove:function(a){var c=this,d=this.cb[a];if(d){if(1===c.cb.length&&(document.documentElement.classList.remove("custombox-open","custombox-perspective"),c.scrollbar()&&(document.body.style.paddingRight=0),"undefined"!=typeof d.scroll&&window.scrollTo(0,d.scroll)),d.inline&&(b.oldIE?(d.content.style.removeAttribute("width"),d.content.style.removeAttribute("height"),d.content.style.removeAttribute("display")):(d.content.style.removeProperty("width"),d.content.style.removeProperty("height"),d.content.style.removeProperty("display")),d.display&&(d.content.style.display="none"),d.inline.parentNode.replaceChild(d.content,d.inline)),c.main.classList.remove("custombox-container-"+d.settings.overlayEffect),d.wrapper.parentNode.removeChild(d.wrapper),d.settings.overlay&&d.overlay.parentNode.removeChild(d.overlay),document.createEvent){var e=document.createEvent("Event");e.initEvent("custombox.close",!0,!0),document.dispatchEvent(e)}if(1===c.cb.length){for(var f=document.querySelectorAll(".custombox-container > *"),g=0,h=f.length;h>g;g++)document.body.insertBefore(f[g],c.main);c.main.parentNode&&c.main.parentNode.removeChild(c.main),delete c.main}c.cb.splice(a,1),"function"==typeof d.settings.close&&d.settings.close.call()}},close:function(a,c){var d,e=this;if(a){for(var f=0,g=this.cb.length;g>f;f++)if(this.cb[f].settings.target===a){d=f;break}}else d=e.cb.length-1;var h=e.cb[d];if("function"==typeof c&&(h.settings.close=c),b.modal.position.indexOf(h.settings.effect)>-1&&h.settings.animation.length>1&&(h.modal.classList.remove("custombox-modal-"+h.settings.effect+"-"+h.settings.animation[0]),h.modal.classList.add("custombox-modal-"+h.settings.effect+"-"+h.settings.animation[1].trim())),h.wrapper.classList.remove("custombox-modal-open"),b.oldIE||b.oldMobile||b.overlay.together.indexOf(h.settings.overlayEffect)>-1)e.clean(d);else{var i=function(){h.wrapper.removeEventListener("transitionend",i),e.clean(d)};b.modal.animationend.indexOf(h.settings.effect)>-1?h.wrapper.addEventListener("animationend",i,!1):h.wrapper.addEventListener("transitionend",i,!1)}},responsive:function(){b.oldIE&&(window.innerHeight=document.documentElement.clientHeight);for(var a,c=0,d=this.cb.length;d>c;c++){if(this.cb[c].size+60>=window.innerWidth)"full"!==this.cb[c].settings.width?(this.cb[c].container.style.marginLeft="5%",this.cb[c].container.style.marginRight="5%"):this.cb[c].content.offsetWidth<=window.innerWidth&&(this.cb[c].content.style.width="auto"),this.cb[c].container.style.width="auto",this.cb[c].wrapper.style.width=window.innerWidth+"px";else{switch(this.cb[c].settings.position[0].trim()){case"left":this.cb[c].container.style.marginLeft=0;break;case"right":this.cb[c].container.style.marginRight=0;break;default:this.cb[c].container.style.marginLeft="auto",this.cb[c].container.style.marginRight="auto"}this.cb[c].container.style.width=this.cb[c].size+"px",this.cb[c].wrapper.style.width="auto"}if(this.cb[c].content.offsetHeight>=window.innerHeight&&"full"!==this.cb[c].settings.width)this.cb[c].container.style.marginTop="5%",this.cb[c].container.style.marginBottom="5%";else{switch("full"===this.cb[c].settings.width&&(this.cb[c].settings.position[1]="top",this.cb[c].content.offsetHeight<=window.innerHeight&&(this.cb[c].content.style.height=window.innerHeight+"px")),this.cb[c].settings.position[1].trim()){case"top":a=0;break;case"bottom":a=window.innerHeight-this.cb[c].content.offsetHeight+"px";break;default:a=window.innerHeight/2-this.cb[c].content.offsetHeight/2+"px"}this.cb[c].container.style.marginTop=a}}},binds:function(){var a=this,c=a.cb[a.item],d=!1;1===a.cb.length&&(a.esc=function(b){1===a.cb.length&&document.removeEventListener("keydown",a.esc),b=b||window.event,!d&&27===b.keyCode&&a.get()&&a.get().settings.escKey&&(d=!0,a.close())},document.addEventListener("keydown",a.esc,!1),window.addEventListener("onorientationchange"in window?"orientationchange":"resize",function(){a.responsive()},!1)),c.wrapper.event=function(b){1===a.cb.length&&document.removeEventListener("keydown",c.wrapper.event),!d&&b.target===c.wrapper&&a.get()&&a.get().settings.overlayClose&&(d=!0,a.close())},c.wrapper.addEventListener("click",c.wrapper.event,!1),document.addEventListener("custombox.close",function(){d=!1});var e=function(){if(!c.inline)for(var a=0,b=c.modal.getElementsByTagName("script"),d=b.length;d>a;a++)new Function(b[a].text)();if(c.settings&&"function"==typeof c.settings.complete&&c.settings.complete.call(),document.createEvent){var e=document.createEvent("Event");e.initEvent("custombox.complete",!0,!0),document.dispatchEvent(e)}},f=function(){e(),c.modal.removeEventListener("transitionend",f)};b.oldIE||b.oldMobile?setTimeout(function(){e()},c.settings.overlaySpeed):"slit"!==c.settings.effect?c.modal.addEventListener("transitionend",f,!1):c.modal.addEventListener("animationend",f,!1)},error:function(){var a=this,b=a.cb.length-1;alert("Error to load this target: "+a.cb[b].settings.target),a.remove(b)}};return{set:function(a){a.autobuild&&c.built("container")},open:function(a){c.set(a),c.init()},close:function(a,b){"function"==typeof a&&(b=a,a=!1),c.close(a,b)}}}); \ No newline at end of file +!function(a,b){"object"==typeof exports&&"undefined"!=typeof module?module.exports=b():"function"==typeof define&&define.amd?define(b):a.Custombox=b()}(this,function(){"use strict";var a={target:null,cache:!1,escKey:!0,zIndex:9999,overlay:!0,overlayColor:"#000",overlayOpacity:.8,overlayClose:!0,overlaySpeed:300,overlayEffect:"auto",width:null,effect:"fadein",position:["center","center"],animation:null,speed:500,loading:!1,open:null,complete:null,close:null},b={oldIE:navigator.appVersion.indexOf("MSIE 8.")>-1||navigator.appVersion.indexOf("MSIE 9.")>-1,oldMobile:/(iPhone|iPad|iPod)\sOS\s6/.test(navigator.userAgent),overlay:{perspective:["letmein","makeway","slip"],together:["corner","slidetogether","scale","door","push","contentscale","simplegenie","slit","slip"]},modal:{position:["slide","flip","rotate"],animationend:["swell","rotatedown","flash"]}},c={set:function(c){if(this.cb&&this.cb.length||(this.cb=[],this.item=-1),this.item++,c&&"auto"===c.zIndex){for(var d=0,e=0,f=document.getElementsByTagName("*"),g=f.length;g>e;e+=1){var h=window.getComputedStyle(f[e]).getPropertyValue("z-index");h&&(h=+h,h>d&&(d=h))}c.zIndex=d}this.cb.push({settings:b.oldIE&&"undefined"!=typeof cbExtendObjects?cbExtendObjects({},a,c):Object.assign({},a,c)}),"auto"===this.cb[this.item].settings.overlayEffect&&(this.cb[this.item].settings.overlayEffect=this.cb[this.item].settings.effect)},get:function(){return this.cb[this.cb.length-1]||null},init:function(){document.documentElement.classList.add("custombox-open"),document.documentElement.classList.add("custombox-open-"+this.cb[this.item].settings.overlayEffect),b.overlay.perspective.indexOf(this.cb[this.item].settings.overlayEffect)>-1&&(this.cb[this.item].scroll=document.documentElement&&document.documentElement.scrollTop||document.body&&document.body.scrollTop||0,document.documentElement.classList.add("custombox-perspective"),window.scrollTo(0,0)),this.main||this.built("container"),this.cb[this.item].settings.loading&&this.cb[this.item].settings.loading.parent&&this.built("loading"),this.cb[this.item].settings.overlay?this.built("overlay").built("modal").open():this.built("modal").open(),this.binds()},built:function(a){var c;switch("undefined"!=typeof this.item&&(c=this.cb[this.item]),a){case"container":for(this.main=document.createElement("div");document.body.firstChild;)this.main.appendChild(document.body.firstChild);document.body.appendChild(this.main);break;case"overlay":c.overlay||(c.overlay={}),c.overlay=document.createElement("div"),c.overlay.classList.add("custombox-overlay"),c.overlay.classList.add("custombox-overlay-"+c.settings.overlayEffect),c.overlay.style.zIndex=c.settings.zIndex+2,c.overlay.style.backgroundColor=c.settings.overlayColor,b.overlay.perspective.indexOf(c.settings.overlayEffect)>-1||b.overlay.together.indexOf(c.settings.overlayEffect)>-1?c.overlay.style.opacity=c.settings.overlayOpacity:c.overlay.classList.add("custombox-overlay-default"),b.overlay.together.indexOf(c.settings.overlayEffect)>-1?c.overlay.style.transitionDuration=c.settings.speed+"ms":c.overlay.style.transitionDuration=c.settings.overlaySpeed+"ms",document.body.insertBefore(c.overlay,document.body.lastChild.nextSibling);break;case"modal":"push"===c.settings.overlayEffect&&(this.main.style.transitionDuration=c.settings.speed+"ms"),this.main.classList.add("custombox-container"),this.main.classList.add("custombox-container-"+c.settings.overlayEffect),c.wrapper=document.createElement("div"),c.wrapper.classList.add("custombox-modal-wrapper"),c.wrapper.classList.add("custombox-modal-wrapper-"+c.settings.effect),c.wrapper.style.zIndex=c.settings.zIndex+3,document.body.insertBefore(c.wrapper,document.body.lastChild.nextSibling),c.container=document.createElement("div"),c.container.classList.add("custombox-modal-container"),c.container.classList.add("custombox-modal-container-"+c.settings.effect),c.container.style.zIndex=c.settings.zIndex+4,b.modal.position.indexOf(c.settings.effect)>-1&&null===c.settings.animation&&("slide"===c.settings.effect?c.settings.animation=["top"]:"flip"===c.settings.effect?c.settings.animation=["horizontal"]:c.settings.animation=["bottom"]),c.modal=document.createElement("div"),c.modal.classList.add("custombox-modal"),c.modal.classList.add("custombox-modal-"+c.settings.effect+(b.modal.position.indexOf(c.settings.effect)>-1?"-"+c.settings.animation[0].trim():"")),c.modal.style.transitionDuration=c.settings.speed+"ms",c.modal.style.zIndex=c.settings.zIndex+4,c.wrapper.appendChild(c.container).appendChild(c.modal);break;case"loading":this.loading=document.createElement("div"),this.loading.classList.add("custombox-loading");for(var d=document.createElement("div"),e=0,f=this.cb[this.item].settings.loading.parent.length;f>e;e++)d.classList.add(this.cb[this.item].settings.loading.parent[e]);if(this.loading.appendChild(d),this.loading.style.zIndex=c.settings.zIndex+3,this.cb[this.item].settings.loading.childrens)for(var g=0,h=this.cb[this.item].settings.loading.childrens.length;h>g;g++){for(var i=document.createElement("div"),j=0,k=this.cb[this.item].settings.loading.childrens[g].length;k>j;j++)i.classList.add(this.cb[this.item].settings.loading.childrens[g][j]);d.appendChild(i)}document.body.appendChild(this.loading)}return this},load:function(){var a=this.cb[this.item];if("function"==typeof a.settings.open&&a.settings.open.call(),document.createEvent){var b=document.createEvent("Event");b.initEvent("custombox.open",!0,!0),document.dispatchEvent(b)}return null!==a.settings.target&&Array.isArray(a.settings.position)?"#"===a.settings.target.charAt(0)||"."===a.settings.target.charAt(0)&&"/"!==a.settings.target.charAt(1)?document.querySelector(a.settings.target)?(a.inline=document.createElement("div"),a.content=document.querySelector(a.settings.target),a.display="none"===a.content.style.display,a.content.style.display="block",a.content.parentNode.insertBefore(a.inline,a.content),this.size()):this.error():this.ajax():this.error(),this},size:function(){var a=this.cb[this.item],c=a.content.offsetWidth;if(b.oldIE&&(window.innerHeight=document.documentElement.clientHeight),a.inline||(b.oldIE?a.content.style.styleFloat="none":a.content.style.cssFloat="none"),null!==a.settings.width&&(isNaN(a.settings.width)?(c=window.innerWidth,a.content.style.height=window.innerHeight+"px"):c=parseInt(a.settings.width,0)),a.size=c,a.size+60>=window.innerWidth){a.container.style.width="auto","full"!==a.settings.width&&(a.container.style.margin="5%"),a.wrapper.style.width=window.innerWidth+"px";for(var d=0,e=a.content.querySelectorAll(":scope > *"),f=e.length;f>d;d++)e[d].offsetWidth>window.innerWidth&&(e[d].style.width="auto")}else{switch(a.settings.position[0].trim()){case"left":a.container.style.marginLeft=0;break;case"right":a.container.style.marginRight=0}a.container.style.width=a.size+"px"}if(a.content.style.width="auto",a.modal.appendChild(a.content),a.content.offsetHeight>=window.innerHeight&&"full"!==a.settings.width)a.container.style.marginTop="5%",a.container.style.marginBottom="5%";else{var g;switch(a.settings.position[1].trim()){case"top":g=0;break;case"bottom":g=window.innerHeight-a.content.offsetHeight+"px";break;default:g=window.innerHeight/2-a.content.offsetHeight/2+"px"}a.container.style.marginTop=g}this.loading&&(document.body.removeChild(this.loading),delete this.loading),a.wrapper.classList.add("custombox-modal-open")},ajax:function(){var a=this,c=a.cb[a.item],d=new XMLHttpRequest,e=document.createElement("div");d.onreadystatechange=function(){4===d.readyState&&(200===d.status?(e.innerHTML=d.responseText,c.content=e,c.content.style.display="block",b.oldIE?c.content.style.styleFloat="left":c.content.style.cssFloat="left",c.container.appendChild(c.content),a.size()):a.error())},d.open("GET",c.settings.target+(c.settings.cache?"":(/[?].+=/.test(c.settings.target)?"&_=":"?_=")+Date.now()),!0),d.setRequestHeader("X-Requested-With","XMLHttpRequest"),d.send(null)},scrollbar:function(){var a=document.createElement("div");a.classList.add("custombox-scrollbar"),document.body.appendChild(a);var b=a.offsetWidth-a.clientWidth;return document.body.removeChild(a),b},open:function(){var a=this,c=0,d=a.cb[a.item],e=a.scrollbar();e&&(document.body.style.paddingRight=e+"px"),a.main.classList.add("custombox-container-open"),a.cb[a.item].settings.loading&&(c=a.cb[a.item].settings.loading.delay&&!isNaN(1*a.cb[a.item].settings.loading.delay)?1*a.cb[a.item].settings.loading.delay:1e3);var f=function(b){b&&d.overlay.removeEventListener("transitionend",f),a.load(),d.inline&&d.wrapper.classList.add("custombox-modal-open")};return d.settings.overlay?(b.overlay.perspective.indexOf(d.settings.overlayEffect)>-1||b.overlay.together.indexOf(d.settings.overlayEffect)>-1?d.overlay.classList.add("custombox-overlay-open"):d.overlay.style.opacity=d.settings.overlayOpacity,a.cb[a.item].settings.loading?setTimeout(f,c):b.overlay.together.indexOf(d.settings.overlayEffect)>-1||b.oldIE?f(!1):d.overlay.addEventListener("transitionend",f,!1)):a.cb[a.item].settings.loading?setTimeout(f,c):f(!1),a},clean:function(a){var c=this,d=this.cb[a];if(document.documentElement.classList.remove("custombox-open-"+d.settings.overlayEffect),d.settings.overlay&&(d.overlay.style.opacity&&(d.overlay.style.opacity=0),d.overlay.classList.remove("custombox-overlay-open"),c.main.classList.remove("custombox-container-open")),b.oldIE||b.oldMobile||!d.overlay)c.remove(a);else{var e=function(){d.overlay.removeEventListener("transitionend",e),c.remove(a)};d.overlay.addEventListener("transitionend",e,!1)}},remove:function(a){var c=this,d=this.cb[a];if(d){if(1===c.cb.length&&(document.documentElement.classList.remove("custombox-open","custombox-perspective"),c.scrollbar()&&(document.body.style.paddingRight=0),"undefined"!=typeof d.scroll&&window.scrollTo(0,d.scroll)),d.inline&&(b.oldIE?(d.content.style.removeAttribute("width"),d.content.style.removeAttribute("height"),d.content.style.removeAttribute("display")):(d.content.style.removeProperty("width"),d.content.style.removeProperty("height"),d.content.style.removeProperty("display")),d.display&&(d.content.style.display="none"),d.inline.parentNode.replaceChild(d.content,d.inline)),c.main.classList.remove("custombox-container-"+d.settings.overlayEffect),d.wrapper.parentNode.removeChild(d.wrapper),d.settings.overlay&&d.overlay.parentNode.removeChild(d.overlay),document.createEvent){var e=document.createEvent("Event");e.initEvent("custombox.close",!0,!0),document.dispatchEvent(e)}if(1===c.cb.length){for(var f=document.querySelectorAll(".custombox-container > *"),g=0,h=f.length;h>g;g++)document.body.insertBefore(f[g],c.main);c.main.parentNode&&c.main.parentNode.removeChild(c.main),delete c.main}c.cb.splice(a,1),"function"==typeof d.settings.close&&d.settings.close.call()}},close:function(a,c){var d,e=this;if(a){for(var f=0,g=this.cb.length;g>f;f++)if(this.cb[f].settings.target===a){d=f;break}}else d=e.cb.length-1;var h=e.cb[d];if("function"==typeof c&&(h.settings.close=c),b.modal.position.indexOf(h.settings.effect)>-1&&h.settings.animation.length>1&&(h.modal.classList.remove("custombox-modal-"+h.settings.effect+"-"+h.settings.animation[0]),h.modal.classList.add("custombox-modal-"+h.settings.effect+"-"+h.settings.animation[1].trim())),h.wrapper.classList.remove("custombox-modal-open"),b.oldIE||b.oldMobile||b.overlay.together.indexOf(h.settings.overlayEffect)>-1)e.clean(d);else{var i=function(){h.wrapper.removeEventListener("transitionend",i),e.clean(d)};b.modal.animationend.indexOf(h.settings.effect)>-1?h.wrapper.addEventListener("animationend",i,!1):h.wrapper.addEventListener("transitionend",i,!1)}},responsive:function(){b.oldIE&&(window.innerHeight=document.documentElement.clientHeight);for(var a,c=0,d=this.cb.length;d>c;c++){if(this.cb[c].size+60>=window.innerWidth)"full"!==this.cb[c].settings.width?(this.cb[c].container.style.marginLeft="5%",this.cb[c].container.style.marginRight="5%"):this.cb[c].content.offsetWidth<=window.innerWidth&&(this.cb[c].content.style.width="auto"),this.cb[c].container.style.width="auto",this.cb[c].wrapper.style.width=window.innerWidth+"px";else{switch(this.cb[c].settings.position[0].trim()){case"left":this.cb[c].container.style.marginLeft=0;break;case"right":this.cb[c].container.style.marginRight=0;break;default:this.cb[c].container.style.marginLeft="auto",this.cb[c].container.style.marginRight="auto"}this.cb[c].container.style.width=this.cb[c].size+"px",this.cb[c].wrapper.style.width="auto"}if(this.cb[c].content.offsetHeight>=window.innerHeight&&"full"!==this.cb[c].settings.width)this.cb[c].container.style.marginTop="5%",this.cb[c].container.style.marginBottom="5%";else{switch("full"===this.cb[c].settings.width&&(this.cb[c].settings.position[1]="top",this.cb[c].content.offsetHeight<=window.innerHeight&&(this.cb[c].content.style.height=window.innerHeight+"px")),this.cb[c].settings.position[1].trim()){case"top":a=0;break;case"bottom":a=window.innerHeight-this.cb[c].content.offsetHeight+"px";break;default:a=window.innerHeight/2-this.cb[c].content.offsetHeight/2+"px"}this.cb[c].container.style.marginTop=a}}},binds:function(){var a=this,c=a.cb[a.item],d=!1;1===a.cb.length&&(a.esc=function(b){1===a.cb.length&&document.removeEventListener("keydown",a.esc),b=b||window.event,!d&&27===b.keyCode&&a.get()&&a.get().settings.escKey&&(d=!0,a.close())},document.addEventListener("keydown",a.esc,!1),window.addEventListener("onorientationchange"in window?"orientationchange":"resize",function(){a.responsive()},!1)),c.wrapper.event=function(b){1===a.cb.length&&document.removeEventListener("keydown",c.wrapper.event),!d&&b.target===c.wrapper&&a.get()&&a.get().settings.overlayClose&&(d=!0,a.close())},c.wrapper.addEventListener("click",c.wrapper.event,!1),document.addEventListener("custombox.close",function(){d=!1});var e=function(){if(!c.inline)for(var a=0,b=c.modal.getElementsByTagName("script"),d=b.length;d>a;a++)new Function(b[a].text)();if(c.settings&&"function"==typeof c.settings.complete&&c.settings.complete.call(),document.createEvent){var e=document.createEvent("Event");e.initEvent("custombox.complete",!0,!0),document.dispatchEvent(e)}},f=function(){e(),c.modal.removeEventListener("transitionend",f)};b.oldIE||b.oldMobile?setTimeout(function(){e()},c.settings.overlaySpeed):"slit"!==c.settings.effect?c.modal.addEventListener("transitionend",f,!1):c.modal.addEventListener("animationend",f,!1)},error:function(){var a=this,b=a.cb.length-1;alert("Error to load this target: "+a.cb[b].settings.target),a.remove(b)}};return{set:function(a){a.autobuild&&c.built("container")},open:function(a){c.set(a),c.init()},close:function(a,b){"function"==typeof a&&(b=a,a=!1),c.close(a,b)}}}); \ No newline at end of file diff --git a/dist/legacy.min.js b/dist/legacy.min.js index 9358b81..91a05a6 100644 --- a/dist/legacy.min.js +++ b/dist/legacy.min.js @@ -1,5 +1,5 @@ /* - * custombox v3.0.1 - 2015-09-19 + * custombox v3.0.2 - 2015-12-05 * Modal Window Effects with transitions CSS3. * http://dixso.github.io/custombox/ * (c) 2015 Julio de la Calle - @dixso9 @@ -15,4 +15,4 @@ * Under MIT License - http://opensource.org/licenses/MIT */ -function cbExtendObjects(){for(var a=1,b=arguments.length;b>a;a++)for(var c in arguments[a])arguments[a].hasOwnProperty(c)&&(arguments[0][c]=arguments[a][c]);return arguments[0]}if(function(a){a.getComputedStyle||(a.getComputedStyle=function(a){return this.el=a,this.getPropertyValue=function(b){var c=/(\-([a-z]){1})/g;return"float"==b&&(b="styleFloat"),c.test(b)&&(b=b.replace(c,function(){return arguments[2].toUpperCase()})),a.currentStyle[b]?a.currentStyle[b]:null},this})}(window),Function.prototype.bind||(Function.prototype.bind=function(a){"use strict";if("function"!=typeof this)throw new TypeError("Function.prototype.bind - what is trying to be bound is not callable");var b=Array.prototype.slice.call(arguments,1),c=this,d=function(){},e=function(){return c.apply(this instanceof d&&a?this:a,b.concat(Array.prototype.slice.call(arguments)))};return d.prototype=this.prototype,e.prototype=new d,e}),function(){"use strict";var a=Object.prototype,b=a.__defineGetter__,c=a.__defineSetter__,d=a.__lookupGetter__,e=a.__lookupSetter__,f=a.hasOwnProperty;b&&c&&d&&e&&(Object.defineProperty||(Object.defineProperty=function(a,g,h){if(arguments.length<3)throw new TypeError("Arguments not optional");if(g+="",f.call(h,"value")&&(d.call(a,g)||e.call(a,g)||(a[g]=h.value),f.call(h,"get")||f.call(h,"set")))throw new TypeError("Cannot specify an accessor and a value");if(!(h.writable&&h.enumerable&&h.configurable))throw new TypeError("This implementation of Object.defineProperty does not support false for configurable, enumerable, or writable.");return h.get&&b.call(a,g,h.get),h.set&&c.call(a,g,h.set),a}),Object.getOwnPropertyDescriptor||(Object.getOwnPropertyDescriptor=function(a,b){if(arguments.length<2)throw new TypeError("Arguments not optional.");b+="";var c={configurable:!0,enumerable:!0,writable:!0},g=d.call(a,b),h=e.call(a,b);return f.call(a,b)?g||h?(delete c.writable,c.get=c.set=void 0,g&&(c.get=g),h&&(c.set=h),c):(c.value=a[b],c):c}),Object.defineProperties||(Object.defineProperties=function(a,b){var c;for(c in b)f.call(b,c)&&Object.defineProperty(a,c,b[c])}))}(),!(document.documentElement.dataset||Object.getOwnPropertyDescriptor(Element.prototype,"dataset")&&Object.getOwnPropertyDescriptor(Element.prototype,"dataset").get)){var propDescriptor={enumerable:!0,get:function(){"use strict";var a,b,c,d,e,f,g=this,h=this.attributes,i=h.length,j=function(a){return a.charAt(1).toUpperCase()},k=function(){return this},l=function(a,b){return"undefined"!=typeof b?this.setAttribute(a,b):this.removeAttribute(a)};try{({}).__defineGetter__("test",function(){}),b={}}catch(m){b=document.createElement("div")}for(a=0;i>a;a++)if(f=h[a],f&&f.name&&/^data-\w[\w\-]*$/.test(f.name)){c=f.value,d=f.name,e=d.substr(5).replace(/-./g,j);try{Object.defineProperty(b,e,{enumerable:this.enumerable,get:k.bind(c||""),set:l.bind(g,d)})}catch(n){b[e]=c}}return b}};try{Object.defineProperty(Element.prototype,"dataset",propDescriptor)}catch(e){propDescriptor.enumerable=!1,Object.defineProperty(Element.prototype,"dataset",propDescriptor)}}"document"in self&&("classList"in document.createElement("_")?!function(){"use strict";var a=document.createElement("_");if(a.classList.add("c1","c2"),!a.classList.contains("c2")){var b=function(a){var b=DOMTokenList.prototype[a];DOMTokenList.prototype[a]=function(a){var c,d=arguments.length;for(c=0;d>c;c++)a=arguments[c],b.call(this,a)}};b("add"),b("remove")}if(a.classList.toggle("c3",!1),a.classList.contains("c3")){var c=DOMTokenList.prototype.toggle;DOMTokenList.prototype.toggle=function(a,b){return 1 in arguments&&!this.contains(a)==!b?b:c.call(this,a)}}a=null}():!function(a){"use strict";if("Element"in a){var b="classList",c="prototype",d=a.Element[c],e=Object,f=String[c].trim||function(){return this.replace(/^\s+|\s+$/g,"")},g=Array[c].indexOf||function(a){for(var b=0,c=this.length;c>b;b++)if(b in this&&this[b]===a)return b;return-1},h=function(a,b){this.name=a,this.code=DOMException[a],this.message=b},i=function(a,b){if(""===b)throw new h("SYNTAX_ERR","An invalid or illegal string was specified");if(/\s/.test(b))throw new h("INVALID_CHARACTER_ERR","String contains an invalid character");return g.call(a,b)},j=function(a){for(var b=f.call(a.getAttribute("class")||""),c=b?b.split(/\s+/):[],d=0,e=c.length;e>d;d++)this.push(c[d]);this._updateClassName=function(){a.setAttribute("class",this.toString())}},k=j[c]=[],l=function(){return new j(this)};if(h[c]=Error[c],k.item=function(a){return this[a]||null},k.contains=function(a){return a+="",-1!==i(this,a)},k.add=function(){var a,b=arguments,c=0,d=b.length,e=!1;do a=b[c]+"",-1===i(this,a)&&(this.push(a),e=!0);while(++c>>0;if(0===e)return-1;var f=+b||0;if(1/0===Math.abs(f)&&(f=0),f>=e)return-1;for(c=Math.max(f>=0?f:e-Math.abs(f),0);e>c;){if(c in d&&d[c]===a)return c;c++}return-1}),function(a,b,c){if((!a.addEventListener||!a.removeEventListener)&&a.attachEvent&&a.detachEvent){var d=function(a){return"function"==typeof a},e=function(a,b){var d=b[c];if(d)for(var e,f=d.length;f--;)if(e=d[f],e[0]===a)return e[1]},f=function(a,b,d){var f=b[c]||(b[c]=[]);return e(a,b)||(f[f.length]=[a,d],d)},g=function(a){var c=b[a];b[a]=function(a){return j(c(a))}},h=function(c,e){if(d(e)){var g=this;g.attachEvent("on"+c,f(g,e,function(c){c=c||a.event,c.preventDefault=c.preventDefault||function(){c.returnValue=!1},c.stopPropagation=c.stopPropagation||function(){c.cancelBubble=!0},c.target=c.target||c.srcElement||b.documentElement,c.currentTarget=c.currentTarget||g,c.timeStamp=c.timeStamp||(new Date).getTime(),e.call(g,c)}))}},i=function(a,b){if(d(b)){var c=this,f=e(c,b);f&&c.detachEvent("on"+a,f)}},j=function(a){var b=a.length;if(b)for(;b--;)a[b].addEventListener=h,a[b].removeEventListener=i;else a.addEventListener=h,a.removeEventListener=i;return a};if(j([b,a]),"Element"in a){var k=a.Element;k.prototype.addEventListener=h,k.prototype.removeEventListener=i}else b.attachEvent("onreadystatechange",function(){j(b.all)}),g("getElementsByTagName"),g("getElementById"),g("createElement"),j(b.all)}}(window,document,"x-ms-event-listeners"),Array.prototype.forEach||(Array.prototype.forEach=function(a,b){"use strict";var c,d;if(null==this)throw new TypeError("this is null or not defined");var e,f=Object(this),g=f.length>>>0;if("[object Function]"!=={}.toString.call(a))throw new TypeError(a+" is not a function");for(arguments.length>=2&&(c=b),d=0;g>d;)d in f&&(e=f[d],a.call(c,e,d,f)),d++}),function(a,b){try{a.querySelector(":scope body")}catch(c){["querySelector","querySelectorAll"].forEach(function(c){var d=b[c];b[c]=function(b){if(/(^|,)\s*:scope/.test(b)){var e=this.id;this.id="ID_"+Date.now(),b=b.replace(/((^|,)\s*):scope/g,"$1#"+this.id);var f=a[c](b);return this.id=e,f}return d.call(this,b)}})}}(window.document,Element.prototype),-1===navigator.appVersion.indexOf("MSIE 8.")&&-1===navigator.appVersion.indexOf("MSIE 9.")&&(Object.assign||Object.defineProperty(Object,"assign",{enumerable:!1,configurable:!0,writable:!0,value:function(a){"use strict";if(void 0===a||null===a)throw new TypeError("Cannot convert first argument to object");for(var b=Object(a),c=1;cf;f++){var h=e[f],i=Object.getOwnPropertyDescriptor(d,h);void 0!==i&&i.enumerable&&(b[h]=d[h])}}return b}})),Array.isArray||(Array.isArray=function(a){return"[object Array]"===Object.prototype.toString.call(a)}); \ No newline at end of file +function cbExtendObjects(){for(var a=1,b=arguments.length;b>a;a++)for(var c in arguments[a])arguments[a].hasOwnProperty(c)&&(arguments[0][c]=arguments[a][c]);return arguments[0]}if(function(a){a.getComputedStyle||(a.getComputedStyle=function(a){return this.el=a,this.getPropertyValue=function(b){var c=/(\-([a-z]){1})/g;return"float"==b&&(b="styleFloat"),c.test(b)&&(b=b.replace(c,function(){return arguments[2].toUpperCase()})),a.currentStyle[b]?a.currentStyle[b]:null},this})}(window),Function.prototype.bind||(Function.prototype.bind=function(a){"use strict";if("function"!=typeof this)throw new TypeError("Function.prototype.bind - what is trying to be bound is not callable");var b=Array.prototype.slice.call(arguments,1),c=this,d=function(){},e=function(){return c.apply(this instanceof d&&a?this:a,b.concat(Array.prototype.slice.call(arguments)))};return d.prototype=this.prototype,e.prototype=new d,e}),function(){"use strict";var a=Object.prototype,b=a.__defineGetter__,c=a.__defineSetter__,d=a.__lookupGetter__,e=a.__lookupSetter__,f=a.hasOwnProperty;b&&c&&d&&e&&(Object.defineProperty||(Object.defineProperty=function(a,g,h){if(arguments.length<3)throw new TypeError("Arguments not optional");if(g+="",f.call(h,"value")&&(d.call(a,g)||e.call(a,g)||(a[g]=h.value),f.call(h,"get")||f.call(h,"set")))throw new TypeError("Cannot specify an accessor and a value");if(!(h.writable&&h.enumerable&&h.configurable))throw new TypeError("This implementation of Object.defineProperty does not support false for configurable, enumerable, or writable.");return h.get&&b.call(a,g,h.get),h.set&&c.call(a,g,h.set),a}),Object.getOwnPropertyDescriptor||(Object.getOwnPropertyDescriptor=function(a,b){if(arguments.length<2)throw new TypeError("Arguments not optional.");b+="";var c={configurable:!0,enumerable:!0,writable:!0},g=d.call(a,b),h=e.call(a,b);return f.call(a,b)?g||h?(delete c.writable,c.get=c.set=void 0,g&&(c.get=g),h&&(c.set=h),c):(c.value=a[b],c):c}),Object.defineProperties||(Object.defineProperties=function(a,b){var c;for(c in b)f.call(b,c)&&Object.defineProperty(a,c,b[c])}))}(),!(document.documentElement.dataset||Object.getOwnPropertyDescriptor(Element.prototype,"dataset")&&Object.getOwnPropertyDescriptor(Element.prototype,"dataset").get)){var propDescriptor={enumerable:!0,get:function(){"use strict";var a,b,c,d,e,f,g=this,h=this.attributes,i=h.length,j=function(a){return a.charAt(1).toUpperCase()},k=function(){return this},l=function(a,b){return"undefined"!=typeof b?this.setAttribute(a,b):this.removeAttribute(a)};try{({}).__defineGetter__("test",function(){}),b={}}catch(m){b=document.createElement("div")}for(a=0;i>a;a++)if(f=h[a],f&&f.name&&/^data-\w[\w\-]*$/.test(f.name)){c=f.value,d=f.name,e=d.substr(5).replace(/-./g,j);try{Object.defineProperty(b,e,{enumerable:this.enumerable,get:k.bind(c||""),set:l.bind(g,d)})}catch(n){b[e]=c}}return b}};try{Object.defineProperty(Element.prototype,"dataset",propDescriptor)}catch(e){propDescriptor.enumerable=!1,Object.defineProperty(Element.prototype,"dataset",propDescriptor)}}"document"in self&&("classList"in document.createElement("_")?!function(){"use strict";var a=document.createElement("_");if(a.classList.add("c1","c2"),!a.classList.contains("c2")){var b=function(a){var b=DOMTokenList.prototype[a];DOMTokenList.prototype[a]=function(a){var c,d=arguments.length;for(c=0;d>c;c++)a=arguments[c],b.call(this,a)}};b("add"),b("remove")}if(a.classList.toggle("c3",!1),a.classList.contains("c3")){var c=DOMTokenList.prototype.toggle;DOMTokenList.prototype.toggle=function(a,b){return 1 in arguments&&!this.contains(a)==!b?b:c.call(this,a)}}a=null}():!function(a){"use strict";if("Element"in a){var b="classList",c="prototype",d=a.Element[c],e=Object,f=String[c].trim||function(){return this.replace(/^\s+|\s+$/g,"")},g=Array[c].indexOf||function(a){for(var b=0,c=this.length;c>b;b++)if(b in this&&this[b]===a)return b;return-1},h=function(a,b){this.name=a,this.code=DOMException[a],this.message=b},i=function(a,b){if(""===b)throw new h("SYNTAX_ERR","An invalid or illegal string was specified");if(/\s/.test(b))throw new h("INVALID_CHARACTER_ERR","String contains an invalid character");return g.call(a,b)},j=function(a){for(var b=f.call(a.getAttribute("class")||""),c=b?b.split(/\s+/):[],d=0,e=c.length;e>d;d++)this.push(c[d]);this._updateClassName=function(){a.setAttribute("class",this.toString())}},k=j[c]=[],l=function(){return new j(this)};if(h[c]=Error[c],k.item=function(a){return this[a]||null},k.contains=function(a){return a+="",-1!==i(this,a)},k.add=function(){var a,b=arguments,c=0,d=b.length,e=!1;do a=b[c]+"",-1===i(this,a)&&(this.push(a),e=!0);while(++c>>0;if(0===e)return-1;var f=+b||0;if(Math.abs(f)===1/0&&(f=0),f>=e)return-1;for(c=Math.max(f>=0?f:e-Math.abs(f),0);e>c;){if(c in d&&d[c]===a)return c;c++}return-1}),this.Element&&Element.prototype.attachEvent&&!Element.prototype.addEventListener&&function(){function a(a,b){Window.prototype[a]=HTMLDocument.prototype[a]=Element.prototype[a]=b}function b(a){b.interval&&document.body&&(b.interval=clearInterval(b.interval),document.dispatchEvent(new CustomEvent("DOMContentLoaded")))}a("addEventListener",function(a,b){var c=this,d=c.addEventListener.listeners=c.addEventListener.listeners||{},e=d[a]=d[a]||[];e.length||c.attachEvent("on"+a,e.event=function(a){var b=c.document&&c.document.documentElement||c.documentElement||{scrollLeft:0,scrollTop:0};a.currentTarget=c,a.pageX=a.clientX+b.scrollLeft,a.pageY=a.clientY+b.scrollTop,a.preventDefault=function(){a.returnValue=!1},a.relatedTarget=a.fromElement||null,a.stopImmediatePropagation=function(){h=!1,a.cancelBubble=!0},a.stopPropagation=function(){a.cancelBubble=!0},a.target=a.srcElement||c,a.timeStamp=+new Date;for(var d,f=0,g=[].concat(e),h=!0;h&&(d=g[f]);++f)for(var i,j=0;i=e[j];++j)if(i==d){i.call(c,a);break}}),e.push(b)}),a("removeEventListener",function(a,b){for(var c,d=this,e=d.addEventListener.listeners=d.addEventListener.listeners||{},f=e[a]=e[a]||[],g=f.length-1;c=f[g];--g)if(c==b){f.splice(g,1);break}!f.length&&f.event&&d.detachEvent("on"+a,f.event)}),a("dispatchEvent",function(a){var b=this,c=a.type,d=b.addEventListener.listeners=b.addEventListener.listeners||{},e=d[c]=d[c]||[];try{return b.fireEvent("on"+c,a)}catch(f){return void(e.event&&e.event(a))}}),Object.defineProperty(Window.prototype,"CustomEvent",{get:function(){var a=this;return function(b,c){var d,e=a.document.createEventObject();e.type=b;for(d in c)"cancelable"==d?e.returnValue=!c.cancelable:"bubbles"==d?e.cancelBubble=!c.bubbles:"detail"==d&&(e.detail=c.detail);return e}}}),b.interval=setInterval(b,1),window.addEventListener("load",b)}(),(!this.CustomEvent||"object"==typeof this.CustomEvent)&&function(){this.CustomEvent=function(a,b){var c;b=b||{bubbles:!1,cancelable:!1,detail:void 0};try{c=document.createEvent("CustomEvent"),c.initCustomEvent(a,b.bubbles,b.cancelable,b.detail)}catch(d){c=document.createEvent("Event"),c.initEvent(a,b.bubbles,b.cancelable),c.detail=b.detail}return c}}(),Array.prototype.forEach||(Array.prototype.forEach=function(a,b){"use strict";var c,d;if(null==this)throw new TypeError("this is null or not defined");var e,f=Object(this),g=f.length>>>0;if("[object Function]"!=={}.toString.call(a))throw new TypeError(a+" is not a function");for(arguments.length>=2&&(c=b),d=0;g>d;)d in f&&(e=f[d],a.call(c,e,d,f)),d++}),function(a,b){try{a.querySelector(":scope body")}catch(c){["querySelector","querySelectorAll"].forEach(function(c){var d=b[c];b[c]=function(b){if(/(^|,)\s*:scope/.test(b)){var e=this.id;this.id="ID_"+Date.now(),b=b.replace(/((^|,)\s*):scope/g,"$1#"+this.id);var f=a[c](b);return this.id=e,f}return d.call(this,b)}})}}(window.document,Element.prototype),-1===navigator.appVersion.indexOf("MSIE 8.")&&-1===navigator.appVersion.indexOf("MSIE 9.")&&(Object.assign||Object.defineProperty(Object,"assign",{enumerable:!1,configurable:!0,writable:!0,value:function(a,b){"use strict";if(void 0===a||null===a)throw new TypeError("Cannot convert first argument to object");for(var c=Object(a),d=1;dg;g++){var i=f[g],j=Object.getOwnPropertyDescriptor(e,i);void 0!==j&&j.enumerable&&(c[i]=e[i])}}return c}})),Array.isArray||(Array.isArray=function(a){return"[object Array]"===Object.prototype.toString.call(a)}); \ No newline at end of file diff --git a/package.json b/package.json index 7de5e97..7cdab3b 100644 --- a/package.json +++ b/package.json @@ -1,13 +1,8 @@ { "name": "custombox", "description": "Modal Window Effects with transitions CSS3.", - "version": "3.0.1", - "licenses": [ - { - "type": "MIT", - "url": "http://opensource.org/licenses/MIT" - } - ], + "version": "3.0.2", + "license": "MIT", "homepage": "http://dixso.github.io/custombox/", "bugs": { "url": "https://github.com/dixso/custombox/issues" @@ -21,22 +16,21 @@ ], "devDependencies": { "grunt": "~0.4.5", - "grunt-contrib-connect": "~0.9.0", - "grunt-contrib-watch": "~0.6.1", "grunt-contrib-clean": "~0.6.0", - "grunt-contrib-cssmin": "~0.12.2", - "grunt-contrib-csslint": "~0.4.0", - "grunt-contrib-jshint": "~0.11.0", - "grunt-contrib-uglify": "~0.8.0", - "grunt-autoprefixer": "~2.2.0", - "grunt-replace": "~0.8.0", - "grunt-karma": "~0.10.1", - "karma-jasmine": "~0.3.5", - "karma-firefox-launcher": "~0.1.4", - "karma-chrome-launcher": "~0.1.7", + "grunt-contrib-cssmin": "~0.14.0", + "grunt-contrib-csslint": "~0.5.0", + "grunt-contrib-jshint": "~0.11.3", + "grunt-contrib-uglify": "~0.9.2", + "grunt-autoprefixer": "~3.0.3", + "grunt-replace": "~0.11.0", + "grunt-karma": "~0.12.1", + "karma-jasmine": "~0.3.6", + "karma-firefox-launcher": "~0.1.6", + "karma-chrome-launcher": "~0.2.1", + "grunt-browser-sync": "~2.1.2", "grunt-injector": "~0.6.0", - "grunt-banner": "~0.3.1", - "time-grunt": "~1.1.0", + "grunt-banner": "~0.6.0", + "time-grunt": "~1.2.1", "matchdep": "~0.3.0" } } \ No newline at end of file diff --git a/src/js/custombox.js b/src/js/custombox.js index 6b47a1b..f87b815 100644 --- a/src/js/custombox.js +++ b/src/js/custombox.js @@ -404,6 +404,19 @@ } } + var open = function(listener) { + if ( listener ) { + cb.overlay.removeEventListener('transitionend', open); + } + + // Load target. + _this.load(); + + if ( cb.inline) { + cb.wrapper.classList.add('custombox-modal-open'); + } + }; + if ( cb.settings.overlay ) { if ( _config.overlay.perspective.indexOf(cb.settings.overlayEffect) > -1 || _config.overlay.together.indexOf( cb.settings.overlayEffect ) > -1 ) { // Add class perspective. @@ -412,47 +425,20 @@ cb.overlay.style.opacity = cb.settings.overlayOpacity; } - var open = function() { - cb.overlay.removeEventListener('transitionend', open); - - // Load target. - _this.load(); - - if ( cb.inline) { - cb.wrapper.classList.add('custombox-modal-open'); - } - }; - if ( _this.cb[_this.item].settings.loading ) { - setTimeout(function() { - open(); - }, delay); + setTimeout(open, delay); } else { if ( _config.overlay.together.indexOf( cb.settings.overlayEffect ) > -1 || _config.oldIE ) { - if ( _this.cb[_this.item].settings.loading ) { - setTimeout(function() { - // Load target. - _this.load(); - - if ( cb.inline) { - cb.wrapper.classList.add('custombox-modal-open'); - } - }, delay); - } + open(false); } else { cb.overlay.addEventListener('transitionend', open, false); } } } else { if ( _this.cb[_this.item].settings.loading ) { - setTimeout(function() { - // Load target. - _this.load(); - - if ( cb.inline) { - cb.wrapper.classList.add('custombox-modal-open'); - } - }, delay); + setTimeout(open, delay); + } else { + open(false); } } return _this; diff --git a/src/js/legacy.js b/src/js/legacy.js index 46d52d4..32e77d8 100644 --- a/src/js/legacy.js +++ b/src/js/legacy.js @@ -583,132 +583,152 @@ if (!Array.prototype.indexOf) { } /** - * @license addEventListener polyfill 1.0 / Eirik Backer / MIT Licence - * https://gist.github.com/2864711/946225eb3822c203e8d6218095d888aac5e1748e + * EventListener | CC0 | github.com/jonathantneal/EventListener + * https://github.com/jonathantneal/EventListener */ -(function (window, document, listeners_prop_name) { - if ((!window.addEventListener || !window.removeEventListener) && window.attachEvent && window.detachEvent) { - /** - * @param {*} value - * @return {boolean} - */ - var is_callable = function (value) { - return typeof value === 'function'; - }; - /** - * @param {!Window|HTMLDocument|Node} self - * @param {EventListener|function(!Event):(boolean|undefined)} listener - * @return {!function(Event)|undefined} - */ - var listener_get = function (self, listener) { - var listeners = listener[listeners_prop_name]; - if (listeners) { - var lis; - var i = listeners.length; - while (i--) { - lis = listeners[i]; - if (lis[0] === self) { - return lis[1]; +this.Element && Element.prototype.attachEvent && !Element.prototype.addEventListener && (function () { + function addToPrototype(name, method) { + Window.prototype[name] = HTMLDocument.prototype[name] = Element.prototype[name] = method; + } + + // add + addToPrototype("addEventListener", function (type, listener) { + var + target = this, + listeners = target.addEventListener.listeners = target.addEventListener.listeners || {}, + typeListeners = listeners[type] = listeners[type] || []; + + // if no events exist, attach the listener + if (!typeListeners.length) { + target.attachEvent("on" + type, typeListeners.event = function (event) { + var documentElement = target.document && target.document.documentElement || target.documentElement || { scrollLeft: 0, scrollTop: 0 }; + + // polyfill w3c properties and methods + event.currentTarget = target; + event.pageX = event.clientX + documentElement.scrollLeft; + event.pageY = event.clientY + documentElement.scrollTop; + event.preventDefault = function () { event.returnValue = false }; + event.relatedTarget = event.fromElement || null; + event.stopImmediatePropagation = function () { immediatePropagation = false; event.cancelBubble = true }; + event.stopPropagation = function () { event.cancelBubble = true }; + event.target = event.srcElement || target; + event.timeStamp = +new Date; + + // create an cached list of the master events list (to protect this loop from breaking when an event is removed) + for (var i = 0, typeListenersCache = [].concat(typeListeners), typeListenerCache, immediatePropagation = true; immediatePropagation && (typeListenerCache = typeListenersCache[i]); ++i) { + // check to see if the cached event still exists in the master events list + for (var ii = 0, typeListener; typeListener = typeListeners[ii]; ++ii) { + if (typeListener == typeListenerCache) { + typeListener.call(target, event); + + break; + } } } + }); + } + + // add the event to the master event list + typeListeners.push(listener); + }); + + // remove + addToPrototype("removeEventListener", function (type, listener) { + var + target = this, + listeners = target.addEventListener.listeners = target.addEventListener.listeners || {}, + typeListeners = listeners[type] = listeners[type] || []; + + // remove the newest matching event from the master event list + for (var i = typeListeners.length - 1, typeListener; typeListener = typeListeners[i]; --i) { + if (typeListener == listener) { + typeListeners.splice(i, 1); + + break; } - }; - /** - * @param {!Window|HTMLDocument|Node} self - * @param {EventListener|function(!Event):(boolean|undefined)} listener - * @param {!function(Event)} callback - * @return {!function(Event)} - */ - var listener_set = function (self, listener, callback) { - var listeners = listener[listeners_prop_name] || (listener[listeners_prop_name] = []); - return listener_get(self, listener) || (listeners[listeners.length] = [self, callback], callback); - }; - /** - * @param {string} methodName - */ - var docHijack = function (methodName) { - var old = document[methodName]; - document[methodName] = function (v) { - return addListen(old(v)); - }; - }; - /** - * @this {!Window|HTMLDocument|Node} - * @param {string} type - * @param {EventListener|function(!Event):(boolean|undefined)} listener - * @param {boolean=} useCapture - */ - var addEvent = function (type, listener, useCapture) { - if (is_callable(listener)) { - var self = this; - self.attachEvent( - 'on' + type, - listener_set(self, listener, function (e) { - e = e || window.event; - e.preventDefault = e.preventDefault || function () { e.returnValue = false }; - e.stopPropagation = e.stopPropagation || function () { e.cancelBubble = true }; - e.target = e.target || e.srcElement || document.documentElement; - e.currentTarget = e.currentTarget || self; - e.timeStamp = e.timeStamp || (new Date()).getTime(); - listener.call(self, e); - }) - ); - } - }; - /** - * @this {!Window|HTMLDocument|Node} - * @param {string} type - * @param {EventListener|function(!Event):(boolean|undefined)} listener - * @param {boolean=} useCapture - */ - var removeEvent = function (type, listener, useCapture) { - if (is_callable(listener)) { - var self = this; - var lis = listener_get(self, listener); - if (lis) { - self.detachEvent('on' + type, lis); - } + } + + // if no events exist, detach the listener + if (!typeListeners.length && typeListeners.event) { + target.detachEvent("on" + type, typeListeners.event); + } + }); + + // dispatch + addToPrototype("dispatchEvent", function (eventObject) { + var + target = this, + type = eventObject.type, + listeners = target.addEventListener.listeners = target.addEventListener.listeners || {}, + typeListeners = listeners[type] = listeners[type] || []; + + try { + return target.fireEvent("on" + type, eventObject); + } catch (error) { + if (typeListeners.event) { + typeListeners.event(eventObject); } - }; - /** - * @param {!Node|NodeList|Array} obj - * @return {!Node|NodeList|Array} - */ - var addListen = function (obj) { - var i = obj.length; - if (i) { - while (i--) { - obj[i].addEventListener = addEvent; - obj[i].removeEventListener = removeEvent; + + return; + } + }); + + // CustomEvent + Object.defineProperty(Window.prototype, "CustomEvent", { + get: function () { + var self = this; + + return function CustomEvent(type, eventInitDict) { + var event = self.document.createEventObject(), key; + + event.type = type; + for (key in eventInitDict) { + if (key == 'cancelable'){ + event.returnValue = !eventInitDict.cancelable; + } else if (key == 'bubbles'){ + event.cancelBubble = !eventInitDict.bubbles; + } else if (key == 'detail'){ + event.detail = eventInitDict.detail; + } } - } else { - obj.addEventListener = addEvent; - obj.removeEventListener = removeEvent; - } - return obj; - }; + return event; + }; + } + }); + + // ready + function ready(event) { + if (ready.interval && document.body) { + ready.interval = clearInterval(ready.interval); - addListen([document, window]); - if ('Element' in window) { - /** - * IE8 - */ - var element = window.Element; - element.prototype.addEventListener = addEvent; - element.prototype.removeEventListener = removeEvent; - } else { - /** - * IE < 8 - */ - //Make sure we also init at domReady - document.attachEvent('onreadystatechange', function () { addListen(document.all) }); - docHijack('getElementsByTagName'); - docHijack('getElementById'); - docHijack('createElement'); - addListen(document.all); + document.dispatchEvent(new CustomEvent("DOMContentLoaded")); } } -})(window, document, 'x-ms-event-listeners'); + + ready.interval = setInterval(ready, 1); + + window.addEventListener("load", ready); +})(); + +(!this.CustomEvent || typeof this.CustomEvent === "object") && (function() { + // CustomEvent for browsers which don't natively support the Constructor method + this.CustomEvent = function CustomEvent(type, eventInitDict) { + var event; + eventInitDict = eventInitDict || {bubbles: false, cancelable: false, detail: undefined}; + + try { + event = document.createEvent('CustomEvent'); + event.initCustomEvent(type, eventInitDict.bubbles, eventInitDict.cancelable, eventInitDict.detail); + } catch (error) { + // for browsers which don't support CustomEvent at all, we use a regular event instead + event = document.createEvent('Event'); + event.initEvent(type, eventInitDict.bubbles, eventInitDict.cancelable); + event.detail = eventInitDict.detail; + } + + return event; + }; +})(); // Production steps of ECMA-262, Edition 5, 15.4.4.18 // Reference: http://es5.github.com/#x15.4.4.18