Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Slow preview animation #64

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion resources/css/gallery.css

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

19 changes: 19 additions & 0 deletions resources/css/gallery.less
Original file line number Diff line number Diff line change
Expand Up @@ -260,6 +260,25 @@ body{
margin-top:5px;
}

@-webkit-keyframes fadein{
0% {
opacity: 0;
}
100% {
opacity: 1;
}
}

.blueimp-gallery > .slides > .slide-loading {
background-image: none;
// this class with a loader is a bit strange
}

.blueimp-gallery .blueimp-gallery-display, .blueimp-gallery > .slides > .slide {
animation: fadein 0.57s linear 1 normal forwards;
-webkit-animation: fadein 0.57s linear 1 normal forwards;
}

@media (max-width: 319px) {
#gallery-container {
#gallery-list {
Expand Down
7 changes: 7 additions & 0 deletions resources/js/gallery.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,13 @@ humhub.module('gallery', function (module, require, $) {
});
};

$('#gallery-media-container .panel-body').one('click', function() {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note that the gallery.js is only loaded once, so this event handler won't be attached when leaving and reentering the gallery view. Such handlers should be attached within the init function.

Copy link
Contributor Author

@UtmostCreator UtmostCreator Aug 28, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, thank you, @buddh4!

Yeah, for sure, you are right!
I will fix it (by moving this part to init function) today a bit later.

var $slides = $('.blueimp-gallery .slides');
$slides.css({'opacity': 0.1});
$slides.fadeTo(2450, 1);
$('#gallery-media-container .panel-body').off();
});

module.export({
init: init,
initOnPjaxLoad: true,
Expand Down