Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
18 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,15 @@ | ||
import "lazysizes"; | ||
import map from "./map.js"; | ||
import tabsWithCards from "./tabs-with-cards.js"; | ||
import bookmarkButtons from "./bookmark-buttons.js"; | ||
import dropdownButton from "./dropdown-button.js"; | ||
import searchFilters from "./search-filters.js"; | ||
import lazyLoadImages from "./lazy-load-images.js"; | ||
|
||
document.addEventListener("DOMContentLoaded", () => { | ||
map.init(); | ||
tabsWithCards.init(); | ||
bookmarkButtons.init(); | ||
dropdownButton.init(); | ||
searchFilters.init(); | ||
|
||
document.addEventListener("lazybeforeunveil", e => { | ||
const bgUrl = e.target.getAttribute("data-bg"); | ||
if (bgUrl) { | ||
e.target.style.backgroundImage = `url(${bgUrl})`; | ||
} | ||
}); | ||
lazyLoadImages.init(); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import "lazysizes"; | ||
|
||
const lazyLoadImages = { | ||
init() { | ||
document.addEventListener("lazybeforeunveil", e => { | ||
const bgUrl = e.target.getAttribute("data-bg"); | ||
if (bgUrl) { | ||
e.target.style.backgroundImage = `url(${bgUrl})`; | ||
} | ||
}); | ||
} | ||
} | ||
|
||
export default lazyLoadImages; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,11 @@ | ||
import tabsWithCards from "./tabs-with-cards.js"; | ||
import bookmarkButtons from "./bookmark-buttons.js"; | ||
import dropdownButton from "./dropdown-button.js"; | ||
import lazyLoadImages from "./lazy-load-images.js"; | ||
|
||
document.addEventListener("DOMContentLoaded", () => { | ||
tabsWithCards.init(); | ||
bookmarkButtons.init(); | ||
dropdownButton.init(); | ||
lazyLoadImages.init(); | ||
}); |