From 78af1be68d6b30da2ca2d40505845fb47614d93e Mon Sep 17 00:00:00 2001 From: Joshvdw Date: Sat, 7 Dec 2024 12:12:51 +1300 Subject: [PATCH] re enabled custom code load src --- js/global/projectLotties.js | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/js/global/projectLotties.js b/js/global/projectLotties.js index a6ed544..29cbc83 100755 --- a/js/global/projectLotties.js +++ b/js/global/projectLotties.js @@ -3,22 +3,22 @@ export default function initProjectLotties() { // check if lottie players exist if (document.querySelectorAll('lottie-player').length > 0) { // create array with all lotie players - // var allLotties = [...document.querySelectorAll('lottie-player')] - // //var allLottiesHover = document.querySelectorAll('.hover-lottie-wrapper') + var allLotties = [...document.querySelectorAll('lottie-player')] + //var allLottiesHover = document.querySelectorAll('.hover-lottie-wrapper') - // let isMobile = window.innerWidth < 428 + let isMobile = window.innerWidth < 428 - // // create new array from lotties if it doesn't have a source attribute - // allLotties = allLotties.filter( l => !l.hasAttribute('src')) + // create new array from lotties if it doesn't have a source attribute + allLotties = allLotties.filter( l => !l.hasAttribute('src')) - // allLotties.forEach( e => { - // // get source based to mobile or desktop based on mobile / screen width - // let source = isMobile ? e.getAttribute('mobile-source') : e.getAttribute('desktop-source') - // // if source is not empty, load the source into each lottie player - // if(source != ''){ - // e.load(source) - // } - // }) + allLotties.forEach( e => { + // get source based to mobile or desktop based on mobile / screen width + let source = isMobile ? e.getAttribute('mobile-source') : e.getAttribute('desktop-source') + // if source is not empty, load the source into each lottie player + if(source != ''){ + e.load(source) + } + }) // remove safari placeholder document.querySelectorAll('.safari-image').forEach(e => {