Improve homepage image loading
This commit is contained in:
parent
4b8e481503
commit
10b91f5a64
17
index.html
17
index.html
@ -60,7 +60,7 @@ uses:
|
|||||||
<div class="col-sm-4 project-item">
|
<div class="col-sm-4 project-item">
|
||||||
<div class="card home-project">
|
<div class="card home-project">
|
||||||
{% if project.hero %}
|
{% if project.hero %}
|
||||||
<img src="{{project.hero.img_src}}" class="card-img-top" alt="">
|
<img src="{{project.hero.img_src}}" class="card-img-top" alt="" loading="lazy">
|
||||||
{% endif %}
|
{% endif %}
|
||||||
<div class="card-body">
|
<div class="card-body">
|
||||||
<h5 class="card-title"><strong>{{project.title}}</strong></h5>
|
<h5 class="card-title"><strong>{{project.title}}</strong></h5>
|
||||||
@ -82,12 +82,6 @@ uses:
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- <div class="home-third-panel">
|
|
||||||
<div class="inner-content-container home-content container">
|
|
||||||
|
|
||||||
</div>
|
|
||||||
</div> -->
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- Xss warning -->
|
<!-- Xss warning -->
|
||||||
@ -102,12 +96,21 @@ uses:
|
|||||||
|
|
||||||
<!-- Project grid -->
|
<!-- Project grid -->
|
||||||
<script>
|
<script>
|
||||||
|
|
||||||
|
function orderProjectGrid() {
|
||||||
$('#project-grid').masonry({
|
$('#project-grid').masonry({
|
||||||
// options
|
// options
|
||||||
itemSelector: '.project-item',
|
itemSelector: '.project-item',
|
||||||
// columnWidth: 500,
|
// columnWidth: 500,
|
||||||
transitionDuration: '0s'
|
transitionDuration: '0s'
|
||||||
});
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
// Do a primary order call
|
||||||
|
orderProjectGrid();
|
||||||
|
|
||||||
|
// re-order in 2 seconds in case anything was still lazy-loading
|
||||||
|
setTimeout(orderProjectGrid, 2000);
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
</body>
|
</body>
|
Loading…
x
Reference in New Issue
Block a user