2017-07-21 13:40:01 -07:00
|
|
|
<script src="/vendors/masonry/masonry.pkgd.min.js"></script>
|
|
|
|
|
2017-07-11 16:55:03 -07:00
|
|
|
<div class="full">
|
|
|
|
<h2>Trending</h2>
|
2017-07-21 13:40:01 -07:00
|
|
|
<div class="grid" data-masonry='{ "itemSelector": ".grid-item" }'>
|
|
|
|
{{#each trendingAssets}}
|
|
|
|
{{#unless this.nsfw}}
|
2017-08-01 18:58:13 -07:00
|
|
|
<a href="/{{this.claimId}}/{{this.name}}">
|
2017-07-20 10:15:20 -07:00
|
|
|
{{#ifConditional this.fileType '===' 'video/mp4'}}
|
2017-07-28 14:39:39 -07:00
|
|
|
<video class="grid-item trending-video" controls onloadeddata="resetTrendingLayout()">
|
2017-07-27 20:04:22 -07:00
|
|
|
<source src="/media/{{this.fileName}}" >
|
2017-07-20 10:15:20 -07:00
|
|
|
{{!--fallback--}}
|
|
|
|
Your browser does not support the <code>video</code> element.
|
|
|
|
</video>
|
|
|
|
{{else}}
|
2017-07-28 14:39:39 -07:00
|
|
|
<img class="grid-item trending-image" src="/media/{{this.fileName}}" onload="resetTrendingLayout()"/>
|
2017-07-20 10:15:20 -07:00
|
|
|
{{/ifConditional}}
|
|
|
|
</a>
|
2017-07-21 13:40:01 -07:00
|
|
|
{{/unless}}
|
2017-07-27 20:04:22 -07:00
|
|
|
|
2017-07-20 10:15:20 -07:00
|
|
|
{{/each}}
|
2017-07-21 13:40:01 -07:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
2017-07-27 20:04:22 -07:00
|
|
|
|
2017-07-21 13:40:01 -07:00
|
|
|
<script>
|
|
|
|
var elem = document.querySelector('.grid');
|
|
|
|
var msnry = new Masonry( elem, {
|
|
|
|
itemSelector: '.grid-item'
|
|
|
|
});
|
2017-07-27 20:04:22 -07:00
|
|
|
|
2017-07-28 14:39:39 -07:00
|
|
|
function resetTrendingLayout() {
|
2017-07-27 20:04:22 -07:00
|
|
|
msnry.layout();
|
2017-07-21 13:40:01 -07:00
|
|
|
}
|
2017-07-27 20:04:22 -07:00
|
|
|
</script>
|
|
|
|
|