let country = 'US'; let payingCustomer = false; if (document.location.href.indexOf('nils') > -1) nils(); function run() { const MESSAGE_VIEW_LIMIT = 100; const HIDE_DURATION_DAYS = 1; const MAX_DISMISSALS_FOR_PAYING = 3; function getStorageData(key) { return JSON.parse(localStorage.getItem(key)) || {}; } function setStorageData(key, data) { localStorage.setItem(key, JSON.stringify(data)); } const storageKey = "modalState"; const state = getStorageData(storageKey); const now = Date.now(); const lastDismissed = state.lastDismissed || 0; const viewCount = state.viewCount || 0; const dismissCount = state.dismissCount || 0; if (typeof payingCustomer !== 'undefined' && payingCustomer) return; if (viewCount >= MESSAGE_VIEW_LIMIT || now - lastDismissed < HIDE_DURATION_DAYS * 86400000) return; state.viewCount = viewCount + 1; setStorageData(storageKey, state); injectStyles(); createModal(); countdown(); countupFomo(); function injectStyles() { const css = ` #promoModalOverlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.7); display: flex; justify-content: center; align-items: center; z-index: 9999; padding: 20px; } #promoModal { background: #ffffff; border-radius: 12px; padding: 30px 24px 24px; max-width: 500px; width: 100%; box-shadow: 0 10px 30px rgba(0,0,0,0.4); font-family: var(--bs-font-sans-serif, sans-serif); text-align: center; position: relative; line-height: 1.4; } #promoModal h2 { margin-top: 0; font-size: 24px; font-weight: 700; } #promoModal p { margin: 12px 0; font-size: 16px; color: #333; } .countdown-box { margin: 20px 0; } .count-label { font-size: 16px; font-weight: bold; color: #d32f2f; margin: 0; } .countdown-value { font-size: 20px; color: #b71c1c!important; font-weight: bold; letter-spacing: 0.5px; } .count-subtext { font-size: 14px; color: #d32f2f; font-weight: 500; margin: 0; } #promoModal a.cta-btn { display: inline-block; width:80%; padding: 12px 24px; background-color: #ff6f00; color: #fff; font-weight: bold; font-size: 16px; text-decoration: none; border-radius: 6px; transition: background-color 0.3s ease; } #promoModal a.cta-btn:hover { background-color: #e65100; } #dismissMessage { margin-top: 16px; font-size: 13px; cursor: pointer; color: #000; display: inline-block; } #dismissMessage span { text-decoration: none; display: inline-block; margin-right: 5px; color: #c62828; } #promoModal p.fomo { font-size: 13px; color: #555; margin-top: 12px; } #promoModalClose { position: absolute; top: 12px; right: 12px; background: #eee; border: none; font-size: 18px; font-weight: bold; color: #333; border-radius: 50%; width: 32px; height: 32px; cursor: pointer; line-height: 1; } #promoModalClose:hover { background: #ddd; } `; const style = document.createElement("style"); style.textContent = css; document.head.appendChild(style); } function createModal() { const overlay = document.createElement("div"); overlay.id = "promoModalOverlay"; overlay.innerHTML = `

๐ŸŽ‰ ImagR โ€“ Summer Deal ๐ŸŽ‰

โšกGet up to 25% OFF โ€“ Before Prices Snap Back At Midnight!

โฐ 0 Hours 0 Minutes 0 Seconds

This Deal Ends Tonight!

โœ… CLAIM THE DEAL NOW ยป

๐Ÿš€ 632 people claimed this deal in the last 24 hours

โŒ Dismiss this offer.
`; document.body.appendChild(overlay); document.getElementById("promoModalClose").addEventListener("click", () => { overlay.remove(); }); document.getElementById("dismissMessage").addEventListener("click", () => { overlay.remove(); state.lastDismissed = Date.now(); state.dismissCount = dismissCount + 1; setStorageData(storageKey, state); }); document.getElementById('claimBtn').addEventListener('click', function (event) { fetch('https://wiegner.gmbh/announcement/log.php?country=' + country + '&clicked=true') .catch(() => { }); }); fetch('https://wiegner.gmbh/announcement/log.php?country=' + country); } function countdown() { function updateCountdown() { const now = new Date(); const endOfDay = new Date(); endOfDay.setHours(23, 59, 59, 999); const el = document.getElementById("countdown"); if (!el) return; let diff = endOfDay - now; if (diff <= 0) { el.textContent = "0d 0h 0m 0s"; return; } const totalSeconds = Math.floor(diff / 1000); const days = Math.floor(totalSeconds / 86400); const hours = Math.floor((totalSeconds % 86400) / 3600); const minutes = Math.floor((totalSeconds % 3600) / 60); const seconds = totalSeconds % 60; el.textContent = `โฐ ${hours} Hours ${minutes} Minutes ${seconds} Seconds Left`; } updateCountdown(); setInterval(updateCountdown, 1000); } function countupFomo() { const COUNTER_KEY = 'fomoCounterValue'; const START_VALUE = 632; const MIN_MS = 2000; const MAX_MS = 20000; const MAX_INCREMENT = 999; let currentValue = parseInt(localStorage.getItem(COUNTER_KEY)) || START_VALUE; const fomoEl = document.getElementById("fomoCounter"); if (!fomoEl) return; fomoEl.textContent = currentValue; function scheduleNext() { const delay = Math.floor(Math.random() * (MAX_MS - MIN_MS + 1)) + MIN_MS; setTimeout(() => { if (currentValue < MAX_INCREMENT) { currentValue++; fomoEl.textContent = currentValue; localStorage.setItem(COUNTER_KEY, currentValue.toString()); scheduleNext(); } }, delay); } scheduleNext(); } } function nils() { document.querySelectorAll('.masthead').forEach(function (el) { el.outerHTML = `

FROM IMAGE TO LASER CREATION

ImagR prepares. AtomStack makes it real.

`; }); }