window._nslDOMReady = (function () {
const executedCallbacks = new Set();
return function (callback) {
/**
* Third parties might dispatch DOMContentLoaded events, so we need to ensure that we only run our callback once!
*/
if (executedCallbacks.has(callback)) return;
const wrappedCallback = function () {
if (executedCallbacks.has(callback)) return;
executedCallbacks.add(callback);
callback();
};
if (document.readyState === "complete" || document.readyState === "interactive") {
wrappedCallback();
} else {
document.addEventListener("DOMContentLoaded", wrappedCallback);
}
};
})();
var map_cookiebar_settings = {"logged_in_and_admin":"","verbose_remote_log":"","internal_debug":"","notify_div_id":"#my-agile-privacy-notification-area","showagain_tab":"1","notify_position_horizontal":"left","showagain_div_id":"my-agile-privacy-consent-again","blocked_content_text":"Attenzione: alcune funzionalit\u00e0 di questa pagina potrebbero essere bloccate a seguito delle tue scelte privacy.","inline_notify_color":"#444444","inline_notify_background":"#fff3cd","blocked_content_notify_auto_shutdown_time":"3000","scan_mode":"config_finished","cookie_reset_timestamp":null,"show_ntf_bar_on_not_yet_consent_choice":"","enable_microsoft_cmode":"","enable_clarity_cmode":"","enable_cmode_v2":"1","enable_cmode_url_passthrough":"","cmode_v2_forced_off_ga4_advanced":"","map_notify_title":"0","map_first_layer_branded":"0","plugin_version":"3.3.1","parse_config_version_number":"1.3.60"};
var map_ajax = {"ajax_url":"https://www.lavagneluminose.info/wp-admin/admin-ajax.php","api_url":"https://www.lavagneluminose.info/wp-content/plugins/myagileprivacy/api/api.php","security":"b154b4d931","force_js_learning_mode":"0","scanner_compatibility_mode":"","cookie_process_delayed_mode":"0"};
//# sourceURL=my-agile-privacy-js-extra
var wc_single_product_params = {"i18n_required_rating_text":"Seleziona una valutazione","i18n_rating_options":["1 stella su 5","2 stelle su 5","3 stelle su 5","4 stelle su 5","5 stelle su 5"],"i18n_product_gallery_trigger_text":"Visualizza la galleria di immagini a schermo intero","review_rating_required":"yes","flexslider":{"rtl":false,"animation":"slide","smoothHeight":true,"directionNav":false,"controlNav":"thumbnails","slideshow":false,"animationSpeed":500,"animationLoop":false,"allowOneSlide":false,"touch":false},"zoom_enabled":"1","zoom_options":[],"photoswipe_enabled":"1","photoswipe_options":{"shareEl":false,"closeOnScroll":false,"history":false,"hideAnimationDuration":0,"showAnimationDuration":0},"flexslider_enabled":"1"};
//# sourceURL=wc-single-product-js-extra
Google Analytics è un servizio di analisi web fornito da Google Ireland Limited (“Google”). Google utilizza i dati personali raccolti per tracciare ed esaminare l’uso di questo sito web, compilare report sulle sue attività e condividerli con gli altri servizi sviluppati da Google. Google può utilizzare i tuoi dati personali per contestualizzare e personalizzare gli annunci del proprio network pubblicitario. Questa integrazione di Google Analytics rende anonimo il tuo indirizzo IP. I dati inviati vengono collezionati per gli scopi di personalizzazione dell'esperienza e il tracciamento statistico. Trovi maggiori informazioni alla pagina "Ulteriori informazioni sulla modalità di trattamento delle informazioni personali da parte di Google".
Facebook Remarketing è un servizio di Remarketing e Behavioral Targeting fornito da Facebook Ireland Ltd. Questo servizio è usato per collegare l'attività di questo sito web con il network di advertising Facebook.
Gravatar è un servizio di visualizzazione di immagini gestito da Automattic Inc. che permette a Automattic Inc. di integrare tali contenuti all’interno delle proprie pagine.
/* Cerca l'icona della "X" dentro il modulo di ricerca di Oxygen
e le aggiunge di forza la scritta per i non vedenti. */
setTimeout(function(){
jQuery('.oxy-search-form-close').attr('aria-label', 'Chiudi form di ricerca');
}, 500);
function toggleAiChat() {
var container = document.getElementById('ai-widget-container');
var trigger = document.getElementById('ai-widget-trigger');
if (container.style.display === 'none' || container.style.display === '') {
container.style.display = 'block';
trigger.style.transform = 'rotate(90deg)';
} else {
container.style.display = 'none';
trigger.style.transform = 'rotate(0deg)';
}
}
var aws_vars = {"sale":"Sale!","sku":"SKU: ","showmore":"Vedi tutti i risultati","noresults":"Non trovo niente con questi termini"};
//# sourceURL=aws-script-js-extra
var njt_wa = {"gdprStatus":"1","accounts":[{"accountId":19300,"accountName":"MagicNet","avatar":"","number":"+393338543635","title":"Chiedi e parla con noi!","predefinedText":"","willBeBackText":"I will be back in [njwa_time_work]","dayOffsText":"I will be back soon","isAlwaysAvailable":"ON","daysOfWeekWorking":{"sunday":{"isWorkingOnDay":"OFF","workHours":[{"startTime":"08:00","endTime":"17:30"}]},"monday":{"isWorkingOnDay":"OFF","workHours":[{"startTime":"08:00","endTime":"17:30"}]},"tuesday":{"isWorkingOnDay":"OFF","workHours":[{"startTime":"08:00","endTime":"17:30"}]},"wednesday":{"isWorkingOnDay":"OFF","workHours":[{"startTime":"08:00","endTime":"17:30"}]},"thursday":{"isWorkingOnDay":"OFF","workHours":[{"startTime":"08:00","endTime":"17:30"}]},"friday":{"isWorkingOnDay":"OFF","workHours":[{"startTime":"08:00","endTime":"17:30"}]},"saturday":{"isWorkingOnDay":"OFF","workHours":[{"startTime":"08:00","endTime":"17:30"}]}}}],"options":{"display":{"displayCondition":"excludePages","includePages":[],"excludePages":[],"includePosts":[],"showOnDesktop":"ON","showOnMobile":"ON","time_symbols":"h:m"},"styles":{"title":"Contatto Immediato","responseText":"\u003Cspan style=\"color: #333333;font-family: Georgia, 'Times New Roman', 'Bitstream Charter', Times, serif;font-size: 16px;font-style: normal;font-weight: 400;letter-spacing: normal;text-align: start;text-indent: 0px;text-transform: none;background-color: #ffffff;float: none\"\u003ENormalmente rispondiamo in pochi minuti.\u003C/span\u003E","description":"","backgroundColor":"#2db742","textColor":"#fff","titleSize":"18","accountNameSize":"14","descriptionTextSize":"12","regularTextSize":"11","scrollHeight":"500","isShowScroll":"OFF","isShowResponseText":"OFF","btnLabel":"Serve aiuto? \u003Cstrong\u003EChiedi\u003C/strong\u003E","btnLabelWidth":"156","btnPosition":"right","btnLeftDistance":"30","btnRightDistance":"30","btnBottomDistance":"122","isShowBtnLabel":"ON","isShowGDPR":"ON","gdprContent":"\u003Cspan style=\"color: #333333;font-family: Georgia, 'Times New Roman', 'Bitstream Charter', Times, serif;font-size: 16px;font-style: normal;font-weight: 400;letter-spacing: normal;text-align: start;text-indent: 0px;text-transform: none;background-color: #ffffff;float: none\"\u003ELeggi la nostra\u00a0\u003C/span\u003E\u003Ca href=\"https://www.lavagneluminose.info/privacy\"\u003Eprivacy policy\u003C/a\u003E\u003Cspan style=\"color: #333333;font-family: Georgia, 'Times New Roman', 'Bitstream Charter', Times, serif;font-size: 16px;font-style: normal;font-weight: 400;letter-spacing: normal;text-align: start;text-indent: 0px;text-transform: none;background-color: #ffffff;float: none\"\u003E prima di proseguire.\u003C/span\u003E\r\n\r\n ","isShowPoweredBy":"ON"},"analytics":{"enabledGoogle":"OFF","enabledFacebook":"OFF","enabledGoogleGA4":"OFF"}}};
//# sourceURL=nta-js-popup-js-extra
(function (undefined) {let scriptOptions={"_localizedStrings":{"redirect_overlay_title":"Hold On","redirect_overlay_text":"You are being redirected to another page,<br>it may take a few seconds.","webview_notification_text":"The selected provider doesn't support embedded browsers!"},"_targetWindow":"prefer-popup","_redirectOverlay":"overlay-with-spinner-and-message","_unsupportedWebviewBehavior":""};
/**
* Used when Cross-Origin-Opener-Policy blocked the access to the opener. We can't have a reference of the opened windows, so we should attempt to refresh only the windows that has opened popups.
*/
window._nslHasOpenedPopup = false;
window._nslWebViewNoticeElement = null;window.NSLPopup = function (url, title, w, h) {/**
* Cross-Origin-Opener-Policy blocked the access to the opener
*/
if (typeof BroadcastChannel === "function") {
const _nslLoginBroadCastChannel = new BroadcastChannel('nsl_login_broadcast_channel');
_nslLoginBroadCastChannel.onmessage = (event) => {
if (window?._nslHasOpenedPopup && event.data?.action === 'redirect') {
window._nslHasOpenedPopup = false;const url = event.data?.href;
_nslLoginBroadCastChannel.close();
if (typeof window.nslRedirect === 'function') {
window.nslRedirect(url);
} else {
window.opener.location = url;
}
}
};
}const userAgent = navigator.userAgent,
mobile = function () {
return /\b(iPhone|iP[ao]d)/.test(userAgent) ||
/\b(iP[ao]d)/.test(userAgent) ||
/Android/i.test(userAgent) ||
/Mobile/i.test(userAgent);
},
screenX = window.screenX !== undefined ? window.screenX : window.screenLeft,
screenY = window.screenY !== undefined ? window.screenY : window.screenTop,
outerWidth = window.outerWidth !== undefined ? window.outerWidth : document.documentElement.clientWidth,
outerHeight = window.outerHeight !== undefined ? window.outerHeight : document.documentElement.clientHeight - 22,
targetWidth = mobile() ? null : w,
targetHeight = mobile() ? null : h,
left = parseInt(screenX + (outerWidth - targetWidth) / 2, 10),
right = parseInt(screenY + (outerHeight - targetHeight) / 2.5, 10),
features = [];
if (targetWidth !== null) {
features.push('width=' + targetWidth);
}
if (targetHeight !== null) {
features.push('height=' + targetHeight);
}
features.push('left=' + left);
features.push('top=' + right);
features.push('scrollbars=1');const newWindow = window.open(url, title, features.join(','));if (window.focus) {
newWindow.focus();
}window._nslHasOpenedPopup = true;return newWindow;
};let isWebView = null;function checkWebView() {
if (isWebView === null) {
function _detectOS(ua) {
if (/Android/.test(ua)) {
return "Android";
} else if (/iPhone|iPad|iPod/.test(ua)) {
return "iOS";
} else if (/Windows/.test(ua)) {
return "Windows";
} else if (/Mac OS X/.test(ua)) {
return "Mac";
} else if (/CrOS/.test(ua)) {
return "Chrome OS";
} else if (/Firefox/.test(ua)) {
return "Firefox OS";
}
return "";
}function _detectBrowser(ua) {
let android = /Android/.test(ua);if (/Opera Mini/.test(ua) || / OPR/.test(ua) || / OPT/.test(ua)) {
return "Opera";
} else if (/CriOS/.test(ua)) {
return "Chrome for iOS";
} else if (/Edge/.test(ua)) {
return "Edge";
} else if (android && /Silk\//.test(ua)) {
return "Silk";
} else if (/Chrome/.test(ua)) {
return "Chrome";
} else if (/Firefox/.test(ua)) {
return "Firefox";
} else if (android) {
return "AOSP";
} else if (/MSIE|Trident/.test(ua)) {
return "IE";
} else if (/Safari\//.test(ua)) {
return "Safari";
} else if (/AppleWebKit/.test(ua)) {
return "WebKit";
}
return "";
}function _detectBrowserVersion(ua, browser) {
if (browser === "Opera") {
return /Opera Mini/.test(ua) ? _getVersion(ua, "Opera Mini/") :
/ OPR/.test(ua) ? _getVersion(ua, " OPR/") :
_getVersion(ua, " OPT/");
} else if (browser === "Chrome for iOS") {
return _getVersion(ua, "CriOS/");
} else if (browser === "Edge") {
return _getVersion(ua, "Edge/");
} else if (browser === "Chrome") {
return _getVersion(ua, "Chrome/");
} else if (browser === "Firefox") {
return _getVersion(ua, "Firefox/");
} else if (browser === "Silk") {
return _getVersion(ua, "Silk/");
} else if (browser === "AOSP") {
return _getVersion(ua, "Version/");
} else if (browser === "IE") {
return /IEMobile/.test(ua) ? _getVersion(ua, "IEMobile/") :
/MSIE/.test(ua) ? _getVersion(ua, "MSIE ")
:
_getVersion(ua, "rv:");
} else if (browser === "Safari") {
return _getVersion(ua, "Version/");
} else if (browser === "WebKit") {
return _getVersion(ua, "WebKit/");
}
return "0.0.0";
}function _getVersion(ua, token) {
try {
return _normalizeSemverString(ua.split(token)[1].trim().split(/[^\w\.]/)[0]);
} catch (o_O) {
}
return "0.0.0";
}function _normalizeSemverString(version) {
const ary = version.split(/[\._]/);
return (parseInt(ary[0], 10) || 0) + "." +
(parseInt(ary[1], 10) || 0) + "." +
(parseInt(ary[2], 10) || 0);
}function _isWebView(ua, os, browser, version, options) {
switch (os + browser) {
case "iOSSafari":
return false;
case "iOSWebKit":
return _isWebView_iOS(options);
case "AndroidAOSP":
return false;
case "AndroidChrome":
return parseFloat(version) >= 42 ? /; wv/.test(ua) : /\d{2}\.0\.0/.test(version) ? true : _isWebView_Android(options);
}
return false;
}function _isWebView_iOS(options) {
const document = (window["document"] || {});if ("WEB_VIEW" in options) {
return options["WEB_VIEW"];
}
return !("fullscreenEnabled" in document || "webkitFullscreenEnabled" in document || false);
}function _isWebView_Android(options) {
if ("WEB_VIEW" in options) {
return options["WEB_VIEW"];
}
return !("requestFileSystem" in window || "webkitRequestFileSystem" in window || false);
}const options = {},
nav = window.navigator || {},
ua = nav.userAgent || "",
os = _detectOS(ua),
browser = _detectBrowser(ua),
browserVersion = _detectBrowserVersion(ua, browser);isWebView = _isWebView(ua, os, browser, browserVersion, options);
}return isWebView;
}function isAllowedWebViewForUserAgent(provider) {
const facebookAllowedWebViews = [
'Instagram',
'FBAV',
'FBAN'
];
let whitelist = [];if (provider && provider === 'facebook') {
whitelist = facebookAllowedWebViews;
}const nav = window.navigator || {},
ua = nav.userAgent || "";if (whitelist.length && ua.match(new RegExp(whitelist.join('|')))) {
return true;
}return false;
}function disableButtonInWebView(providerButtonElement) {
if (providerButtonElement) {
providerButtonElement.classList.add('nsl-disabled-provider');
providerButtonElement.setAttribute('href', '#');providerButtonElement.addEventListener('pointerdown', (e) => {
if (!window._nslWebViewNoticeElement) {
window._nslWebViewNoticeElement = document.createElement('div');
window._nslWebViewNoticeElement.id = "nsl-notices-fallback";
window._nslWebViewNoticeElement.addEventListener('pointerdown', function (e) {
this.parentNode.removeChild(this);
window._nslWebViewNoticeElement = null;
});
const webviewNoticeHTML = '<div class="error"><p>' + scriptOptions._localizedStrings.webview_notification_text + '</p></div>';window._nslWebViewNoticeElement.insertAdjacentHTML("afterbegin", webviewNoticeHTML);
document.body.appendChild(window._nslWebViewNoticeElement);
}
});
}}window._nslDOMReady(function () {window.nslRedirect = function (url) {
if (scriptOptions._redirectOverlay) {
const overlay = document.createElement('div');
overlay.id = "nsl-redirect-overlay";
let overlayHTML = '';
const overlayContainer = "<div id='nsl-redirect-overlay-container'>",
overlayContainerClose = "</div>",
overlaySpinner = "<div id='nsl-redirect-overlay-spinner'></div>",
overlayTitle = "<p id='nsl-redirect-overlay-title'>" + scriptOptions._localizedStrings.redirect_overlay_title + "</p>",
overlayText = "<p id='nsl-redirect-overlay-text'>" + scriptOptions._localizedStrings.redirect_overlay_text + "</p>";switch (scriptOptions._redirectOverlay) {
case "overlay-only":
break;
case "overlay-with-spinner":
overlayHTML = overlayContainer + overlaySpinner + overlayContainerClose;
break;
default:
overlayHTML = overlayContainer + overlaySpinner + overlayTitle + overlayText + overlayContainerClose;
break;
}overlay.insertAdjacentHTML("afterbegin", overlayHTML);
document.body.appendChild(overlay);
}window.location = url;
};let targetWindow = scriptOptions._targetWindow || 'prefer-popup',
lastPopup = false;document.addEventListener('click', function (e) {
if (e.target) {
const buttonLinkElement = e.target.closest('a[data-plugin="nsl"][data-action="connect"]') || e.target.closest('a[data-plugin="nsl"][data-action="link"]');
if (buttonLinkElement) {
if (lastPopup && !lastPopup.closed) {
e.preventDefault();
lastPopup.focus();
} else {let href = buttonLinkElement.href,
success = false;
if (href.indexOf('?') !== -1) {
href += '&';
} else {
href += '?';
}const redirectTo = buttonLinkElement.dataset.redirect;
if (redirectTo === 'current') {
href += 'redirect=' + encodeURIComponent(window.location.href) + '&';
} else if (redirectTo && redirectTo !== '') {
href += 'redirect=' + encodeURIComponent(redirectTo) + '&';
}if (targetWindow !== 'prefer-same-window' && checkWebView()) {
targetWindow = 'prefer-same-window';
}if (targetWindow === 'prefer-popup') {
lastPopup = NSLPopup(href + 'display=popup', 'nsl-social-connect', buttonLinkElement.dataset.popupwidth, buttonLinkElement.dataset.popupheight);
if (lastPopup) {
success = true;
e.preventDefault();
}
} else if (targetWindow === 'prefer-new-tab') {
const newTab = window.open(href + 'display=popup', '_blank');
if (newTab) {
if (window.focus) {
newTab.focus();
}
success = true;
window._nslHasOpenedPopup = true;
e.preventDefault();
}
}if (!success) {
window.location = href;
e.preventDefault();
}
}
}
}
});let buttonCountChanged = false;const googleLoginButtons = document.querySelectorAll(' a[data-plugin="nsl"][data-provider="google"]');
if (googleLoginButtons.length && checkWebView()) {
googleLoginButtons.forEach(function (googleLoginButton) {
if (scriptOptions._unsupportedWebviewBehavior === 'disable-button') {
disableButtonInWebView(googleLoginButton);
} else {
googleLoginButton.remove();
buttonCountChanged = true;
}
});
}const facebookLoginButtons = document.querySelectorAll(' a[data-plugin="nsl"][data-provider="facebook"]');
if (facebookLoginButtons.length && checkWebView() && /Android/.test(window.navigator.userAgent) && !isAllowedWebViewForUserAgent('facebook')) {
facebookLoginButtons.forEach(function (facebookLoginButton) {
if (scriptOptions._unsupportedWebviewBehavior === 'disable-button') {
disableButtonInWebView(facebookLoginButton);
} else {
facebookLoginButton.remove();
buttonCountChanged = true;
}
});
}const separators = document.querySelectorAll('div.nsl-separator');
if (buttonCountChanged && separators.length) {
separators.forEach(function (separator) {
const separatorParentNode = separator.parentNode;
if (separatorParentNode) {
const separatorButtonContainer = separatorParentNode.querySelector('div.nsl-container-buttons');
if (separatorButtonContainer && !separatorButtonContainer.hasChildNodes()) {
separator.remove();
}
}
})
}
});})();
jQuery( document ).ready( function () {
var qty_select = jQuery( "select.qty" );
if ( qty_select.length > 0 ) {
jQuery( document ).on( 'change', 'select.qty:not(.disable_price_by_qty)', function () {
var input = jQuery( this ).closest( 'div.quantity' ).find( 'input.qty' );
if ( input.length > 0 ) {
sync_classes( input );
input.val( jQuery( this ).val() ).change();
}var add_to_cart = jQuery( this ).closest( 'div.quantity' ).siblings( ".add-to-cart" );
var add_cart = jQuery( this ).closest( 'div.quantity' ).siblings( ".add_to_cart_button" );
if ( add_to_cart.length > 0 ) {
add_to_cart.find( 'a.add_to_cart_button' ).attr( "data-quantity", jQuery( this ).val() );
} else if ( add_cart.length > 0 ) {
add_cart.attr( "data-quantity", jQuery( this ).val() );
}
} );qty_select.change();}} );jQuery( '[name="quantity"]' ).not( ".disable_price_by_qty" ).on( 'change', function ( e ) {
var current_val = parseFloat( jQuery( this ).val() );
if ( Number.isInteger( current_val ) === false ) {
current_val = current_val.toFixed( 4 );
current_val = parseFloat( current_val );
jQuery( this ).val( current_val );
} else {
current_val = parseInt( current_val );
jQuery( this ).val( current_val );
}
} );function sync_classes( input ) {
var classList = input.attr( 'class' ).split( /\s+/ );
jQuery( classList ).each( function ( index, item ) {
if ( !jQuery( "select.qty" ).hasClass( item ) ) {
jQuery( "select.qty" ).addClass( item );
}
} );
}
/* ========================================================= */
/* OXYGEN MENU BYPASS - FORZA L'APERTURA DELL'HAMBURGER MENU */
/* Ignora gli errori di WooCommerce, cache o altri plugin */
/* ========================================================= */window.addEventListener("DOMContentLoaded", function() {
// Cerchiamo tutti i pulsanti hamburger nel sito
var hamburgerBtns = document.querySelectorAll(".oxy-menu-toggle");
hamburgerBtns.forEach(function(btn) {
// Usiamo "true" (Capture phase) per intercettare il click PRIMA
// che qualsiasi altro script rotto possa bloccarlo.
btn.addEventListener("click", function(e) {
e.preventDefault();
e.stopPropagation(); // Blocchiamo le interferenze esterne
// Troviamo il menu principale che contiene questo hamburger
var parentMenu = this.closest(".oxy-nav-menu");
if(parentMenu) {
// Aggiungiamo o togliamo la classe che mostra/nasconde il menu
parentMenu.classList.toggle("oxy-nav-menu-open");
document.body.classList.toggle("oxy-nav-menu-prevent-overflow");
document.documentElement.classList.toggle("oxy-nav-menu-prevent-overflow");
}
}, true);
});
// Gestione chiusura del menu se si clicca su un link interno (es. le ancore)
document.addEventListener("click", function(e) {
var clickedLink = e.target.closest(".oxy-nav-menu-open .menu-item a");
if(clickedLink) {
var openMenu = clickedLink.closest(".oxy-nav-menu");
if(openMenu) {
openMenu.classList.remove("oxy-nav-menu-open");
document.body.classList.remove("oxy-nav-menu-prevent-overflow");
document.documentElement.classList.remove("oxy-nav-menu-prevent-overflow");
}
}
});
});
// Unlazy a prova di plugin + fallback bg se l'immagine non arriva in tempo
document.addEventListener('DOMContentLoaded', function(){
var img = document.querySelector('.lv-hero-img__photo');
var wrap = document.querySelector('.lv-hero-img');
if(!img || !wrap) return;// Se un plugin ha spostato gli URL su data-*, rimettili subito su src/srcset
['data-lazy-src','data-src','data-original'].forEach(function(attr){
var v = img.getAttribute(attr);
if (v) img.setAttribute('src', v);
});
var ds = img.getAttribute('data-srcset');
if (ds && !img.getAttribute('srcset')) img.setAttribute('srcset', ds);// Rimuovi classi lazy comuni
['lazyload','lazyloading','ls-is-cached','ls-is-active'].forEach(function(c){
img.classList.remove(c);
});// Forza visibilità
img.style.opacity = '1';
img.style.visibility = 'visible';
img.style.filter = 'none';// Se entro 1200ms non è visibile, fallback: usa la stessa immagine come background
function ensureVisible(){
if (img.complete && img.naturalWidth > 0) return;
var url = img.currentSrc || img.src;
if (url){
wrap.style.backgroundImage = 'url(' + url + ')';
wrap.style.backgroundSize = 'cover';
wrap.style.backgroundPosition = 'center';
}
}
setTimeout(ensureVisible, 1200);
img.addEventListener('error', ensureVisible);
});