Skip to content

Commit

Permalink
Fix zoom transition performance issues on chrome..
Browse files Browse the repository at this point in the history
  • Loading branch information
sachinchoolur committed Dec 22, 2016
1 parent 6901a84 commit dba206b
Show file tree
Hide file tree
Showing 8 changed files with 37 additions and 24 deletions.
10 changes: 9 additions & 1 deletion dist/css/lightgallery.css
Original file line number Diff line number Diff line change
Expand Up @@ -474,11 +474,19 @@ body:not(.lg-from-hash) .lg-outer.lg-start-zoom .lg-item.lg-complete .lg-object
-webkit-transition-duration: 0s;
transition-duration: 0s;
}
.lg-outer .lg-item.lg-complete.lg-zoomable .lg-img-wrap {
.lg-outer.lg-use-transition-for-zoom .lg-item.lg-complete.lg-zoomable .lg-img-wrap {
-webkit-transition: -webkit-transform 0.3s cubic-bezier(0, 0, 0.25, 1) 0s;
-moz-transition: -moz-transform 0.3s cubic-bezier(0, 0, 0.25, 1) 0s;
-o-transition: -o-transform 0.3s cubic-bezier(0, 0, 0.25, 1) 0s;
transition: transform 0.3s cubic-bezier(0, 0, 0.25, 1) 0s;
}
.lg-outer.lg-use-left-for-zoom .lg-item.lg-complete.lg-zoomable .lg-img-wrap {
-webkit-transition: left 0.3s cubic-bezier(0, 0, 0.25, 1) 0s, top 0.3s cubic-bezier(0, 0, 0.25, 1) 0s;
-moz-transition: left 0.3s cubic-bezier(0, 0, 0.25, 1) 0s, top 0.3s cubic-bezier(0, 0, 0.25, 1) 0s;
-o-transition: left 0.3s cubic-bezier(0, 0, 0.25, 1) 0s, top 0.3s cubic-bezier(0, 0, 0.25, 1) 0s;
transition: left 0.3s cubic-bezier(0, 0, 0.25, 1) 0s, top 0.3s cubic-bezier(0, 0, 0.25, 1) 0s;
}
.lg-outer .lg-item.lg-complete.lg-zoomable .lg-img-wrap {
-webkit-transform: translate3d(0, 0, 0);
transform: translate3d(0, 0, 0);
-webkit-backface-visibility: hidden;
Expand Down
2 changes: 1 addition & 1 deletion dist/css/lightgallery.min.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/js/lightgallery.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**!
* lightgallery.js | 1.0.0 | October 5th 2016
* lightgallery.js | 1.0.1 | December 22nd 2016
* http://sachinchoolur.github.io/lightgallery.js/
* Copyright (c) 2016 Sachin N;
* @license GPLv3
Expand Down
2 changes: 1 addition & 1 deletion dist/js/lightgallery.min.js

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

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "lightgallery.js",
"version": "1.0.0",
"version": "1.0.1",
"description": "Full featured lightbox gallery. Zero dependencies",
"keywords": [
"gallery",
Expand Down
10 changes: 9 additions & 1 deletion src/css/lightgallery.css
Original file line number Diff line number Diff line change
Expand Up @@ -474,11 +474,19 @@ body:not(.lg-from-hash) .lg-outer.lg-start-zoom .lg-item.lg-complete .lg-object
-webkit-transition-duration: 0s;
transition-duration: 0s;
}
.lg-outer .lg-item.lg-complete.lg-zoomable .lg-img-wrap {
.lg-outer.lg-use-transition-for-zoom .lg-item.lg-complete.lg-zoomable .lg-img-wrap {
-webkit-transition: -webkit-transform 0.3s cubic-bezier(0, 0, 0.25, 1) 0s;
-moz-transition: -moz-transform 0.3s cubic-bezier(0, 0, 0.25, 1) 0s;
-o-transition: -o-transform 0.3s cubic-bezier(0, 0, 0.25, 1) 0s;
transition: transform 0.3s cubic-bezier(0, 0, 0.25, 1) 0s;
}
.lg-outer.lg-use-left-for-zoom .lg-item.lg-complete.lg-zoomable .lg-img-wrap {
-webkit-transition: left 0.3s cubic-bezier(0, 0, 0.25, 1) 0s, top 0.3s cubic-bezier(0, 0, 0.25, 1) 0s;
-moz-transition: left 0.3s cubic-bezier(0, 0, 0.25, 1) 0s, top 0.3s cubic-bezier(0, 0, 0.25, 1) 0s;
-o-transition: left 0.3s cubic-bezier(0, 0, 0.25, 1) 0s, top 0.3s cubic-bezier(0, 0, 0.25, 1) 0s;
transition: left 0.3s cubic-bezier(0, 0, 0.25, 1) 0s, top 0.3s cubic-bezier(0, 0, 0.25, 1) 0s;
}
.lg-outer .lg-item.lg-complete.lg-zoomable .lg-img-wrap {
-webkit-transform: translate3d(0, 0, 0);
transform: translate3d(0, 0, 0);
-webkit-backface-visibility: hidden;
Expand Down
15 changes: 14 additions & 1 deletion src/sass/lg-zoom.scss
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,24 @@
}
}
}
&.lg-use-transition-for-zoom {
.lg-item.lg-complete.lg-zoomable {
.lg-img-wrap {
@include transitionCustom(transform $zoom-transition-duration cubic-bezier(0, 0, 0.25, 1) 0s);
}
}
}
&.lg-use-left-for-zoom {
.lg-item.lg-complete.lg-zoomable {
.lg-img-wrap {
@include transitionCustom(left $zoom-transition-duration cubic-bezier(0, 0, 0.25, 1) 0s, top $zoom-transition-duration cubic-bezier(0, 0, 0.25, 1) 0s);
}
}
}

.lg-item.lg-complete.lg-zoomable{

.lg-img-wrap {
@include transitionCustom(left $zoom-transition-duration cubic-bezier(0, 0, 0.25, 1) 0s, top $zoom-transition-duration cubic-bezier(0, 0, 0.25, 1) 0s);
@include translate3d(0, 0, 0);
@include backface-visibility(hidden);
}
Expand Down
18 changes: 1 addition & 17 deletions src/sass/prepros.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@
"f80b85a1": {
"id": "f80b85a1",
"path": "lightgallery.scss",
"output": "/Users/sachin/Public/my/lg/lightgallery.js/lightgallery/css/lightgallery.css",
"output": "C:/wamp/www/lg.js/lightgallery.js/src/css/lightgallery.css",
"name": "lightgallery.scss",
"category": "CSS",
"autoCompile": true,
Expand Down Expand Up @@ -306,22 +306,6 @@
"f80b85a1"
],
"type": "sass"
},
"f2815610": {
"id": "f2815610",
"path": "C:/wamp/www/lightgallery-github/lightGallery/lightgallery/css/lightgallery.css",
"output": "C:/wamp/www/lightgallery-github/lightGallery/lightgallery/css/lightgallery-dist.css",
"name": "lightgallery.css",
"category": "CSS",
"autoCompile": false,
"sourceMaps": false,
"compress": true,
"cssnext": false,
"autoprefixer": false,
"customOutput": false,
"imported": false,
"parents": [],
"type": "css"
}
},
"deploymentHistory": {},
Expand Down

0 comments on commit dba206b

Please sign in to comment.