/******************************************** * Mailchimp popup slidein ********************************************/ document.addEventListener("DOMContentLoaded", function (event) { if (document.querySelector('.yikes-easy-mc-error-message') !== null) { mailChimpPopup.openImmediately(); } if (document.querySelector('.yikes-easy-mc-success-message') !== null) { mailChimpPopup.openImmediately(); mailChimpPopup.setCookie('true'); } if (!mailChimpPopup.isClosedBefore()) { window.setTimeout(function () { mailChimpPopup.open(); }, 3000); } var node = document.createElement("div"); node.className = "mailchimp slidein"; node.insertAdjacentHTML("beforeend", "
x
"); node.insertAdjacentHTML("beforeend", "

HELLO fellow human,

"); node.insertAdjacentHTML("beforeend", "

Please subscribe to the Submarine Channel newsletter. We will not bother you more than twice a month. Promise!

"); node.insertAdjacentHTML("beforeend", ""); document.body.appendChild(node); if (document.querySelector('.mailchimp.slidein .close') !== null) { document.querySelector('.mailchimp.slidein .close').addEventListener('click', function () { mailChimpPopup.close(); }); } }); var mailChimpPopup = new function () { this.cookieName = 'mailchimpPopupClosed'; this.isClosedBefore = function () { return this.getCookie() == 'true'; }; this.getCookie = function () { var name = this.cookieName + "="; var decodedCookie = decodeURIComponent(document.cookie); var ca = decodedCookie.split(';'); for (var i = 0; i < ca.length; i++) { var c = ca[i]; while (c.charAt(0) == ' ') { c = c.substring(1); } if (c.indexOf(name) == 0) { return c.substring(name.length, c.length); } } return ""; }; this.setCookie = function (value) { var d = new Date(); d.setTime(d.getTime() + (365 * 24 * 60 * 60 * 1000)); var expires = "expires=" + d.toUTCString(); document.cookie = this.cookieName + "=" + value + ";" + expires + ";path=/"; var request = new XMLHttpRequest(); request.withCredentials=true; request.open('GET', 'https://submarinechannel.com/mc/close.php', true); request.send(); }; this.openImmediately = function () { if (document.querySelector('.mailchimp.slidein').classList) { document.querySelector('.mailchimp.slidein').classList.add('open'); } else { document.querySelector('.mailchimp.slidein').className += ' open'; } }; this.open = function () { document.querySelector('.mailchimp.slidein').style.right = '40px'; }; this.close = function () { document.querySelector('.mailchimp.slidein').style.right = '-560px'; this.setCookie('true'); }; }; document.addEventListener("DOMContentLoaded", function (event) { var linkElement = document.createElement("link"); linkElement.setAttribute("rel", "stylesheet"); linkElement.setAttribute("type", "text/css"); linkElement.setAttribute("href", "data:text/css;charset=UTF-8," + encodeURIComponent(".mailchimp.slidein { position: fixed; bottom: 40px; right: -560px; transition: right 0.6s; width: 540px; background-color: #232326; padding: 30px; box-sizing: border-box; font-family: \'Arial\', sans-serif; border: 2px solid #fff; z-index: 2000;}@media (max-width: 630px) { .mailchimp.slidein { width: calc(100% - 70px); }}.mailchimp.slidein iframe { border:0; width: 100%; /* was calc(100% - 60px) */}@media (max-width: 630px) { .mailchimp.slidein iframe { height: 200px; }}.mailchimp.slidein.open { right: 40px; transition: right 0s;}.mailchimp.slidein p { margin-bottom: 10px; color: #acacac; font-size: 14px;}.mailchimp.slidein .close { position: absolute; right: 13px; top: 10px; font-size: 20px; display: block; border-radius: 41px; color: #232323; background-color: #acacac; width: 26px; height: 25px; line-height: 20px; text-align: center; cursor: pointer;}.mailchimp.slidein h3 { color: #acacac; font-size: 16px; margin: 0;}/* latin-ext */@font-face { font-family: \'Lato\'; font-style: normal; font-weight: 300; src: local(\'Lato Light\'), local(\'Lato-Light\'), url(https://submarinechannel.com/mc/S6u9w4BMUTPHh7USSwaPGQ3q5d0N7w.woff2) format(\'woff2\'); unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF;}/* latin */@font-face { font-family: \'Lato\'; font-style: normal; font-weight: 300; src: local(\'Lato Light\'), local(\'Lato-Light\'), url(https://submarinechannel.com/mc/S6u9w4BMUTPHh7USSwiPGQ3q5d0.woff2) format(\'woff2\'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;}/* latin-ext */@font-face { font-family: \'Lato\'; font-style: normal; font-weight: 700; src: local(\'Lato Bold\'), local(\'Lato-Bold\'), url(https://submarinechannel.com/mc/S6u9w4BMUTPHh6UVSwaPGQ3q5d0N7w.woff2) format(\'woff2\'); unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF;}/* latin */@font-face { font-family: \'Lato\'; font-style: normal; font-weight: 700; src: local(\'Lato Bold\'), local(\'Lato-Bold\'), url(https://submarinechannel.com/mc/S6u9w4BMUTPHh6UVSwiPGQ3q5d0.woff2) format(\'woff2\'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;}")); document.body.appendChild(linkElement); });