Added integration with Justified Gallery (#183)

This commit is contained in:
Ilya Yakubovich 2016-08-23 10:10:33 +08:00 committed by Ruipeng Zhang
parent 28eceaa527
commit 18a0f3cf6d
6 changed files with 35 additions and 2 deletions

View File

@ -44,6 +44,10 @@ Icarus uses [lightgallery.js](https://sachinchoolur.github.io/lightgallery.js/)
![](http://ppoffice.github.io/hexo-theme-icarus/gallery/lightgallery.jpg "")
### Justified Gallery
You can also use [justifiedgallery.js](http://miromannino.github.io/Justified-Gallery/) to display a photo grid within your posts. Just enable it in your configuration, and place your photos in a div with the class .justified-gallery
### Sidebar
Icarus provides 6 built-in widgets:

View File

@ -60,6 +60,7 @@ share: default # options: jiathis, bdshare, addtoany, default
# Plugins
plugins:
lightgallery: true # options: true, false
justified-gallery: true # options: true, false
google_analytics: # enter the tracking ID for your Google Analytics
google_site_verification: # enter Google site verification code
baidu_analytics: # enter Baidu Analytics hash key

View File

@ -2,6 +2,9 @@
<% if (theme.plugins.lightgallery) { %>
<%- css('vendor/lightgallery/css/lightgallery.min') %>
<% } %>
<% if (theme.plugins.justifiedgallery) { %>
<%- css('vendor/justified-gallery/justifiedGallery.min.css') %>
<% } %>
<% if (theme.plugins.google_analytics) { %>
<%- partial('plugin/google-analytics') %>
<% } %>
@ -23,4 +26,7 @@
<%- js('vendor/lightgallery/js/lg-share.min') %>
<%- js('vendor/lightgallery/js/lg-video.min') %>
<% } %>
<% } %>
<% if (theme.plugins.justifiedgallery) { %>
<%- js('vendor/justified-gallery/jquery.justifiedGallery.min.js') %>
<% } %>
<% } %>

View File

@ -18,6 +18,14 @@
lightGallery($('.article-entry')[0], options);
lightGallery($('.article-gallery')[0], options);
}
if (!!$.prototype.justifiedGallery) { // if justifiedGallery method is defined
var options = {
rowHeight: 140,
margins: 4,
lastRow: 'justify'
};
$('.justified-gallery').justifiedGallery(options);
}
// Profile card
$(document).on('click', function () {
@ -48,4 +56,4 @@
});
}
})(jQuery);
})(jQuery);

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,7 @@
/*!
* Justified Gallery - v3.6.1
* http://miromannino.github.io/Justified-Gallery/
* Copyright (c) 2015 Miro Mannino
* Licensed under the MIT license.
*/
@-webkit-keyframes justified-gallery-show-caption-animation{from{opacity:0}to{opacity:.7}}@-moz-keyframes justified-gallery-show-caption-animation{from{opacity:0}to{opacity:.7}}@-o-keyframes justified-gallery-show-caption-animation{from{opacity:0}to{opacity:.7}}@keyframes justified-gallery-show-caption-animation{from{opacity:0}to{opacity:.7}}@-webkit-keyframes justified-gallery-show-entry-animation{from{opacity:0}to{opacity:1}}@-moz-keyframes justified-gallery-show-entry-animation{from{opacity:0}to{opacity:1}}@-o-keyframes justified-gallery-show-entry-animation{from{opacity:0}to{opacity:1}}@keyframes justified-gallery-show-entry-animation{from{opacity:0}to{opacity:1}}.justified-gallery{width:100%;position:relative;overflow:hidden}.justified-gallery>a,.justified-gallery>div{position:absolute;display:inline-block;overflow:hidden;opacity:0;filter:alpha(opacity=0)}.justified-gallery>a>img,.justified-gallery>div>img,.justified-gallery>a>a>img,.justified-gallery>div>a>img{position:absolute;top:50%;left:50%;margin:0;padding:0;border:0}.justified-gallery>a>.caption,.justified-gallery>div>.caption{display:none;position:absolute;bottom:0;padding:5px;background-color:#000;left:0;right:0;margin:0;color:#fff;font-size:12px;font-weight:300;font-family:sans-serif}.justified-gallery>a>.caption.caption-visible,.justified-gallery>div>.caption.caption-visible{display:initial;opacity:.7;filter:"alpha(opacity=70)";-webkit-animation:justified-gallery-show-caption-animation 500ms 0 ease;-moz-animation:justified-gallery-show-caption-animation 500ms 0 ease;-ms-animation:justified-gallery-show-caption-animation 500ms 0 ease}.justified-gallery>.entry-visible{opacity:1;filter:alpha(opacity=100);-webkit-animation:justified-gallery-show-entry-animation 500ms 0 ease;-moz-animation:justified-gallery-show-entry-animation 500ms 0 ease;-ms-animation:justified-gallery-show-entry-animation 500ms 0 ease}.justified-gallery>.jg-filtered{display:none}.justified-gallery>.spinner{position:absolute;bottom:0;margin-left:-24px;padding:10px 0;left:50%;opacity:initial;filter:initial;overflow:initial}.justified-gallery>.spinner>span{display:inline-block;opacity:0;filter:alpha(opacity=0);width:8px;height:8px;margin:0 4px;background-color:#000;border-top-left-radius:6px;border-top-right-radius:6px;border-bottom-right-radius:6px;border-bottom-left-radius:6px}