Skip to content

Commit

Permalink
Merge pull request #352 from be-fe/2.X
Browse files Browse the repository at this point in the history
2.1.5
  • Loading branch information
xieyu33333 committed Mar 19, 2016
2 parents 490a9ef + 140f0ea commit 5b7dc9b
Show file tree
Hide file tree
Showing 21 changed files with 538 additions and 167 deletions.
10 changes: 9 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -665,14 +665,22 @@ S.on('slideChanged', callBack);
#### regPlugin

- Same as the static method "regPlugin"
- ** This method will be registered the plug-in into the iSlider instance,It will add an active list of plug-in automatically when registeration and performs initialization automatically.**
- ** This method will be registered the plug-in into the iSlider instance, It will add an active list of plug-in automatically when registeration and performs initialization automatically.**


#### loadData

- Loading new Datasheets
- Parameters:
- `{Array}` Datasheets
- `{Number}` Index, default: 0


#### pushData

- Add scenes to the end of the data datasheets
- Parameters:
- `{Array|Object}` A member or additional datasheets


#### subjectTo
Expand Down
8 changes: 8 additions & 0 deletions README_Chinese.md
Original file line number Diff line number Diff line change
Expand Up @@ -673,6 +673,14 @@ S.on('slideChanged', callBack);
- 载入新的数据列表
- 参数:
- `{Array}` 数据列表
- `{Number}` 初始场景索引


#### pushData

- 追加数据到已有的数据序列末尾
- 参数:
- `{Array|Object}` 一个成员或者追加的序列(数组)


#### subjectTo
Expand Down
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,5 +41,5 @@
"index.html",
"gulp"
],
"version": "2.1.4"
"version": "2.1.5"
}
41 changes: 20 additions & 21 deletions build/iSlider.animate.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
}
}

this.wrap.style.webkitPerspective = scale * 4;
iSlider.setStyle(this.wrap, 'perspective', scale * 4);

dom.style.visibility = 'visible';
if (direct > 0 && i === 2) {
Expand All @@ -47,13 +47,13 @@
}
dom.style.zIndex = i === 1 ? 1 : 0;

dom.style.cssText += '-webkit-backface-visibility:hidden; -webkit-transform-style:preserve-3d; position:absolute;';
dom.style.cssText += iSlider.styleProp('backface-visibility') + ':hidden;' + iSlider.styleProp('transform-style') + ':preserve-3d;' + 'position:absolute;';

// TODO: overflow... I dont understand why there are many differences between ios and desktop. Maybe they have different interpretations of Perspective
// dom.style.webkitTransform = 'rotate' + rotateDirect + '(' + 0.9153 * 90 * (offset / scale + i - 1) + 'deg) translateZ(' + ( scale / 2) + 'px) scale(0.875)';
dom.style.webkitTransform = 'rotate' + rotateDirect + '(' + 90 * (offset / scale + i - 1) + 'deg) translateZ(' + (0.889 * scale / 2) + 'px) scale(0.889)';
iSlider.setStyle(dom, 'transform', 'rotate' + rotateDirect + '(' + 90 * (offset / scale + i - 1) + 'deg) translateZ(' + (0.889 * scale / 2) + 'px) scale(0.889)');
}

rotate.effect = 'transform';
rotate.effect = iSlider.styleProp('transform');
rotate.reverse = true;
return rotate;
})(),
Expand All @@ -63,7 +63,8 @@
if (this.isVertical) {
offset = -offset;
}
this.wrap.style.webkitPerspective = scale * 4;

iSlider.setStyle(this.wrap, 'perspective', scale * 4);

dom.style.visibility = 'visible';
if (direct > 0 && i === 2) {
Expand All @@ -73,24 +74,24 @@
dom.style.visibility = 'hidden';
}

dom.style.cssText += 'position:absolute; -webkit-backface-visibility:hidden;';
dom.style.webkitTransform = 'translateZ(' + (scale / 2) + 'px) rotate' + ((axis === 'X') ? 'Y' : 'X') + '(' + 180 * (offset / scale + i - 1) + 'deg) scale(0.875)';
dom.style.cssText += 'position:absolute;' + iSlider.styleProp('backface-visibility') + ':hidden';
iSlider.setStyle(dom, 'transform', 'translateZ(' + (scale / 2) + 'px) rotate' + ((axis === 'X') ? 'Y' : 'X') + '(' + 180 * (offset / scale + i - 1) + 'deg) scale(0.875)');
}

flip.effect = 'transform';
flip.effect = iSlider.styleProp('transform');
flip.reverse = true;
return flip;
})(),
depth: (function () {

function depth(dom, axis, scale, i, offset, direct) {
var zoomScale = (4 - Math.abs(i - 1)) * 0.18;
this.wrap.style.webkitPerspective = scale * 4;
iSlider.setStyle(this.wrap, 'perspective', scale * 4);
dom.style.zIndex = i === 1 ? 1 : 0;
dom.style.webkitTransform = 'scale(' + zoomScale + ') translateZ(0) translate' + axis + '(' + (offset + 1.3 * scale * (i - 1)) + 'px)';
iSlider.setStyle(dom, 'transform', 'scale(' + zoomScale + ') translateZ(0) translate' + axis + '(' + (offset + 1.3 * scale * (i - 1)) + 'px)');
}

depth.effect = 'transform';
depth.effect = iSlider.styleProp('transform');
return depth;
})(),
flow: (function () {
Expand All @@ -100,7 +101,7 @@
var directAmend = (axis === 'X') ? 1 : -1;
var offsetRatio = Math.abs(offset / scale);

this.wrap.style.webkitPerspective = scale * 4;
iSlider.setStyle(this.wrap, 'perspective', scale * 4);

if (i === 1) {
dom.style.zIndex = scale - absoluteOffset;
Expand All @@ -109,10 +110,10 @@
dom.style.zIndex = (offset > 0) ? (1 - i) * absoluteOffset : (i - 1) * absoluteOffset;
}

dom.style.webkitTransform = 'scale(0.7, 0.7) translateZ(' + (offsetRatio * 150 - 150) * Math.abs(i - 1) + 'px)' + 'translate' + axis + '(' + (offset + scale * (i - 1)) + 'px)' + 'rotate' + rotateDirect + '(' + directAmend * (30 - offsetRatio * 30) * (1 - i) + 'deg)';
iSlider.setStyle(dom, 'transform', 'scale(0.7, 0.7) translateZ(' + (offsetRatio * 150 - 150) * Math.abs(i - 1) + 'px)' + 'translate' + axis + '(' + (offset + scale * (i - 1)) + 'px)' + 'rotate' + rotateDirect + '(' + directAmend * (30 - offsetRatio * 30) * (1 - i) + 'deg)');
}

flow.effect = 'transform';
flow.effect = iSlider.styleProp('transform');
return flow;
})(),
card: (function () {
Expand All @@ -135,10 +136,10 @@
}
}
dom.style.zIndex = z;
dom.style.webkitTransform = 'scale(' + zoomScale + ') translateZ(0) translate' + axis + '(' + ((1 + Math.abs(i - 1) * 0.2) * offset + scale * (i - 1)) + 'px)';
iSlider.setStyle(dom, 'transform', 'scale(' + zoomScale + ') translateZ(0) translate' + axis + '(' + ((1 + Math.abs(i - 1) * 0.2) * offset + scale * (i - 1)) + 'px)');
}

card.effect = 'transform';
card.effect = iSlider.styleProp('transform');
return card;
})(),
fade: (function () {
Expand Down Expand Up @@ -168,7 +169,7 @@
o = oa < 1 ? oa : 1;
s = 2 - (0.5 * oa);
z = 2;
var at = parseInt(window.getComputedStyle(dom).transitionDuration) * 1000;
var at = parseInt(window.getComputedStyle(dom)[iSlider.styleProp('transitionDuration', 1)]) * 1000;
if (at > 0) {
lsn = window.setTimeout(function () {
dom.style.zIndex = 0;
Expand All @@ -186,11 +187,9 @@
z = 0;
break;
}
dom.style.cssText += 'z-index:' + z + ';opacity:' + o + ';-webkit-transform: scale(' + s + ');';
dom.style.cssText += 'z-index:' + z + ';opacity:' + o + ';' + iSlider.styleProp('transform') + ':scale(' + s + ');';
}

//what.effect = 'all';
//what.effect = 'transform,opacity';
zoomout.reverse = true;
return zoomout;
})()
Expand Down
2 changes: 1 addition & 1 deletion build/iSlider.animate.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 10 additions & 0 deletions build/iSlider.css
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,13 @@
height: 100%;
list-style: none;
overflow: hidden;
display: -moz-box;
display: -webkit-box;
display: box;
-moz-box-pack: center;
-webkit-box-pack: center;
box-pack: center;
-moz-box-align: center;
-webkit-box-align: center;
box-align: center;
}
Expand Down Expand Up @@ -88,11 +92,17 @@

.islider-btn-outer.left > .islider-btn-inner {
-webkit-transform: rotate(-45deg);
-moz-transform: rotate(-45deg);
-ms-transform: rotate(-45deg);
-o-transform: rotate(-45deg);
transform: rotate(-45deg);
}

.islider-btn-outer.right > .islider-btn-inner {
-webkit-transform: rotate(135deg);
-moz-transform: rotate(135deg);
-ms-transform: rotate(135deg);
-o-transform: rotate(135deg);
transform: rotate(135deg);
}

Expand Down
Loading

0 comments on commit 5b7dc9b

Please sign in to comment.