let country = 'US'; let payingCustomer = false; // Nach 5 Sekunden prüfen, ob Datum vor dem 01.12.2025 23:59:59 ist setTimeout(() => { const now = new Date(); const cutoff = new Date(2025, 11, 1, 23, 59, 59); if (document.location.href.indexOf('/login') > -1 || document.location.href.indexOf('/pricing') > -1) return; if (now < cutoff) { run(); } }, 6000); async function run() { try { if (document.location.href.indexOf('nils') == -1) { const r = await fetch('https://wiegner.gmbh/announcement/c.php'); const data = await r.json(); if (data === true || data === "true" || data === 1 || data === "1") { return; } } } catch (e) { } 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; // payingCustomer muss global definiert sein, sonst wird einfach normal angezeigt 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); // --- i18n-Konfiguration --- const translations = { en: { highlight: 'BLACK WEEKS', title: 'ImagR – Mega Deal', tagline: '⚡ Get 33% OFF on ImagR ⚡', body: 'If you ever wanted to upgrade your engraving workflow — this is the moment. Prices won’t be this low again.', cta: 'ACTIVATE YOUR 33% DISCOUNT →', fomo: '🚀 632 creators grabbed this Black Weeks deal in the last 24 hours.', dismiss: '❌Dismiss this offer.' }, de: { highlight: 'BLACK WEEKS', title: 'ImagR – Mega-Deal', tagline: '⚡ Sichere dir jetzt 33 % RABATT auf ImagR ⚡', body: 'Wenn du deinen Gravur-Workflow jemals upgraden wolltest – genau jetzt ist der Moment. So günstig wird es nicht wieder.', cta: 'JETZT 33 % RABATT AKTIVIEREN →', fomo: '🚀 In den letzten 24 Stunden haben bereits 632 Creator dieses Black-Weeks-Angebot genutzt.', dismiss: '❌Angebot ausblenden.' }, fr: { highlight: 'BLACK WEEKS', title: 'ImagR – Offre Méga', tagline: '⚡ Profitez de 33 % DE RÉDUCTION sur ImagR ⚡', body: 'Si vous avez toujours voulu améliorer votre flux de gravure, c’est le moment. Les prix ne seront plus aussi bas.', cta: 'ACTIVER VOTRE RÉDUCTION DE 33 % →', fomo: '🚀 Au cours des dernières 24 heures, 632 créateurs ont profité de cette offre Black Weeks.', dismiss: '❌Ignorer cette offre.' }, it: { highlight: 'BLACK WEEKS', title: 'ImagR – Mega Offerta', tagline: '⚡ Ottieni 33% DI SCONTO su ImagR ⚡', body: 'Se hai mai voluto migliorare il tuo flusso di incisione, questo è il momento giusto. I prezzi non saranno di nuovo così bassi.', cta: 'ATTIVA ORA IL TUO SCONTO DEL 33% →', fomo: '🚀 Nelle ultime 24 ore 632 creator hanno approfittato di questa offerta Black Weeks.', dismiss: '❌Nascondi questa offerta.' }, hi: { highlight: 'BLACK WEEKS', title: 'ImagR – मेगा डील', tagline: '⚡ ImagR पर 33% की छूट पाएं ⚡', body: 'अगर आप कभी अपना एन्ग्रेविंग वर्कफ़्लो अपग्रेड करना चाहते थे, तो यही सही समय है। कीमतें फिर इतनी कम नहीं होंगी.', cta: 'अभी अपनी 33% छूट सक्रिय करें →', fomo: '🚀 पिछले 24 घंटों में 632 क्रिएटर्स ने इस Black Weeks ऑफ़र का लाभ उठाया है.', dismiss: '❌इस ऑफ़र को बंद करें.' }, nl: { highlight: 'BLACK WEEKS', title: 'ImagR – Mega Deal', tagline: '⚡ Krijg nu 33% KORTING op ImagR ⚡', body: 'Als je je graveer-workflow ooit hebt willen upgraden, dan is dit het moment. Zo laag worden de prijzen niet meer.', cta: 'ACTIVEER JE 33% KORTING →', fomo: '🚀 In de afgelopen 24 uur hebben 632 creators gebruikgemaakt van deze Black Weeks-deal.', dismiss: '❌Aanbieding verbergen.' }, ru: { highlight: 'BLACK WEEKS', title: 'ImagR – мега-предложение', tagline: '⚡ Получите СКИДКУ 33% на ImagR ⚡', body: 'Если вы когда-либо хотели улучшить свой процесс гравировки — самое время. Цены больше не будут такими низкими.', cta: 'АКТИВИРУЙТЕ СКИДКУ 33% →', fomo: '🚀 За последние 24 часа 632 креатора уже воспользовались этим предложением Black Weeks.', dismiss: '❌Скрыть это предложение.' }, cs: { highlight: 'BLACK WEEKS', title: 'ImagR – Mega nabídka', tagline: '⚡ Získejte 33% SLEVU na ImagR ⚡', body: 'Pokud jste někdy chtěli vylepšit svůj gravírovací workflow, teď je ten správný moment. Ceny už nebudou tak nízké.', cta: 'AKTIVUJTE SVOU 33% SLEVU →', fomo: '🚀 Během posledních 24 hodin využilo tuto Black Weeks nabídku už 632 tvůrců.', dismiss: '❌Skrýt tuto nabídku.' }, ro: { highlight: 'BLACK WEEKS', title: 'ImagR – Ofertă Mega', tagline: '⚡ Obține REDUCERE DE 33% la ImagR ⚡', body: 'Dacă ți-ai dorit vreodată să-ți îmbunătățești fluxul de gravare, acesta este momentul. Prețurile nu vor mai fi atât de mici.', cta: 'ACTIVEAZĂ ACUM REDUCEREA DE 33% →', fomo: '🚀 În ultimele 24 de ore, 632 creatori au profitat de această ofertă Black Weeks.', dismiss: '❌Ascunde această ofertă.' }, pl: { highlight: 'BLACK WEEKS', title: 'ImagR – Mega oferta', tagline: '⚡ Zdobądź 33% RABATU na ImagR ⚡', body: 'Jeśli kiedykolwiek chciałeś ulepszyć swój workflow grawerowania, to jest ten moment. Ceny nie będą już tak niskie.', cta: 'AKTYWUJ SWÓJ RABAT 33% →', fomo: '🚀 W ciągu ostatnich 24 godzin 632 twórców skorzystało z tej Black Weeks oferty.', dismiss: '❌Ukryj tę ofertę.' }, es: { highlight: 'BLACK WEEKS', title: 'ImagR – Mega Oferta', tagline: '⚡ Consigue un 33% DE DESCUENTO en ImagR ⚡', body: 'Si alguna vez quisiste mejorar tu flujo de grabado, este es el momento. Los precios no volverán a estar tan bajos.', cta: 'ACTIVA AHORA TU DESCUENTO DEL 33% →', fomo: '🚀 En las últimas 24 horas, 632 creadores han aprovechado esta oferta de Black Weeks.', dismiss: '❌Ocultar esta oferta.' }, sv: { highlight: 'BLACK WEEKS', title: 'ImagR – Megaerbjudande', tagline: '⚡ Få 33% RABATT på ImagR ⚡', body: 'Om du någonsin velat uppgradera ditt graverings-workflow är det här tillfället. Priserna kommer inte att vara så här låga igen.', cta: 'AKTIVERA DIN 33%-RABATT NU →', fomo: '🚀 Under de senaste 24 timmarna har 632 kreatörer tagit del av detta Black Weeks-erbjudande.', dismiss: '❌Dölj det här erbjudandet.' }, fi: { highlight: 'BLACK WEEKS', title: 'ImagR – Mega-tarjous', tagline: '⚡ Saat 33% ALENNUSEN ImagRista ⚡', body: 'Jos olet koskaan halunnut parantaa kaiverrus-workflow’iasi, hetki on nyt. Hinnat eivät tule olemaan näin alhaiset uudestaan.', cta: 'AKTIVOI 33% ALENNUS →', fomo: '🚀 Viimeisten 24 tunnin aikana 632 tekijää on hyödyntänyt tämän Black Weeks -tarjouksen.', dismiss: '❌Piilota tämä tarjous.' } }; function getLanguageFromCountry(countryCode) { if (!countryCode || typeof countryCode !== 'string') return 'en'; const cc = countryCode.toUpperCase(); const map = { DE: 'de', AT: 'de', CH: 'de', FR: 'fr', IT: 'it', SM: 'it', VA: 'it', IN: 'hi', NL: 'nl', RU: 'ru', CZ: 'cs', RO: 'ro', PL: 'pl', ES: 'es', SE: 'sv', FI: 'fi' }; return map[cc] || 'en'; } const lang = getLanguageFromCountry(typeof country !== 'undefined' ? country : null); const t = translations[lang] || translations.en; injectStyles(); createModal(t); countupFomo(); function injectStyles() { const css = ` #promoModalOverlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.85); display: flex; justify-content: center; align-items: center; z-index: 9999; padding: 20px; opacity: 0; pointer-events: none; transition: opacity 0.4s ease; } #promoModalOverlay.visible { opacity: 1; pointer-events: auto; } #promoModal { background: #0b0b0b; border-radius: 16px; padding: 30px 26px 24px; max-width: 520px; width: 100%; box-shadow: 0 18px 45px rgba(0,0,0,0.8); font-family: var(--bs-font-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif); text-align: center; position: relative; line-height: 1.4; color: #f5f5f5; border: 1px solid rgba(255,255,255,0.08); opacity: 0; transform: translateY(12px); transition: opacity 0.4s ease, transform 0.4s ease; box-shadow: 0 0 55px rgba(255,255,255,0.12), 0 0 120px rgba(255,255,255,0.08); } #promoModalOverlay.visible #promoModal { opacity: 1; transform: translateY(0); } #promoModal::before { content: ""; position: absolute; inset: -2px; border-radius: inherit; background: radial-gradient(circle at top left, rgba(255,255,255,0.2), transparent 55%); opacity: 0.35; pointer-events: none; z-index: -1; } #promoModal h2 { margin-top: 0; font-size: 26px; font-weight: 800; letter-spacing: 0.04em; text-transform: uppercase; color: #ffffff; } #promoModal h2 span.highlight { display: block; font-size: 14px; font-weight: 600; color: #ffeb3b; letter-spacing: 0.25em; margin-bottom: 4px; } #promoModal p { margin: 12px 0; font-size: 15px; color: #e0e0e0; } #promoModal p strong { color: #ffeb3b; } #promoModal p.tagline { font-size: 16px; font-weight: 600; margin-top: 4px; color: #ffffff; } #promoModal a.cta-btn { display: inline-block; width: 80%; padding: 13px 24px; margin-top: 16px; background: linear-gradient(135deg, #ffeb3b, #ff9800); color: #000; font-weight: 800; font-size: 16px; text-decoration: none; border-radius: 999px; text-transform: uppercase; letter-spacing: 0.08em; transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease; box-shadow: 0 10px 25px rgba(0,0,0,0.7); } #promoModal a.cta-btn:hover { transform: translateY(-1px) scale(1.01); box-shadow: 0 14px 35px rgba(0,0,0,0.9); filter: brightness(1.05); } #promoModal a.cta-btn:active { transform: translateY(0) scale(0.99); box-shadow: 0 8px 20px rgba(0,0,0,0.6); } #promoModal p.fomo { font-size: 13px; color: #bdbdbd; margin-top: 14px; } #promoModal p.fomo span { color: #ffeb3b; font-weight: 700; } #dismissMessage { margin-top: 14px; font-size: 12px; cursor: pointer; color: #9e9e9e; display: inline-block; opacity: 0.85; } #dismissMessage span { text-decoration: none; display: inline-block; margin-right: 5px; color: #f44336; } #dismissMessage:hover { color: #ffffff; opacity: 1; } #promoModalClose { position: absolute; top: 10px; right: 10px; background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.15); font-size: 18px; font-weight: 700; color: #f5f5f5; border-radius: 999px; width: 30px; height: 30px; cursor: pointer; line-height: 1; display: flex; align-items: center; justify-content: center; transition: background 0.15s ease, transform 0.15s ease; } #promoModalClose:hover { background: rgba(255,255,255,0.16); transform: scale(1.04); } /* --- Notification Bar oben (liegt in .sticky-top) --- */ #promoTopBar { width: 100%; background: linear-gradient(90deg, #ffeb3b, #ff9800); color: #000; font-family: var(--bs-font-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif); padding: 8px 16px; display: flex; align-items: center; justify-content: center; gap: 14px; box-shadow: 0 4px 12px rgba(0,0,0,0.35); } #promoTopBarText { font-size: 14px; font-weight: 600; text-align: center; } #promoTopBarText strong { font-weight: 800; } #promoTopBar .bar-cta-link { display: inline-block; padding: 6px 14px; border-radius: 999px; background: #000; color: #ffffff; font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.08em; text-decoration: none; white-space: nowrap; box-shadow: 0 3px 8px rgba(0,0,0,0.45); transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease; } #promoTopBar .bar-cta-link:hover { transform: translateY(-1px); box-shadow: 0 5px 14px rgba(0,0,0,0.6); filter: brightness(1.05); } #promoTopBarClose { border: none; background: transparent; font-size: 18px; line-height: 1; cursor: pointer; margin-left: 6px; padding: 0 4px; color: #000; opacity: 0.7; } #promoTopBarClose:hover { opacity: 1; } @media (max-width: 480px) { #promoTopBar { flex-direction: column; padding: 10px 12px; } } `; const style = document.createElement("style"); style.textContent = css; document.head.appendChild(style); } function createModal(t) { const overlay = document.createElement("div"); overlay.id = "promoModalOverlay"; overlay.innerHTML = `
`; document.body.appendChild(overlay); // sanfter Fade-In setTimeout(() => { overlay.classList.add('visible'); }, 30); function closeOverlay(withDismissUpdate) { overlay.classList.remove('visible'); setTimeout(() => { overlay.remove(); if (withDismissUpdate) { state.lastDismissed = Date.now(); state.dismissCount = dismissCount + 1; setStorageData(storageKey, state); } // nach JEDEM Schließen: Top Notification Bar anzeigen showNotificationBar(); }, 400); } document.getElementById("promoModalClose").addEventListener("click", () => { closeOverlay(false); }); const dismissEl = document.getElementById("dismissMessage"); if (dismissEl) { dismissEl.addEventListener("click", () => { closeOverlay(true); }); } const claimBtn = document.getElementById('claimBtn'); if (claimBtn) { claimBtn.addEventListener('click', function () { if (typeof country !== 'undefined') { fetch('https://wiegner.gmbh/announcement/log.php?country=' + country + '&clicked=true') .catch(() => {}); } }); } if (typeof country !== 'undefined') { fetch('https://wiegner.gmbh/announcement/log.php?country=' + country).catch(() => {}); } } // Sticky Notification Bar: wird in .sticky-top vor die Navbar gehängt function showNotificationBar() { let bar = document.getElementById('promoTopBar'); if (!bar) { bar = document.createElement('div'); bar.id = 'promoTopBar'; bar.innerHTML = ` 🔥 BLACK WEEKS END TONIGHT! ⏳ --:--:-- – Last chance to lock in 33% OFF ImagR before midnight. CLAIM 33% OFF → `; } // in .sticky-top einhängen, falls vorhanden const sticky = document.querySelector('.sticky-top'); if (sticky) { if (bar.parentNode !== sticky) { sticky.insertBefore(bar, sticky.firstChild); } } else { // Fallback: ganz oben in den Body if (!bar.parentNode) { document.body.insertBefore(bar, document.body.firstChild); } } // Countdown bis heute 23:59:59 in lokaler Zeitzone function startCountdown() { const countdownEl = bar.querySelector('#promoTopBarCountdown'); if (!countdownEl) return; if (bar._countdownInterval) { clearInterval(bar._countdownInterval); } function getTodayDeadline() { const now = new Date(); return new Date( now.getFullYear(), now.getMonth(), now.getDate(), 23, 59, 59, 999 ); } const deadline = getTodayDeadline(); function update() { const now = new Date(); const diff = deadline.getTime() - now.getTime(); if (diff <= 0) { countdownEl.textContent = '00:00:00'; clearInterval(bar._countdownInterval); return; } const totalSeconds = Math.floor(diff / 1000); const hours = String(Math.floor(totalSeconds / 3600)).padStart(2, '0'); const minutes = String(Math.floor((totalSeconds % 3600) / 60)).padStart(2, '0'); const seconds = String(totalSeconds % 60).padStart(2, '0'); countdownEl.textContent = `${hours}:${minutes}:${seconds}`; } update(); bar._countdownInterval = setInterval(update, 1000); } startCountdown(); const barCta = bar.querySelector('.bar-cta-link'); if (barCta && !barCta._promoBound) { barCta._promoBound = true; barCta.addEventListener('click', () => { if (typeof country !== 'undefined') { fetch('https://wiegner.gmbh/announcement/log.php?country=' + country + '&clicked=true') .catch(() => {}); } }); } // Ganze Bar klickbar machen (außer direkter CTA-Klick) if (!bar._promoBarClickBound) { bar._promoBarClickBound = true; bar.addEventListener('click', (e) => { if (e.target.closest('.bar-cta-link')) return; if (barCta) { barCta.click(); } }); } } 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(); } }