CINXE.COM
Error Page
<!DOCTYPE html> <html> <head> <title>Error Page</title> <meta charset="utf-8"> <link href="https://fonts.googleapis.com/css2?family=Noto+Serif&display=swap" rel="stylesheet"> <style> :root { --font-size-heading: 2.625rem; --font-size-content: 1.25rem; --font-size-button: 1rem; --button-padding: 1rem 2.5rem; } #error-container { display: flex; justify-content: center; align-items: center; height: 80vh; flex-direction: column; text-align: center; font-family: 'Noto Serif', serif; padding: 0 8rem; } #error-heading { margin-bottom: 0rem; font-size: var(--font-size-heading); } #error-content { font-size: var(--font-size-content); } #button { color: #00335A; border: 1px solid #13264A; border-radius: 2rem; padding: var(--button-padding); margin-top: 1rem; background: none; font-size: var(--font-size-button); text-decoration: none; } </style> <script src="https://subscription-static-global.nhst.tech/sub-zephr-error-templates/scripts/head_scripts.js?v=6" async></script> </head> <body> <div id="error-container" style="visibility: hidden"> <img id="logo" alt="Logo" src=""> <h1 id="error-heading">Sorry an error has occurred</h1> <p id="error-content">We are working to fix the problem and will be up and running shortly. In the meantime, you can refresh the page (sometimes this helps), or please try again in a few minutes.</p> <a id="button" href="/">Go back to front page</a> </div> <script> const runDefaultScripts = function () { document.querySelector("#error-container").style.visibility = "visible"; function setErrorPageContent() { const hostname = window.location.hostname; setTextContent(hostname); setLogoSource(hostname); } //setting text content function setTextContent(hostname) { const lang = hostname.endsWith('.no') ? 'no' : 'en'; const errorHeading = document.querySelector('#error-heading'); const errorContent = document.querySelector('#error-content'); const button = document.querySelector('#button'); const languageMap = { 'no': { 'error-heading': 'Beklager, en feil har oppst氓tt.', 'error-content': 'Vi jobber med 氓 l酶se problemet. Du kan fors酶ke 氓 oppdatere siden (noen ganger hjelper det), eller pr酶v igjen om noen minutter.', 'button': 'G氓 tilbake til forsiden', }, 'en': { 'error-heading': 'Sorry, an error has occurred.', 'error-content': 'We are working to fix the problem and will be up and running shortly.<br> In the meantime, you can refresh the page (sometimes this helps),<br> or please try again in a few minutes.', 'button': 'Go back to front page', } }; errorHeading.textContent = languageMap[lang]['error-heading']; errorContent.innerHTML = languageMap[lang]['error-content']; button.textContent = languageMap[lang].button; } //setting logo src function setLogoSource(hostname) { const logo = document.querySelector('#logo'); const domainMap = { 'dn.no': 'DN', 'tradewindsnews.com': 'TW', 'upstreamonline.com': 'UP', 'rechargenews.com': 'RE', 'intrafish.com': 'IFCO', 'intrafish.no': 'IFNO', 'europower.no': 'EP', 'fiskeribladet.no': 'FISK', 'hydrogeninsight.com': 'HY', 'kystens.no': 'KN', }; const logobaseUrl = 'https://subscription-static-global.nhst.tech/sub-zephr-error-templates/'; // Change with the actual URL when available console.log('Domain', domainMap); const logoSrc = getLogoSrc(hostname, logobaseUrl, domainMap); logo.src = logoSrc; } function getLogoSrc(hostname, logobaseUrl, domainMap) { const hostParts = hostname.split('.'); const hostSuffix = hostParts.slice(-2).join('.'); // Remove the first part of the host, i.e., www. etc. const dynamicUrlPart = domainMap[hostSuffix] || 'Default'; return logobaseUrl + dynamicUrlPart + '/logo.svg'; } async function run() { while (document.readyState === 'loading') { await new Promise(resolve => setTimeout(resolve, 500)); } setErrorPageContent(); } run(); } async function defaultWork() { for (let i = 0; i < 4; i += 1) { if (window.head_script_loaded && window.body_script_loaded) { return; } console.log(`Tried: ${i + 1}. Waiting for scripts to be loaded. Head Script Loaded: ${window.head_script_loaded || false}, Body Script Loaded: ${window.body_script_loaded || false}`); await new Promise(resolve => setTimeout(resolve, 500)); } console.log('Running default scripts') runDefaultScripts(); } defaultWork(); </script> <script src="https://subscription-static-global.nhst.tech/sub-zephr-error-templates/scripts/body_scripts.js" async></script> </body> </html>