From 6b059b96baf039a1b4a494b3bf812cee8fb420c1 Mon Sep 17 00:00:00 2001 From: ViktorSvertoka Date: Sun, 17 Dec 2023 18:34:00 +0000 Subject: [PATCH] =?UTF-8?q?Deploying=20to=20gh-pages=20from=20@=20ViktorSv?= =?UTF-8?q?ertoka/your-energy@42bb34e10c8c6571f178a3a652032f0eb8b4ceb5=20?= =?UTF-8?q?=F0=9F=9A=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- assets/{index-91a66dfe.js => index-75956a8d.js} | 16 ++++++++-------- index.html | 2 +- 2 files changed, 9 insertions(+), 9 deletions(-) rename assets/{index-91a66dfe.js => index-75956a8d.js} (60%) diff --git a/assets/index-91a66dfe.js b/assets/index-75956a8d.js similarity index 60% rename from assets/index-91a66dfe.js rename to assets/index-75956a8d.js index fb53658..91c9644 100644 --- a/assets/index-91a66dfe.js +++ b/assets/index-75956a8d.js @@ -1,13 +1,13 @@ -import{A as U,a as de,i as N}from"./05-modal-exercises-96cc9cd3.js";const ue=new U,X=document.querySelector(".js-list");V("Muscles");async function V(a){try{const u=await ue.getFilter(a);fe(u)}catch(u){console.log(u)}}function fe(a){const u=a.map(({filter:p,name:f,imgURL:i})=>` +import{A as U,a as de,i as N}from"./05-modal-exercises-96cc9cd3.js";const ue=new U,X=document.querySelector(".js-list");V("Muscles");async function V(a){try{const u=await ue.getFilter(a);fe(u)}catch(u){console.log(u)}}function fe(a){const u=a.map(({filter:p,name:f,imgURL:n})=>`
  • - +

    ${p}

    ${f}

  • - `).join("");X.insertAdjacentHTML("beforeend",u)}document.querySelectorAll(".btnFilters").forEach(a=>{a.addEventListener("click",()=>{const u=a.innerText;X.innerHTML="",V(u)})});const pe=document.querySelector(".footer__link"),S=document.querySelector(".team__backdrop"),P=document.querySelector(".team__modal-close-btn");function me(a){a.preventDefault(),S.classList.remove("is-hidden"),document.body.classList.add("modal-open"),ge()}function $(a){a.preventDefault(),a.code==="Escape"&&q()}function Y(a){a.target.closest(".team__wrapper")||q()}function K(a){a.preventDefault(),q()}function ge(){document.addEventListener("keydown",$),S.addEventListener("click",Y),P.addEventListener("click",K)}function q(){document.removeEventListener("keydown",$),S.removeEventListener("click",Y),P.removeEventListener("click",K),S.classList.add("is-hidden"),document.body.classList.remove("modal-open")}pe.addEventListener("click",me);const R=document.querySelector(".scroll__go-top");R.addEventListener("click",J);window.addEventListener("scroll",ve);function ve(){const a=window.pageYOffset,u=document.documentElement.clientHeight;a>u?R.classList.add("scroll__go-top--show"):R.classList.remove("scroll__go-top--show")}function J(){window.pageYOffset>0&&(window.scrollBy(0,-75),setTimeout(J,0))}var I=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function ye(a){return a&&a.__esModule&&Object.prototype.hasOwnProperty.call(a,"default")?a.default:a}var Q={exports:{}};(function(a,u){(function(p,f){a.exports=f(p)})(typeof I<"u"?I:window||I.window||I.global,function(p){var f={},i="iziToast";document.querySelector("body");var h=!!/Mobi/.test(navigator.userAgent),B=/Chrome/.test(navigator.userAgent)&&/Google Inc/.test(navigator.vendor),M=typeof InstallTrigger<"u",L="ontouchstart"in document.documentElement,j=["bottomRight","bottomLeft","bottomCenter","topRight","topLeft","topCenter","center"],oe={info:{color:"blue",icon:"ico-info"},success:{color:"green",icon:"ico-success"},warning:{color:"orange",icon:"ico-warning"},error:{color:"red",icon:"ico-error"},question:{color:"yellow",icon:"ico-question"}},E=568,w={};f.children={};var O={id:null,class:"",title:"",titleColor:"",titleSize:"",titleLineHeight:"",message:"",messageColor:"",messageSize:"",messageLineHeight:"",backgroundColor:"",theme:"light",color:"",icon:"",iconText:"",iconColor:"",iconUrl:null,image:"",imageWidth:50,maxWidth:null,zindex:null,layout:1,balloon:!1,close:!0,closeOnEscape:!1,closeOnClick:!1,displayMode:0,position:"bottomRight",target:"",targetFirst:!0,timeout:5e3,rtl:!1,animateInside:!0,drag:!0,pauseOnHover:!0,resetOnHover:!1,progressBar:!0,progressBarColor:"",progressBarEasing:"linear",overlay:!1,overlayClose:!1,overlayColor:"rgba(0, 0, 0, 0.6)",transitionIn:"fadeInUp",transitionOut:"fadeOut",transitionInMobile:"fadeInUp",transitionOutMobile:"fadeOutDown",buttons:{},inputs:{},onOpening:function(){},onOpened:function(){},onClosing:function(){},onClosed:function(){}};if("remove"in Element.prototype||(Element.prototype.remove=function(){this.parentNode&&this.parentNode.removeChild(this)}),typeof window.CustomEvent!="function"){var F=function(o,n){n=n||{bubbles:!1,cancelable:!1,detail:void 0};var e=document.createEvent("CustomEvent");return e.initCustomEvent(o,n.bubbles,n.cancelable,n.detail),e};F.prototype=window.Event.prototype,window.CustomEvent=F}var g=function(o,n,e){if(Object.prototype.toString.call(o)==="[object Object]")for(var t in o)Object.prototype.hasOwnProperty.call(o,t)&&n.call(e,o[t],t,o);else if(o)for(var r=0,c=o.length;r0?(r=(s-t)/s,r"u"&&(n.classList.remove(i+"-reseted"),s!==null&&(s.style.transition="width "+c.timeout+"ms "+c.progressBarEasing,s.style.width="0%"),c.time.START=new Date().getTime(),c.time.END=c.time.START+c.timeout,c.time.TIMER=setTimeout(function(){clearTimeout(c.time.TIMER),n.classList.contains(i+"-closing")||(t.hide(c,n,"timeout"),typeof e=="function"&&e.apply(t))},c.timeout),t.setSetting(r,"time",c.time))},pause:function(){if(typeof c.time.START<"u"&&!n.classList.contains(i+"-paused")&&!n.classList.contains(i+"-reseted")){if(n.classList.add(i+"-paused"),c.time.REMAINING=c.time.END-new Date().getTime(),clearTimeout(c.time.TIMER),t.setSetting(r,"time",c.time),s!==null){var l=window.getComputedStyle(s),d=l.getPropertyValue("width");s.style.transition="none",s.style.width=d}typeof e=="function"&&setTimeout(function(){e.apply(t)},10)}},resume:function(){typeof c.time.REMAINING<"u"?(n.classList.remove(i+"-paused"),s!==null&&(s.style.transition="width "+c.time.REMAINING+"ms "+c.progressBarEasing,s.style.width="0%"),c.time.END=new Date().getTime()+c.time.REMAINING,c.time.TIMER=setTimeout(function(){clearTimeout(c.time.TIMER),n.classList.contains(i+"-closing")||(t.hide(c,n,"timeout"),typeof e=="function"&&e.apply(t))},c.time.REMAINING),t.setSetting(r,"time",c.time)):this.start()},reset:function(){clearTimeout(c.time.TIMER),delete c.time.REMAINING,t.setSetting(r,"time",c.time),n.classList.add(i+"-reseted"),n.classList.remove(i+"-paused"),s!==null&&(s.style.transition="none",s.style.width="100%"),typeof e=="function"&&setTimeout(function(){e.apply(t)},10)}}},f.hide=function(o,n,e){typeof n!="object"&&(n=document.querySelector(n));var t=this,r=v(this.children[n.getAttribute("data-iziToast-ref")],o||{});r.closedBy=e||null,delete r.time.REMAINING,n.classList.add(i+"-closing"),function(){var l=document.querySelector("."+i+"-overlay");if(l!==null){var d=l.getAttribute("data-iziToast-ref");d=d.split(",");var m=d.indexOf(String(r.ref));m!==-1&&d.splice(m,1),l.setAttribute("data-iziToast-ref",d.join()),d.length===0&&(l.classList.remove("fadeIn"),l.classList.add("fadeOut"),setTimeout(function(){l.remove()},700))}}(),r.transitionIn&&n.classList.remove(r.transitionIn),r.transitionInMobile&&n.classList.remove(r.transitionInMobile),h||window.innerWidth<=E?r.transitionOutMobile&&n.classList.add(r.transitionOutMobile):r.transitionOut&&n.classList.add(r.transitionOut);var c=n.parentNode.offsetHeight;n.parentNode.style.height=c+"px",n.style.pointerEvents="none",(!h||window.innerWidth>E)&&(n.parentNode.style.transitionDelay="0.2s");try{var s=new CustomEvent(i+"-closing",{detail:r,bubbles:!0,cancelable:!0});document.dispatchEvent(s)}catch(l){console.warn(l)}setTimeout(function(){n.parentNode.style.height="0px",n.parentNode.style.overflow="",setTimeout(function(){delete t.children[r.ref],n.parentNode.remove();try{var l=new CustomEvent(i+"-closed",{detail:r,bubbles:!0,cancelable:!0});document.dispatchEvent(l)}catch(d){console.warn(d)}typeof r.onClosed<"u"&&r.onClosed.apply(null,[r,n,e])},1e3)},200),typeof r.onClosing<"u"&&r.onClosing.apply(null,[r,n,e])},f.show=function(o){var n=this,e=v(w,o||{});if(e=v(O,e),e.time={},e.id===null&&(e.id=re(e.title+e.message+e.color)),e.displayMode===1||e.displayMode=="once")try{if(document.querySelectorAll("."+i+"#"+e.id).length>0)return!1}catch{console.warn("["+i+"] Could not find an element with this selector: #"+e.id+". Try to set an valid id.")}if(e.displayMode===2||e.displayMode=="replace")try{g(document.querySelectorAll("."+i+"#"+e.id),function(s,l){n.hide(e,s,"replaced")})}catch{console.warn("["+i+"] Could not find an element with this selector: #"+e.id+". Try to set an valid id.")}e.ref=new Date().getTime()+Math.floor(Math.random()*1e7+1),f.children[e.ref]=e;var t={body:document.querySelector("body"),overlay:document.createElement("div"),toast:document.createElement("div"),toastBody:document.createElement("div"),toastTexts:document.createElement("div"),toastCapsule:document.createElement("div"),cover:document.createElement("div"),buttons:document.createElement("div"),inputs:document.createElement("div"),icon:e.iconUrl?document.createElement("img"):document.createElement("i"),wrapper:null};t.toast.setAttribute("data-iziToast-ref",e.ref),t.toast.appendChild(t.toastBody),t.toastCapsule.appendChild(t.toast),function(){if(t.toast.classList.add(i),t.toast.classList.add(i+"-opening"),t.toastCapsule.classList.add(i+"-capsule"),t.toastBody.classList.add(i+"-body"),t.toastTexts.classList.add(i+"-texts"),h||window.innerWidth<=E?e.transitionInMobile&&t.toast.classList.add(e.transitionInMobile):e.transitionIn&&t.toast.classList.add(e.transitionIn),e.class){var s=e.class.split(" ");g(s,function(l,d){t.toast.classList.add(l)})}e.id&&(t.toast.id=e.id),e.rtl&&(t.toast.classList.add(i+"-rtl"),t.toast.setAttribute("dir","rtl")),e.layout>1&&t.toast.classList.add(i+"-layout"+e.layout),e.balloon&&t.toast.classList.add(i+"-balloon"),e.maxWidth&&(isNaN(e.maxWidth)?t.toast.style.maxWidth=e.maxWidth:t.toast.style.maxWidth=e.maxWidth+"px"),(e.theme!==""||e.theme!=="light")&&t.toast.classList.add(i+"-theme-"+e.theme),e.color&&(ae(e.color)?t.toast.style.background=e.color:t.toast.classList.add(i+"-color-"+e.color)),e.backgroundColor&&(t.toast.style.background=e.backgroundColor,e.balloon&&(t.toast.style.borderColor=e.backgroundColor))}(),function(){e.image&&(t.cover.classList.add(i+"-cover"),t.cover.style.width=e.imageWidth+"px",le(e.image.replace(/ /g,""))?t.cover.style.backgroundImage="url(data:image/png;base64,"+e.image.replace(/ /g,"")+")":t.cover.style.backgroundImage="url("+e.image+")",e.rtl?t.toastBody.style.marginRight=e.imageWidth+10+"px":t.toastBody.style.marginLeft=e.imageWidth+10+"px",t.toast.appendChild(t.cover))}(),function(){e.close?(t.buttonClose=document.createElement("button"),t.buttonClose.type="button",t.buttonClose.classList.add(i+"-close"),t.buttonClose.addEventListener("click",function(s){s.target,n.hide(e,t.toast,"button")}),t.toast.appendChild(t.buttonClose)):e.rtl?t.toast.style.paddingLeft="18px":t.toast.style.paddingRight="18px"}(),function(){e.progressBar&&(t.progressBar=document.createElement("div"),t.progressBarDiv=document.createElement("div"),t.progressBar.classList.add(i+"-progressbar"),t.progressBarDiv.style.background=e.progressBarColor,t.progressBar.appendChild(t.progressBarDiv),t.toast.appendChild(t.progressBar)),e.timeout&&(e.pauseOnHover&&!e.resetOnHover&&(t.toast.addEventListener("mouseenter",function(s){n.progress(e,t.toast).pause()}),t.toast.addEventListener("mouseleave",function(s){n.progress(e,t.toast).resume()})),e.resetOnHover&&(t.toast.addEventListener("mouseenter",function(s){n.progress(e,t.toast).reset()}),t.toast.addEventListener("mouseleave",function(s){n.progress(e,t.toast).start()})))}(),function(){e.iconUrl?(t.icon.setAttribute("class",i+"-icon"),t.icon.setAttribute("src",e.iconUrl)):e.icon&&(t.icon.setAttribute("class",i+"-icon "+e.icon),e.iconText&&t.icon.appendChild(document.createTextNode(e.iconText)),e.iconColor&&(t.icon.style.color=e.iconColor)),(e.icon||e.iconUrl)&&(e.rtl?t.toastBody.style.paddingRight="33px":t.toastBody.style.paddingLeft="33px",t.toastBody.appendChild(t.icon))}(),function(){e.title.length>0&&(t.strong=document.createElement("strong"),t.strong.classList.add(i+"-title"),t.strong.appendChild(C(e.title)),t.toastTexts.appendChild(t.strong),e.titleColor&&(t.strong.style.color=e.titleColor),e.titleSize&&(isNaN(e.titleSize)?t.strong.style.fontSize=e.titleSize:t.strong.style.fontSize=e.titleSize+"px"),e.titleLineHeight&&(isNaN(e.titleSize)?t.strong.style.lineHeight=e.titleLineHeight:t.strong.style.lineHeight=e.titleLineHeight+"px")),e.message.length>0&&(t.p=document.createElement("p"),t.p.classList.add(i+"-message"),t.p.appendChild(C(e.message)),t.toastTexts.appendChild(t.p),e.messageColor&&(t.p.style.color=e.messageColor),e.messageSize&&(isNaN(e.titleSize)?t.p.style.fontSize=e.messageSize:t.p.style.fontSize=e.messageSize+"px"),e.messageLineHeight&&(isNaN(e.titleSize)?t.p.style.lineHeight=e.messageLineHeight:t.p.style.lineHeight=e.messageLineHeight+"px")),e.title.length>0&&e.message.length>0&&(e.rtl?t.strong.style.marginLeft="10px":e.layout!==2&&!e.rtl&&(t.strong.style.marginRight="10px"))}(),t.toastBody.appendChild(t.toastTexts);var r;(function(){e.inputs.length>0&&(t.inputs.classList.add(i+"-inputs"),g(e.inputs,function(s,l){t.inputs.appendChild(C(s[0])),r=t.inputs.childNodes,r[l].classList.add(i+"-inputs-child"),s[3]&&setTimeout(function(){r[l].focus()},300),r[l].addEventListener(s[1],function(d){var m=s[2];return m(n,t.toast,this,d)})}),t.toastBody.appendChild(t.inputs))})(),function(){e.buttons.length>0&&(t.buttons.classList.add(i+"-buttons"),g(e.buttons,function(s,l){t.buttons.appendChild(C(s[0]));var d=t.buttons.childNodes;d[l].classList.add(i+"-buttons-child"),s[2]&&setTimeout(function(){d[l].focus()},300),d[l].addEventListener("click",function(m){m.preventDefault();var ce=s[1];return ce(n,t.toast,this,m,r)})})),t.toastBody.appendChild(t.buttons)}(),e.message.length>0&&(e.inputs.length>0||e.buttons.length>0)&&(t.p.style.marginBottom="0"),(e.inputs.length>0||e.buttons.length>0)&&(e.rtl?t.toastTexts.style.marginLeft="10px":t.toastTexts.style.marginRight="10px",e.inputs.length>0&&e.buttons.length>0&&(e.rtl?t.inputs.style.marginLeft="8px":t.inputs.style.marginRight="8px")),function(){t.toastCapsule.style.visibility="hidden",setTimeout(function(){var s=t.toast.offsetHeight,l=t.toast.currentStyle||window.getComputedStyle(t.toast),d=l.marginTop;d=d.split("px"),d=parseInt(d[0]);var m=l.marginBottom;m=m.split("px"),m=parseInt(m[0]),t.toastCapsule.style.visibility="",t.toastCapsule.style.height=s+m+d+"px",setTimeout(function(){t.toastCapsule.style.height="auto",e.target&&(t.toastCapsule.style.overflow="visible")},500),e.timeout&&n.progress(e,t.toast).start()},100)}(),function(){var s=e.position;if(e.target)t.wrapper=document.querySelector(e.target),t.wrapper.classList.add(i+"-target"),e.targetFirst?t.wrapper.insertBefore(t.toastCapsule,t.wrapper.firstChild):t.wrapper.appendChild(t.toastCapsule);else{if(j.indexOf(e.position)==-1){console.warn("["+i+`] Incorrect position. -It can be › `+j);return}h||window.innerWidth<=E?e.position=="bottomLeft"||e.position=="bottomRight"||e.position=="bottomCenter"?s=i+"-wrapper-bottomCenter":e.position=="topLeft"||e.position=="topRight"||e.position=="topCenter"?s=i+"-wrapper-topCenter":s=i+"-wrapper-center":s=i+"-wrapper-"+s,t.wrapper=document.querySelector("."+i+"-wrapper."+s),t.wrapper||(t.wrapper=document.createElement("div"),t.wrapper.classList.add(i+"-wrapper"),t.wrapper.classList.add(s),document.body.appendChild(t.wrapper)),e.position=="topLeft"||e.position=="topCenter"||e.position=="topRight"?t.wrapper.insertBefore(t.toastCapsule,t.wrapper.firstChild):t.wrapper.appendChild(t.toastCapsule)}isNaN(e.zindex)?console.warn("["+i+"] Invalid zIndex."):t.wrapper.style.zIndex=e.zindex}(),function(){e.overlay&&(document.querySelector("."+i+"-overlay.fadeIn")!==null?(t.overlay=document.querySelector("."+i+"-overlay"),t.overlay.setAttribute("data-iziToast-ref",t.overlay.getAttribute("data-iziToast-ref")+","+e.ref),!isNaN(e.zindex)&&e.zindex!==null&&(t.overlay.style.zIndex=e.zindex-1)):(t.overlay.classList.add(i+"-overlay"),t.overlay.classList.add("fadeIn"),t.overlay.style.background=e.overlayColor,t.overlay.setAttribute("data-iziToast-ref",e.ref),!isNaN(e.zindex)&&e.zindex!==null&&(t.overlay.style.zIndex=e.zindex-1),document.querySelector("body").appendChild(t.overlay)),e.overlayClose?(t.overlay.removeEventListener("click",{}),t.overlay.addEventListener("click",function(s){n.hide(e,t.toast,"overlay")})):t.overlay.removeEventListener("click",{}))}(),function(){if(e.animateInside){t.toast.classList.add(i+"-animateInside");var s=[200,100,300];(e.transitionIn=="bounceInLeft"||e.transitionIn=="bounceInRight")&&(s=[400,200,400]),e.title.length>0&&setTimeout(function(){t.strong.classList.add("slideIn")},s[0]),e.message.length>0&&setTimeout(function(){t.p.classList.add("slideIn")},s[1]),(e.icon||e.iconUrl)&&setTimeout(function(){t.icon.classList.add("revealIn")},s[2]);var l=150;e.buttons.length>0&&t.buttons&&setTimeout(function(){g(t.buttons.childNodes,function(d,m){setTimeout(function(){d.classList.add("revealIn")},l),l=l+150})},e.inputs.length>0?150:0),e.inputs.length>0&&t.inputs&&(l=150,g(t.inputs.childNodes,function(d,m){setTimeout(function(){d.classList.add("revealIn")},l),l=l+150}))}}(),e.onOpening.apply(null,[e,t.toast]);try{var c=new CustomEvent(i+"-opening",{detail:e,bubbles:!0,cancelable:!0});document.dispatchEvent(c)}catch(s){console.warn(s)}setTimeout(function(){t.toast.classList.remove(i+"-opening"),t.toast.classList.add(i+"-opened");try{var s=new CustomEvent(i+"-opened",{detail:e,bubbles:!0,cancelable:!0});document.dispatchEvent(s)}catch(l){console.warn(l)}e.onOpened.apply(null,[e,t.toast])},1e3),e.drag&&(L?(t.toast.addEventListener("touchstart",function(s){b.startMoving(this,n,e,s)},!1),t.toast.addEventListener("touchend",function(s){b.stopMoving(this,s)},!1)):(t.toast.addEventListener("mousedown",function(s){s.preventDefault(),b.startMoving(this,n,e,s)},!1),t.toast.addEventListener("mouseup",function(s){s.preventDefault(),b.stopMoving(this,s)},!1))),e.closeOnEscape&&document.addEventListener("keyup",function(s){s=s||window.event,s.keyCode==27&&n.hide(e,t.toast,"esc")}),e.closeOnClick&&t.toast.addEventListener("click",function(s){n.hide(e,t.toast,"toast")}),n.toast=t.toast},f})})(Q);var he=Q.exports;const z=ye(he);const A={timeout:3e3,close:!1,closeOnClick:!0,icon:null,position:"topRight",transitionIn:"fadeInDown",transitionOut:"fadeOutUp"};class T{static success(u){z.success({title:"OK",titleColor:"green",message:u,messageColor:"green",progressBarColor:"green",...A})}static error(u){z.error({title:"Error",titleColor:"red",message:u,messageColor:"red",progressBarColor:"red",...A})}static warning(u){z.warning({title:"Caution",message:u,titleColor:"red",messageColor:"red",progressBarColor:"red",...A})}}const _=document.getElementById("subscribeForm"),Z=_.querySelector('input[name="email"]'),G=document.getElementById("subscribeBtn");Z.addEventListener("input",Le);_.addEventListener("submit",Ee);function be(a){return/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(a)}function Le(){Z.value}async function Ee(a){a.preventDefault();const u=new FormData(_),p=u.get("email");if(!be(p))return console.error("Invalid email address"),T.error("Invalid email address");try{G.disabled=!0;const i=await de.post("https://your-energy.b.goit.study/api/subscription",u,{headers:{"Content-Type":"application/json"}});return i.status>=200&&i.status<300?(_.reset(),T.success(`${i.data.message}`)):(console.error("Server Error:",i.status,i.statusText),T.error(`Server Error: ${i.status} ${i.statusText}`))}catch(i){return console.error("Error:",i.message),T.error(`Error: ${i.message}`)}finally{G.disabled=!1}}const we=new U,D=document.querySelector(".js-list");D.addEventListener("click",Ce);async function Ce(a){if(!a.target.closest(".filters__item"))return;const u=a.target.closest(".filters__item");let p=u.lastElementChild.children[0].innerText.toLowerCase().replace(/\s/g,"");const f=u.lastElementChild.children[1].innerText.toLowerCase().replace(/\s/g,"%20");p==="bodyparts"&&(p="bodypart");try{const i=await we.getExercises(p,f);Ie(i)}catch(i){console.log(i)}}function Ie(a){D.innerHTML="";const u=a.map(({_id:p,rating:f,name:i,burnedCalories:h,bodyPart:B,target:M})=>` + `).join("");X.insertAdjacentHTML("beforeend",u)}document.querySelectorAll(".btnFilters").forEach(a=>{a.addEventListener("click",()=>{const u=a.innerText;X.innerHTML="",V(u)})});const pe=document.querySelector(".footer__link"),S=document.querySelector(".team__backdrop"),P=document.querySelector(".team__modal-close-btn");function me(a){a.preventDefault(),S.classList.remove("is-hidden"),document.body.classList.add("modal-open"),ge()}function $(a){a.preventDefault(),a.code==="Escape"&&q()}function Y(a){a.target.closest(".team__wrapper")||q()}function K(a){a.preventDefault(),q()}function ge(){document.addEventListener("keydown",$),S.addEventListener("click",Y),P.addEventListener("click",K)}function q(){document.removeEventListener("keydown",$),S.removeEventListener("click",Y),P.removeEventListener("click",K),S.classList.add("is-hidden"),document.body.classList.remove("modal-open")}pe.addEventListener("click",me);const R=document.querySelector(".scroll__go-top");R.addEventListener("click",J);window.addEventListener("scroll",ve);function ve(){const a=window.pageYOffset,u=document.documentElement.clientHeight;a>u?R.classList.add("scroll__go-top--show"):R.classList.remove("scroll__go-top--show")}function J(){window.pageYOffset>0&&(window.scrollBy(0,-75),setTimeout(J,0))}var I=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function ye(a){return a&&a.__esModule&&Object.prototype.hasOwnProperty.call(a,"default")?a.default:a}var Q={exports:{}};(function(a,u){(function(p,f){a.exports=f(p)})(typeof I<"u"?I:window||I.window||I.global,function(p){var f={},n="iziToast";document.querySelector("body");var h=!!/Mobi/.test(navigator.userAgent),M=/Chrome/.test(navigator.userAgent)&&/Google Inc/.test(navigator.vendor),B=typeof InstallTrigger<"u",L="ontouchstart"in document.documentElement,j=["bottomRight","bottomLeft","bottomCenter","topRight","topLeft","topCenter","center"],oe={info:{color:"blue",icon:"ico-info"},success:{color:"green",icon:"ico-success"},warning:{color:"orange",icon:"ico-warning"},error:{color:"red",icon:"ico-error"},question:{color:"yellow",icon:"ico-question"}},E=568,w={};f.children={};var O={id:null,class:"",title:"",titleColor:"",titleSize:"",titleLineHeight:"",message:"",messageColor:"",messageSize:"",messageLineHeight:"",backgroundColor:"",theme:"light",color:"",icon:"",iconText:"",iconColor:"",iconUrl:null,image:"",imageWidth:50,maxWidth:null,zindex:null,layout:1,balloon:!1,close:!0,closeOnEscape:!1,closeOnClick:!1,displayMode:0,position:"bottomRight",target:"",targetFirst:!0,timeout:5e3,rtl:!1,animateInside:!0,drag:!0,pauseOnHover:!0,resetOnHover:!1,progressBar:!0,progressBarColor:"",progressBarEasing:"linear",overlay:!1,overlayClose:!1,overlayColor:"rgba(0, 0, 0, 0.6)",transitionIn:"fadeInUp",transitionOut:"fadeOut",transitionInMobile:"fadeInUp",transitionOutMobile:"fadeOutDown",buttons:{},inputs:{},onOpening:function(){},onOpened:function(){},onClosing:function(){},onClosed:function(){}};if("remove"in Element.prototype||(Element.prototype.remove=function(){this.parentNode&&this.parentNode.removeChild(this)}),typeof window.CustomEvent!="function"){var F=function(o,i){i=i||{bubbles:!1,cancelable:!1,detail:void 0};var e=document.createEvent("CustomEvent");return e.initCustomEvent(o,i.bubbles,i.cancelable,i.detail),e};F.prototype=window.Event.prototype,window.CustomEvent=F}var g=function(o,i,e){if(Object.prototype.toString.call(o)==="[object Object]")for(var t in o)Object.prototype.hasOwnProperty.call(o,t)&&i.call(e,o[t],t,o);else if(o)for(var r=0,c=o.length;r0?(r=(s-t)/s,r"u"&&(i.classList.remove(n+"-reseted"),s!==null&&(s.style.transition="width "+c.timeout+"ms "+c.progressBarEasing,s.style.width="0%"),c.time.START=new Date().getTime(),c.time.END=c.time.START+c.timeout,c.time.TIMER=setTimeout(function(){clearTimeout(c.time.TIMER),i.classList.contains(n+"-closing")||(t.hide(c,i,"timeout"),typeof e=="function"&&e.apply(t))},c.timeout),t.setSetting(r,"time",c.time))},pause:function(){if(typeof c.time.START<"u"&&!i.classList.contains(n+"-paused")&&!i.classList.contains(n+"-reseted")){if(i.classList.add(n+"-paused"),c.time.REMAINING=c.time.END-new Date().getTime(),clearTimeout(c.time.TIMER),t.setSetting(r,"time",c.time),s!==null){var l=window.getComputedStyle(s),d=l.getPropertyValue("width");s.style.transition="none",s.style.width=d}typeof e=="function"&&setTimeout(function(){e.apply(t)},10)}},resume:function(){typeof c.time.REMAINING<"u"?(i.classList.remove(n+"-paused"),s!==null&&(s.style.transition="width "+c.time.REMAINING+"ms "+c.progressBarEasing,s.style.width="0%"),c.time.END=new Date().getTime()+c.time.REMAINING,c.time.TIMER=setTimeout(function(){clearTimeout(c.time.TIMER),i.classList.contains(n+"-closing")||(t.hide(c,i,"timeout"),typeof e=="function"&&e.apply(t))},c.time.REMAINING),t.setSetting(r,"time",c.time)):this.start()},reset:function(){clearTimeout(c.time.TIMER),delete c.time.REMAINING,t.setSetting(r,"time",c.time),i.classList.add(n+"-reseted"),i.classList.remove(n+"-paused"),s!==null&&(s.style.transition="none",s.style.width="100%"),typeof e=="function"&&setTimeout(function(){e.apply(t)},10)}}},f.hide=function(o,i,e){typeof i!="object"&&(i=document.querySelector(i));var t=this,r=v(this.children[i.getAttribute("data-iziToast-ref")],o||{});r.closedBy=e||null,delete r.time.REMAINING,i.classList.add(n+"-closing"),function(){var l=document.querySelector("."+n+"-overlay");if(l!==null){var d=l.getAttribute("data-iziToast-ref");d=d.split(",");var m=d.indexOf(String(r.ref));m!==-1&&d.splice(m,1),l.setAttribute("data-iziToast-ref",d.join()),d.length===0&&(l.classList.remove("fadeIn"),l.classList.add("fadeOut"),setTimeout(function(){l.remove()},700))}}(),r.transitionIn&&i.classList.remove(r.transitionIn),r.transitionInMobile&&i.classList.remove(r.transitionInMobile),h||window.innerWidth<=E?r.transitionOutMobile&&i.classList.add(r.transitionOutMobile):r.transitionOut&&i.classList.add(r.transitionOut);var c=i.parentNode.offsetHeight;i.parentNode.style.height=c+"px",i.style.pointerEvents="none",(!h||window.innerWidth>E)&&(i.parentNode.style.transitionDelay="0.2s");try{var s=new CustomEvent(n+"-closing",{detail:r,bubbles:!0,cancelable:!0});document.dispatchEvent(s)}catch(l){console.warn(l)}setTimeout(function(){i.parentNode.style.height="0px",i.parentNode.style.overflow="",setTimeout(function(){delete t.children[r.ref],i.parentNode.remove();try{var l=new CustomEvent(n+"-closed",{detail:r,bubbles:!0,cancelable:!0});document.dispatchEvent(l)}catch(d){console.warn(d)}typeof r.onClosed<"u"&&r.onClosed.apply(null,[r,i,e])},1e3)},200),typeof r.onClosing<"u"&&r.onClosing.apply(null,[r,i,e])},f.show=function(o){var i=this,e=v(w,o||{});if(e=v(O,e),e.time={},e.id===null&&(e.id=re(e.title+e.message+e.color)),e.displayMode===1||e.displayMode=="once")try{if(document.querySelectorAll("."+n+"#"+e.id).length>0)return!1}catch{console.warn("["+n+"] Could not find an element with this selector: #"+e.id+". Try to set an valid id.")}if(e.displayMode===2||e.displayMode=="replace")try{g(document.querySelectorAll("."+n+"#"+e.id),function(s,l){i.hide(e,s,"replaced")})}catch{console.warn("["+n+"] Could not find an element with this selector: #"+e.id+". Try to set an valid id.")}e.ref=new Date().getTime()+Math.floor(Math.random()*1e7+1),f.children[e.ref]=e;var t={body:document.querySelector("body"),overlay:document.createElement("div"),toast:document.createElement("div"),toastBody:document.createElement("div"),toastTexts:document.createElement("div"),toastCapsule:document.createElement("div"),cover:document.createElement("div"),buttons:document.createElement("div"),inputs:document.createElement("div"),icon:e.iconUrl?document.createElement("img"):document.createElement("i"),wrapper:null};t.toast.setAttribute("data-iziToast-ref",e.ref),t.toast.appendChild(t.toastBody),t.toastCapsule.appendChild(t.toast),function(){if(t.toast.classList.add(n),t.toast.classList.add(n+"-opening"),t.toastCapsule.classList.add(n+"-capsule"),t.toastBody.classList.add(n+"-body"),t.toastTexts.classList.add(n+"-texts"),h||window.innerWidth<=E?e.transitionInMobile&&t.toast.classList.add(e.transitionInMobile):e.transitionIn&&t.toast.classList.add(e.transitionIn),e.class){var s=e.class.split(" ");g(s,function(l,d){t.toast.classList.add(l)})}e.id&&(t.toast.id=e.id),e.rtl&&(t.toast.classList.add(n+"-rtl"),t.toast.setAttribute("dir","rtl")),e.layout>1&&t.toast.classList.add(n+"-layout"+e.layout),e.balloon&&t.toast.classList.add(n+"-balloon"),e.maxWidth&&(isNaN(e.maxWidth)?t.toast.style.maxWidth=e.maxWidth:t.toast.style.maxWidth=e.maxWidth+"px"),(e.theme!==""||e.theme!=="light")&&t.toast.classList.add(n+"-theme-"+e.theme),e.color&&(ae(e.color)?t.toast.style.background=e.color:t.toast.classList.add(n+"-color-"+e.color)),e.backgroundColor&&(t.toast.style.background=e.backgroundColor,e.balloon&&(t.toast.style.borderColor=e.backgroundColor))}(),function(){e.image&&(t.cover.classList.add(n+"-cover"),t.cover.style.width=e.imageWidth+"px",le(e.image.replace(/ /g,""))?t.cover.style.backgroundImage="url(data:image/png;base64,"+e.image.replace(/ /g,"")+")":t.cover.style.backgroundImage="url("+e.image+")",e.rtl?t.toastBody.style.marginRight=e.imageWidth+10+"px":t.toastBody.style.marginLeft=e.imageWidth+10+"px",t.toast.appendChild(t.cover))}(),function(){e.close?(t.buttonClose=document.createElement("button"),t.buttonClose.type="button",t.buttonClose.classList.add(n+"-close"),t.buttonClose.addEventListener("click",function(s){s.target,i.hide(e,t.toast,"button")}),t.toast.appendChild(t.buttonClose)):e.rtl?t.toast.style.paddingLeft="18px":t.toast.style.paddingRight="18px"}(),function(){e.progressBar&&(t.progressBar=document.createElement("div"),t.progressBarDiv=document.createElement("div"),t.progressBar.classList.add(n+"-progressbar"),t.progressBarDiv.style.background=e.progressBarColor,t.progressBar.appendChild(t.progressBarDiv),t.toast.appendChild(t.progressBar)),e.timeout&&(e.pauseOnHover&&!e.resetOnHover&&(t.toast.addEventListener("mouseenter",function(s){i.progress(e,t.toast).pause()}),t.toast.addEventListener("mouseleave",function(s){i.progress(e,t.toast).resume()})),e.resetOnHover&&(t.toast.addEventListener("mouseenter",function(s){i.progress(e,t.toast).reset()}),t.toast.addEventListener("mouseleave",function(s){i.progress(e,t.toast).start()})))}(),function(){e.iconUrl?(t.icon.setAttribute("class",n+"-icon"),t.icon.setAttribute("src",e.iconUrl)):e.icon&&(t.icon.setAttribute("class",n+"-icon "+e.icon),e.iconText&&t.icon.appendChild(document.createTextNode(e.iconText)),e.iconColor&&(t.icon.style.color=e.iconColor)),(e.icon||e.iconUrl)&&(e.rtl?t.toastBody.style.paddingRight="33px":t.toastBody.style.paddingLeft="33px",t.toastBody.appendChild(t.icon))}(),function(){e.title.length>0&&(t.strong=document.createElement("strong"),t.strong.classList.add(n+"-title"),t.strong.appendChild(C(e.title)),t.toastTexts.appendChild(t.strong),e.titleColor&&(t.strong.style.color=e.titleColor),e.titleSize&&(isNaN(e.titleSize)?t.strong.style.fontSize=e.titleSize:t.strong.style.fontSize=e.titleSize+"px"),e.titleLineHeight&&(isNaN(e.titleSize)?t.strong.style.lineHeight=e.titleLineHeight:t.strong.style.lineHeight=e.titleLineHeight+"px")),e.message.length>0&&(t.p=document.createElement("p"),t.p.classList.add(n+"-message"),t.p.appendChild(C(e.message)),t.toastTexts.appendChild(t.p),e.messageColor&&(t.p.style.color=e.messageColor),e.messageSize&&(isNaN(e.titleSize)?t.p.style.fontSize=e.messageSize:t.p.style.fontSize=e.messageSize+"px"),e.messageLineHeight&&(isNaN(e.titleSize)?t.p.style.lineHeight=e.messageLineHeight:t.p.style.lineHeight=e.messageLineHeight+"px")),e.title.length>0&&e.message.length>0&&(e.rtl?t.strong.style.marginLeft="10px":e.layout!==2&&!e.rtl&&(t.strong.style.marginRight="10px"))}(),t.toastBody.appendChild(t.toastTexts);var r;(function(){e.inputs.length>0&&(t.inputs.classList.add(n+"-inputs"),g(e.inputs,function(s,l){t.inputs.appendChild(C(s[0])),r=t.inputs.childNodes,r[l].classList.add(n+"-inputs-child"),s[3]&&setTimeout(function(){r[l].focus()},300),r[l].addEventListener(s[1],function(d){var m=s[2];return m(i,t.toast,this,d)})}),t.toastBody.appendChild(t.inputs))})(),function(){e.buttons.length>0&&(t.buttons.classList.add(n+"-buttons"),g(e.buttons,function(s,l){t.buttons.appendChild(C(s[0]));var d=t.buttons.childNodes;d[l].classList.add(n+"-buttons-child"),s[2]&&setTimeout(function(){d[l].focus()},300),d[l].addEventListener("click",function(m){m.preventDefault();var ce=s[1];return ce(i,t.toast,this,m,r)})})),t.toastBody.appendChild(t.buttons)}(),e.message.length>0&&(e.inputs.length>0||e.buttons.length>0)&&(t.p.style.marginBottom="0"),(e.inputs.length>0||e.buttons.length>0)&&(e.rtl?t.toastTexts.style.marginLeft="10px":t.toastTexts.style.marginRight="10px",e.inputs.length>0&&e.buttons.length>0&&(e.rtl?t.inputs.style.marginLeft="8px":t.inputs.style.marginRight="8px")),function(){t.toastCapsule.style.visibility="hidden",setTimeout(function(){var s=t.toast.offsetHeight,l=t.toast.currentStyle||window.getComputedStyle(t.toast),d=l.marginTop;d=d.split("px"),d=parseInt(d[0]);var m=l.marginBottom;m=m.split("px"),m=parseInt(m[0]),t.toastCapsule.style.visibility="",t.toastCapsule.style.height=s+m+d+"px",setTimeout(function(){t.toastCapsule.style.height="auto",e.target&&(t.toastCapsule.style.overflow="visible")},500),e.timeout&&i.progress(e,t.toast).start()},100)}(),function(){var s=e.position;if(e.target)t.wrapper=document.querySelector(e.target),t.wrapper.classList.add(n+"-target"),e.targetFirst?t.wrapper.insertBefore(t.toastCapsule,t.wrapper.firstChild):t.wrapper.appendChild(t.toastCapsule);else{if(j.indexOf(e.position)==-1){console.warn("["+n+`] Incorrect position. +It can be › `+j);return}h||window.innerWidth<=E?e.position=="bottomLeft"||e.position=="bottomRight"||e.position=="bottomCenter"?s=n+"-wrapper-bottomCenter":e.position=="topLeft"||e.position=="topRight"||e.position=="topCenter"?s=n+"-wrapper-topCenter":s=n+"-wrapper-center":s=n+"-wrapper-"+s,t.wrapper=document.querySelector("."+n+"-wrapper."+s),t.wrapper||(t.wrapper=document.createElement("div"),t.wrapper.classList.add(n+"-wrapper"),t.wrapper.classList.add(s),document.body.appendChild(t.wrapper)),e.position=="topLeft"||e.position=="topCenter"||e.position=="topRight"?t.wrapper.insertBefore(t.toastCapsule,t.wrapper.firstChild):t.wrapper.appendChild(t.toastCapsule)}isNaN(e.zindex)?console.warn("["+n+"] Invalid zIndex."):t.wrapper.style.zIndex=e.zindex}(),function(){e.overlay&&(document.querySelector("."+n+"-overlay.fadeIn")!==null?(t.overlay=document.querySelector("."+n+"-overlay"),t.overlay.setAttribute("data-iziToast-ref",t.overlay.getAttribute("data-iziToast-ref")+","+e.ref),!isNaN(e.zindex)&&e.zindex!==null&&(t.overlay.style.zIndex=e.zindex-1)):(t.overlay.classList.add(n+"-overlay"),t.overlay.classList.add("fadeIn"),t.overlay.style.background=e.overlayColor,t.overlay.setAttribute("data-iziToast-ref",e.ref),!isNaN(e.zindex)&&e.zindex!==null&&(t.overlay.style.zIndex=e.zindex-1),document.querySelector("body").appendChild(t.overlay)),e.overlayClose?(t.overlay.removeEventListener("click",{}),t.overlay.addEventListener("click",function(s){i.hide(e,t.toast,"overlay")})):t.overlay.removeEventListener("click",{}))}(),function(){if(e.animateInside){t.toast.classList.add(n+"-animateInside");var s=[200,100,300];(e.transitionIn=="bounceInLeft"||e.transitionIn=="bounceInRight")&&(s=[400,200,400]),e.title.length>0&&setTimeout(function(){t.strong.classList.add("slideIn")},s[0]),e.message.length>0&&setTimeout(function(){t.p.classList.add("slideIn")},s[1]),(e.icon||e.iconUrl)&&setTimeout(function(){t.icon.classList.add("revealIn")},s[2]);var l=150;e.buttons.length>0&&t.buttons&&setTimeout(function(){g(t.buttons.childNodes,function(d,m){setTimeout(function(){d.classList.add("revealIn")},l),l=l+150})},e.inputs.length>0?150:0),e.inputs.length>0&&t.inputs&&(l=150,g(t.inputs.childNodes,function(d,m){setTimeout(function(){d.classList.add("revealIn")},l),l=l+150}))}}(),e.onOpening.apply(null,[e,t.toast]);try{var c=new CustomEvent(n+"-opening",{detail:e,bubbles:!0,cancelable:!0});document.dispatchEvent(c)}catch(s){console.warn(s)}setTimeout(function(){t.toast.classList.remove(n+"-opening"),t.toast.classList.add(n+"-opened");try{var s=new CustomEvent(n+"-opened",{detail:e,bubbles:!0,cancelable:!0});document.dispatchEvent(s)}catch(l){console.warn(l)}e.onOpened.apply(null,[e,t.toast])},1e3),e.drag&&(L?(t.toast.addEventListener("touchstart",function(s){b.startMoving(this,i,e,s)},!1),t.toast.addEventListener("touchend",function(s){b.stopMoving(this,s)},!1)):(t.toast.addEventListener("mousedown",function(s){s.preventDefault(),b.startMoving(this,i,e,s)},!1),t.toast.addEventListener("mouseup",function(s){s.preventDefault(),b.stopMoving(this,s)},!1))),e.closeOnEscape&&document.addEventListener("keyup",function(s){s=s||window.event,s.keyCode==27&&i.hide(e,t.toast,"esc")}),e.closeOnClick&&t.toast.addEventListener("click",function(s){i.hide(e,t.toast,"toast")}),i.toast=t.toast},f})})(Q);var he=Q.exports;const z=ye(he);const A={timeout:3e3,close:!1,closeOnClick:!0,icon:null,position:"topRight",transitionIn:"fadeInDown",transitionOut:"fadeOutUp"};class T{static success(u){z.success({title:"OK",titleColor:"green",message:u,messageColor:"green",progressBarColor:"green",...A})}static error(u){z.error({title:"Error",titleColor:"red",message:u,messageColor:"red",progressBarColor:"red",...A})}static warning(u){z.warning({title:"Caution",message:u,titleColor:"red",messageColor:"red",progressBarColor:"red",...A})}}const _=document.getElementById("subscribeForm"),Z=_.querySelector('input[name="email"]'),G=document.getElementById("subscribeBtn");Z.addEventListener("input",Le);_.addEventListener("submit",Ee);function be(a){return/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(a)}function Le(){Z.value}async function Ee(a){a.preventDefault();const u=new FormData(_),p=u.get("email");if(!be(p))return console.error("Invalid email address"),T.error("Invalid email address");try{G.disabled=!0;const n=await de.post("https://your-energy.b.goit.study/api/subscription",u,{headers:{"Content-Type":"application/json"}});return n.status>=200&&n.status<300?(_.reset(),T.success(`${n.data.message}`)):(console.error("Server Error:",n.status,n.statusText),T.error(`Server Error: ${n.status} ${n.statusText}`))}catch(n){return console.error("Error:",n.message),T.error(`Error: ${n.message}`)}finally{G.disabled=!1}}const we=new U,D=document.querySelector(".js-list");D.addEventListener("click",Ce);async function Ce(a){if(!a.target.closest(".filters__item"))return;const u=a.target.closest(".filters__item");let p=u.lastElementChild.children[0].innerText.toLowerCase().replace(/\s/g,"");const f=u.lastElementChild.children[1].innerText.toLowerCase().replace(/\s/g,"%20");p==="bodyparts"&&(p="bodypart");try{const n=await we.getExercises(p,f);Ie(n)}catch(n){console.log(n)}}function Ie(a){D.innerHTML="";const u=a.map(({_id:p,rating:f,name:n,burnedCalories:h,bodyPart:M,target:B})=>`
  • @@ -30,12 +30,12 @@ It can be › `+j);return}h||window.innerWidth<=E?e.position=="bottomLeft"||e.po
    -

    ${i}

    +

    ${n}

    Burned calories:${h}

    -

    Body part:${B}

    -

    Target:${M}

    +

    Body part:${M}

    +

    Target:${B}

    -
  • `).join("");D.insertAdjacentHTML("beforeend",u)}var y=document.getElementById("mySVG");y.style.transform="scale(1)";y.style.transition="fill 0.3s ease, transform 0.3s ease";var ee=["var(--color-yellow)","var(--color-black)","var(--color-valid)"],H=0;y.addEventListener("mouseover",function(){y.style.fill=ee[H],y.style.transform="scale(1.6) rotate(145deg)"});y.addEventListener("mouseout",function(){y.style.transform="scale(1) rotate(0deg)",H=(H+1)%ee.length});const Te=document.getElementById("btn"),xe=document.getElementById("bmi-result"),x=document.getElementById("weight-condition");function Se(){const a=document.getElementById("height").value/100,p=(document.getElementById("weight").value/(a*a)).toFixed(1);xe.value=p,p<18.5?x.innerText="Under weight!":p>=18.5&&p<=24.9?x.innerText="Normal weight!":p>=25&&p<=29.9?x.innerText="Overweight!":p>=30&&(x.innerText="Obesity!")}Te.addEventListener("click",Se);const _e=document.querySelector(".bmi__link"),k=document.querySelector(".bmi__backdrop"),te=document.querySelector(".bmi__modal-close-btn");function ke(a){a.preventDefault(),k.classList.remove("is-hidden"),document.body.classList.add("modal-open"),Be()}function ie(a){a.preventDefault(),a.code==="Escape"&&W()}function ne(a){a.target.closest(".bmi__wrapper")||W()}function se(a){a.preventDefault(),W()}function Be(){document.addEventListener("keydown",ie),k.addEventListener("click",ne),te.addEventListener("click",se)}function W(){document.removeEventListener("keydown",ie),k.removeEventListener("click",ne),te.removeEventListener("click",se),k.classList.add("is-hidden"),document.body.classList.remove("modal-open")}_e.addEventListener("click",ke); + `).join("");D.insertAdjacentHTML("beforeend",u)}document.addEventListener("DOMContentLoaded",()=>{const a=document.querySelectorAll(".exercises__btn");a.forEach(u=>{u.addEventListener("click",()=>{a.forEach(p=>p.classList.remove("active")),u.classList.add("active")})})});var y=document.getElementById("mySVG");y.style.transform="scale(1)";y.style.transition="fill 0.3s ease, transform 0.3s ease";var ee=["var(--color-yellow)","var(--color-black)","var(--color-valid)"],H=0;y.addEventListener("mouseover",function(){y.style.fill=ee[H],y.style.transform="scale(1.6) rotate(145deg)"});y.addEventListener("mouseout",function(){y.style.transform="scale(1) rotate(0deg)",H=(H+1)%ee.length});const Te=document.getElementById("btn"),xe=document.getElementById("bmi-result"),x=document.getElementById("weight-condition");function Se(){const a=document.getElementById("height").value/100,p=(document.getElementById("weight").value/(a*a)).toFixed(1);xe.value=p,p<18.5?x.innerText="Under weight!":p>=18.5&&p<=24.9?x.innerText="Normal weight!":p>=25&&p<=29.9?x.innerText="Overweight!":p>=30&&(x.innerText="Obesity!")}Te.addEventListener("click",Se);const _e=document.querySelector(".bmi__link"),k=document.querySelector(".bmi__backdrop"),te=document.querySelector(".bmi__modal-close-btn");function ke(a){a.preventDefault(),k.classList.remove("is-hidden"),document.body.classList.add("modal-open"),Me()}function ne(a){a.preventDefault(),a.code==="Escape"&&W()}function ie(a){a.target.closest(".bmi__wrapper")||W()}function se(a){a.preventDefault(),W()}function Me(){document.addEventListener("keydown",ne),k.addEventListener("click",ie),te.addEventListener("click",se)}function W(){document.removeEventListener("keydown",ne),k.removeEventListener("click",ie),te.removeEventListener("click",se),k.classList.add("is-hidden"),document.body.classList.remove("modal-open")}_e.addEventListener("click",ke); diff --git a/index.html b/index.html index d9aa15c..3a272fc 100644 --- a/index.html +++ b/index.html @@ -14,7 +14,7 @@ /> Your Energy - +