const StravaCookieBanner = { show: function(){ const name = '_strava_cookie_banner='; const decodedCookie = decodeURIComponent(document.cookie); const 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 false; } } return true; }, dismiss: function(){ document.cookie = '_strava_cookie_banner=true;expires=Fri, 31 Dec 9999 23:59:59 GMT;domain=.kirovsky-dv.ru;path=/;'; document.body.style.paddingBottom = '0'; document.body.removeChild(document.getElementById('stravaCookieBanner')); }, render: function(){ if (this.show()) { const message = "На Сайте используются рекомендательные технологии, применяются cookies и метрические программы. Просматривая этот сайт, вы соглашаетесь с нашей политикой в отношении файлов cookie."; const content = ""; const bannerCss = 'background-color: #e6e6eb; bottom: -1px; font-family: Helvetica, Arial, sans-serif; left: -1px; padding: 20px; position: fixed; right: -1px; z-index: 11000;'; const contentCss = 'align-items: center; color: #606065; display: flex; font-size: 12px; font-weight: 500; line-height: 1.45em; margin-left: auto; margin-right: auto; max-width: 1216px; justify-content: center;'; const linkCss = 'color: #222; font-weight: 700, text-decoration: none;'; const buttonCss = 'background: none; border: none; color: #222; cursor: pointer; display: inline-block; font-family: Helvetica, Arial, sans-serif; font-size: 24px; font-weight: 200; height: 24px; line-height: 0; margin-left: 20px; margin-top: -4px; margin-bottom: 0; padding: 0; width: 24px;'; const cookieBanner = document.createElement('div'); cookieBanner.setAttribute('id', 'stravaCookieBanner'); cookieBanner.innerHTML = content; cookieBanner.setAttribute('style', bannerCss); cookieBanner.getElementsByClassName('cookie-banner-content')[0].setAttribute('style', contentCss); cookieBanner.getElementsByTagName('a')[0].setAttribute('style', linkCss); const dismissButton = cookieBanner.getElementsByClassName('btn-dismiss-cookie-banner')[0]; dismissButton.setAttribute('style', buttonCss); document.body.insertBefore(cookieBanner, document.body.childNodes[0]); document.body.style.paddingBottom = cookieBanner.clientHeight + 'px'; dismissButton.addEventListener('click', this.dismiss); } } }