Această pagină web folosește cookie-uri și stocare locală (local storage) pentru a îmbunătăți experiența de navigare și a asigura funcționalițăți adiționale. În cazul în care nu le acceptați, anumite părți ale site-ului nu vor funcționa. Vezi detalii.
var t=document.querySelector('.navbar-toggler');var n=document.querySelector('.navbar-collapse.collapse');var s=document.querySelector('.navbar-search__icon');var m=document.querySelector('.modal-search');var c=document.querySelector('.navbar-search__close');var b=document.querySelector('body');const navigation=document.querySelector('.main-navigation');const delta=5;let lastScrollTop=0;const subscribeButtons=document.querySelectorAll('.subscribe_email_button');const instagramFollowers=document.querySelector('.count-instagram .count');const instagramFeedPics=document.querySelectorAll('.instagram__feed_list .item img');const instagramFeedLinks=document.querySelectorAll('.instagram__feed_list .item a');const acceptCookiesButton=document.querySelector('.accept-cookies');const refuseCookiesButton=document.querySelector('.refuse-cookies');const cookiesBar=document.querySelector('.cookies');document.addEventListener('DOMContentLoaded',(e)=>{fetch("/json/instagram/feed").then(response=>{return response.json();}).then(js=>{let i=0;console.log(js);instagramFeedPics.forEach(pic=>{pic.src=js.data[i].media_url;instagramFeedLinks[i].href=js.data[i].permalink;instagramFeedLinks[i].className='feed__'+js.data[i].media_type;i++;});}).catch(error=>{console.log(error)});t.addEventListener('click',(e)=>{t.classList.toggle('collapsed');n.classList.toggle('collapse');b.classList.toggle('modal-open');});s.addEventListener('click',(e)=>{e.preventDefault();if(!m.classList.contains('show')){m.classList.add('show');if(!b.classList.contains('modal-open')){b.classList.add('modal-open');}}});c.addEventListener('click',(e)=>{e.preventDefault();m.classList.toggle('show');b.classList.remove('modal-open');});if(localStorage.getItem("acceptCookies")==1){cookiesBar.classList.add("invisible");} acceptCookiesButton.addEventListener('click',(e)=>{localStorage.setItem("acceptCookies",1);if(!cookiesBar.classList.contains("invisible")){cookiesBar.classList.add("invisible");}});refuseCookiesButton.addEventListener('click',(e)=>{localStorage.clear();let cookies=document.cookie.split(";");let cookies_names=[];cookies.forEach((cookie)=>{cookies_names.push(cookie.split('=')[0]);});cookies_names.forEach((name)=>{document.cookie=name+'=;expires=Thu, 01 Jan 1970 00:00:01 GMT;path=/;';});if(!cookiesBar.classList.contains("invisible")){cookiesBar.classList.add("invisible");}});});window.addEventListener('scroll',()=>{hasScrolled();});const hasScrolled=()=>{const st=window.scrollY;if(Math.abs(lastScrollTop-st)<=delta) return;if(st>lastScrollTop){navigation.classList.remove('nav-show');navigation.classList.add('nav-hide');}else{if(st+window.innerHeight{const height=el.offsetHeight;const style=getComputedStyle(el);height+=parseInt(style.marginTop)+parseInt(style.marginBottom);return height;} for(let i=0;i{subscribeNewsletter(e);});} const subscribeNewsletter=(e)=>{if(e.target.dataset['email']){const selector=e.target.dataset['email'];const email=document.getElementsByName(selector)[0].value;const response=document.querySelector("."+selector+"_response");if(email){fetch('/subscribe',{method:'POST',headers:{'Content-Type':'application/x-www-form-urlencoded'},body:'email='+email}).then((r)=>{return r.json();}).then((data)=>{console.log(data);if(data.id){response.classList.remove("hide");response.innerHTML="Îți mulțumesc pentru abonare. În scurt timp vei primi un email pentru a confirma.";}});}else{response.classList.remove("hide");response.innerHTML="Trebuie să inserați o adresă de email";}}};