partial
diff --git a/gulpfile.js b/gulpfile.js index 0ea4eff..829a183 100644 --- a/gulpfile.js +++ b/gulpfile.js
@@ -13,8 +13,8 @@ var jshint = require('gulp-jshint'); gulp.task('gzipFile', function(){ - //gulp.src('demo/perricorn/data.js') - gulp.src('build/player/bodymovin.js') + gulp.src('demo/bocas/data.js') + //gulp.src('build/player/bodymovin.js') .pipe(gzip({ append: false })) .pipe(gulp.dest('demo/')); });
diff --git a/player/index.html b/player/index.html index b134aec..9b3d65c 100644 --- a/player/index.html +++ b/player/index.html
@@ -36,6 +36,6 @@ <!-- endbuild --> </head> <body style="background-color:#ccc; margin: 0px;height: 100%; font-family: sans-serif;font-size: 10px"> -<div style="width:1200px;height:600px;background-color:#333;display:inline-block" class="bodymovin" data-bm-path="exports/bm" data-bm-type="canvas" data-bm-loop="true" data-bm-prerender="false"></div> +<div style="width:800px;height:800px;background-color:#333;display:inline-block" class="bodymovin" data-bm-path="exports/gabriel/navidad" data-bm-type="svg" data-bm-loop="true" data-bm-prerender="false"></div> </body> </html>
diff --git a/player/js/elements/BaseElement.js b/player/js/elements/BaseElement.js index 26f216a..b1a5545 100644 --- a/player/js/elements/BaseElement.js +++ b/player/js/elements/BaseElement.js
@@ -26,7 +26,19 @@ }; BaseElement.prototype.createElements = function(){ - if(this.data.hasMask){ + if(this.data.td){ + this.layerElement = document.createElementNS(svgNS,'mask'); + this.layerElement.setAttribute('id',this.layerId); + if(this.data.td == 3){ + this.layerElement.setAttribute('mask-type','luminance'); + }else{ + this.layerElement.setAttribute('mask-type','alpha'); + } + this.globalData.defs.appendChild(this.layerElement); + if(this.data.hasMask){ + this.maskedElement = this.layerElement; + } + }else if(this.data.hasMask){ this.layerElement = document.createElementNS(svgNS,'g'); if(this.data.tt){ this.matteElement = document.createElementNS(svgNS,'g'); @@ -36,15 +48,6 @@ this.parentContainer.appendChild(this.layerElement); } this.maskedElement = this.layerElement; - }else if(this.data.td){ - this.layerElement = document.createElementNS(svgNS,'mask'); - this.layerElement.setAttribute('id',this.layerId); - if(this.data.td == 3){ - this.layerElement.setAttribute('mask-type','luminance'); - }else{ - this.layerElement.setAttribute('mask-type','alpha'); - } - this.globalData.defs.appendChild(this.layerElement); }else if(this.data.tt){ this.matteElement = document.createElementNS(svgNS,'g'); this.matteElement.setAttribute('id',this.layerId);