Reduced attr changes to improve performance

This commit is contained in:
Tobias Reich 2015-03-29 19:22:39 +02:00
parent a0c71edf64
commit 6aba10bea4
8 changed files with 40 additions and 28 deletions

BIN
dist/main.css vendored

Binary file not shown.

BIN
dist/main.js vendored

Binary file not shown.

View File

@ -34,10 +34,7 @@ album.load = function(albumID, refresh) {
password.get(albumID, function() {
if (!refresh) {
lychee.animate('.album, .photo', 'contentZoomOut');
lychee.animate('#content .divider', 'fadeOut');
}
if (!refresh) lychee.animate('#content', 'contentZoomOut');
startTime = new Date().getTime();
@ -82,7 +79,7 @@ album.load = function(albumID, refresh) {
view.album.init();
if (!refresh) {
lychee.animate('.album, .photo', 'contentZoomIn');
lychee.animate('#content', 'contentZoomIn');
header.setMode('album');
}

View File

@ -15,8 +15,7 @@ albums.load = function() {
durationTime,
waitTime;
lychee.animate('.album, .photo', 'contentZoomOut');
lychee.animate('#content .divider', 'fadeOut');
lychee.animate('#content', 'contentZoomOut');
startTime = new Date().getTime();
@ -41,7 +40,7 @@ albums.load = function() {
setTimeout(function() {
header.setMode('albums');
view.albums.init();
lychee.animate('.album', 'contentZoomIn');
lychee.animate('#content', 'contentZoomIn');
}, waitTime);
});
@ -50,7 +49,7 @@ albums.load = function() {
setTimeout(function() {
header.setMode('albums');
view.albums.init();
lychee.animate('.album, .photo', 'contentZoomIn');
lychee.animate('#content', 'contentZoomIn');
}, 300);
}

View File

@ -53,8 +53,7 @@ search.find = function(term) {
$('.no_content').remove();
lychee.animate('.album, .photo', 'contentZoomOut');
lychee.animate('.divider', 'fadeOut');
lychee.animate('#content', 'contentZoomOut');
search.hash = data.hash;
@ -65,7 +64,7 @@ search.find = function(term) {
$('body').append(build.no_content('magnifying-glass'));
} else {
lychee.content.html(html);
lychee.animate('.album, .photo', 'contentZoomIn');
lychee.animate('#content', 'contentZoomIn');
$('img[data-type!="svg"]').retina();
}

View File

@ -7,27 +7,13 @@
animation-name: fadeIn;
animation-duration: .3s;
animation-fill-mode: forwards;
animation-timing-function: $timingBounce;
animation-timing-function: $timing;
}
.fadeOut {
animation-name: fadeOut;
animation-duration: .3s;
animation-fill-mode: forwards;
animation-timing-function: $timingBounce;
}
.contentZoomIn {
animation-name: zoomIn;
animation-duration: .2s;
animation-fill-mode: forwards;
animation-timing-function: $timing;
}
.contentZoomOut {
animation-name: zoomOut;
animation-duration: .2s;
animation-fill-mode: forwards;
animation-timing-function: $timing;
}

View File

@ -20,6 +20,37 @@
&.sidebar { width: calc(100% - 300px); }
/* Animations ------------------------------------------------------------------- */
&.contentZoomIn .album,
&.contentZoomIn .photo {
animation-name: zoomIn;
animation-duration: .2s;
animation-fill-mode: forwards;
animation-timing-function: $timing;
}
&.contentZoomIn .divider {
animation-name: fadeIn;
animation-duration: .2s;
animation-fill-mode: forwards;
animation-timing-function: $timing;
}
&.contentZoomOut .album,
&.contentZoomOut .photo {
animation-name: zoomOut;
animation-duration: .2s;
animation-fill-mode: forwards;
animation-timing-function: $timing;
}
&.contentZoomOut .divider {
animation-name: fadeOut;
animation-duration: .3s;
animation-fill-mode: forwards;
animation-timing-function: $timing;
}
/* Albums and Photos ------------------------------------------------*/
.album,
.photo {

View File

@ -12,7 +12,7 @@
background-color: rgba(25, 25, 25, .98);
border-left: 1px solid black(.2);
transform: translateX(0);
transition: transform .3s $timingBounce;
transition: transform .3s $timing;
&.active { transform: translateX(-320px); }