added masonry to popular page

This commit is contained in:
bill bittner 2017-10-13 09:29:29 -07:00
parent 76a38878ba
commit 9e666945e0
5 changed files with 55 additions and 2 deletions

View file

@ -528,3 +528,13 @@ table {
.wrap-words {
word-wrap: break-word;
}
/* ---- grid items ---- */
.grid-item {
width: calc(30% - 2rem);
padding: 0px;
margin: 1rem;
float: left;
display: block;
}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -0,0 +1,7 @@
<a href="{{this.showUrlLong}}">
{{#ifConditional this.contentType '===' 'video/mp4'}}
<img class="content-list-item-asset grid-item" src="{{this.thumbnail}}"/>
{{else}}
<img class="content-list-item-asset grid-item" src="{{this.directUrlLong}}" />
{{/ifConditional}}
</a>

View file

@ -1,6 +1,26 @@
<div class="row">
<div class="row grid">
{{#each trendingAssets}}
{{> contentListItem}}
{{> gridItem}}
{{/each}}
</div>
<script src="/assets/vendors/masonry/masonry.pkgd.min.js"></script>
<script src="/assets/vendors/imagesloaded/imagesloaded.pkgd.min.js"></script>
<script>
// init masonry with element
var grid = document.querySelector('.grid');
var msnry;
imagesLoaded( grid, function() {
msnry = new Masonry( grid, {
itemSelector: '.grid-item',
columnWidth: 3,
percentPosition: true
});
});
// init with selector
// var msnry = new Masonry( '.grid', {
// // options...
// });
</script>