Use lazySizes globally
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
@@ -8,7 +8,6 @@
|
||||
// Props and variables
|
||||
export let photo
|
||||
export let index
|
||||
export let layout = 'list'
|
||||
let scope
|
||||
|
||||
// Default size for the image
|
||||
@@ -57,7 +56,7 @@
|
||||
<img src="data:image/png;base64,R0lGODlhAQABAAD/ACwAAAAAAQABAAACADs="
|
||||
width={defaultWidth} height={defaultHeight}
|
||||
alt={imgAlt}
|
||||
class:lazyload={layout === 'list'}
|
||||
class="lazyload"
|
||||
/>
|
||||
</picture>
|
||||
</a>
|
||||
|
||||
@@ -5,7 +5,6 @@
|
||||
import { getThumbnail, formatDate } from 'utils/functions'
|
||||
// Dependencies
|
||||
import SwipeListener from 'swipe-listener'
|
||||
import lazySizes from 'lazysizes'
|
||||
// Animations
|
||||
import { animateIn } from 'animations/Carousel'
|
||||
// Components
|
||||
|
||||
@@ -73,12 +73,17 @@
|
||||
locations,
|
||||
pageReady
|
||||
} from 'utils/store'
|
||||
// Components
|
||||
// Dependencies
|
||||
import lazySizes from 'lazysizes'
|
||||
|
||||
// Variables
|
||||
const { page } = stores()
|
||||
let AnalyticsTracker
|
||||
|
||||
// Settings
|
||||
lazySizes.cfg.lazyClass = 'lazyload'
|
||||
|
||||
|
||||
|
||||
/*
|
||||
** Manipulate data
|
||||
|
||||
@@ -32,8 +32,6 @@
|
||||
pageReady
|
||||
} from 'utils/store'
|
||||
import { formatDate, relativeTime, getThumbnail } from 'utils/functions'
|
||||
// Dependencies
|
||||
import lazySizes from 'lazysizes'
|
||||
// Components
|
||||
import IconGlobe from 'atoms/IconGlobe'
|
||||
import IconGlobeSmall from 'atoms/IconGlobeSmall'
|
||||
@@ -184,16 +182,11 @@
|
||||
{#if photos}
|
||||
<div class="photos__view wrap">
|
||||
{#each paginatedPhotos as photo, index}
|
||||
<Photo
|
||||
photo={photo}
|
||||
index={photos.length - photos.indexOf(photo)}
|
||||
layout={layoutSetting}
|
||||
/>
|
||||
<Photo {photo} index={photos.length - photos.indexOf(photo)} />
|
||||
{/each}
|
||||
</div>
|
||||
|
||||
<Pagination
|
||||
{photos} {paginatedPhotos} {photosPerPage}
|
||||
<Pagination {photos} {paginatedPhotos} {photosPerPage}
|
||||
on:updatePagination={updatePagination}
|
||||
/>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user