Skip to content

Commit

Permalink
Deploying to gh-pages from @ a1a3d69 🚀
Browse files Browse the repository at this point in the history
  • Loading branch information
ViktorSvertoka committed Dec 16, 2023
1 parent ad86a6e commit d8e8f01
Show file tree
Hide file tree
Showing 8 changed files with 154 additions and 147 deletions.
File renamed without changes.
77 changes: 77 additions & 0 deletions assets/05-modal-exercises-65434497.js

Large diffs are not rendered by default.

48 changes: 27 additions & 21 deletions assets/favorites-3ce64fd3.js → assets/favorites-9a7feb98.js
Original file line number Diff line number Diff line change
@@ -1,65 +1,71 @@
import{i}from"./sprite-70ed1671.js";const d=document.querySelector(".favorites__list"),v=document.getElementById("favoritesButton");v.addEventListener("click",l());function l(){const t=JSON.parse(localStorage.getItem("exerciseData"));if(t!==null){d.innerHTML="";const e=t.map(({_id:a,name:s,burnedCalories:r,bodyPart:c,target:n})=>`
import{i as s}from"./05-modal-exercises-65434497.js";const d=document.querySelector(".favorites__list"),l=document.getElementById("favoritesButton");l.addEventListener("click",v());function v(){const t=JSON.parse(localStorage.getItem("exerciseData"));if(t.length!==0){d.innerHTML="";const a=t.map(({_id:e,name:r,burnedCalories:c,bodyPart:i,target:o})=>`
<li class="fav-filters__item-card">
<div class="fav-card__wrap">
<div class="fav-card__block-btn">
<div class="fav-card__trash-btn-wrap">
<p class="fav-card__badge">Workout</p>
<button class="fav-card__btn js-remove-btn" data-id="${a}" type="button">
<button class="fav-card__btn js-remove-btn" data-id="${e}" type="button">
<svg class="fav-card__btn-trash-svg" width="16" height="16">
<use href="${i}#icon-trash"></use>
<use href="${s}#icon-trash"></use>
</svg>
</button>
</div>
<button class="fav-card__btn-start" data-id="${a}" type="button">Start
<button class="fav-card__btn-start card__btn" data-id="${e}" type="button">Start
<svg class="fav-card__btn-start-svg" width="16" height="16">
<use href="${i}#icon-arrow"></use>
<use href="${s}#icon-arrow"></use>
</svg>
</button>
</div>
<div class="fav-card__title-wrap">
<svg class="fav-card__title-svg" width="24" height="24">
<use href="${i}#icon-running-stick-figure"></use>
<use href="${s}#icon-running-stick-figure"></use>
</svg>
<h2 class="fav-card__title">${s}</h2>
<h2 class="fav-card__title">${r}</h2>
</div>
<div class="fav-card__block-info">
<p class="fav-card__text-info"><span>Burned calories:</span>${r}</p>
<p class="fav-card__text-info"><span>Body part:</span>${c}</p>
<p class="fav-card__text-info"><span>Target:</span>${n}</p>
<p class="fav-card__text-info"><span>Burned calories:</span>${c}</p>
<p class="fav-card__text-info"><span>Body part:</span>${i}</p>
<p class="fav-card__text-info"><span>Target:</span>${o}</p>
</div>
</div>
</li>`).join("");d.insertAdjacentHTML("beforeend",e)}}const o=document.querySelector(".favorites__list");o.addEventListener("click",_);function _(t){if(!t.target.closest(".js-remove-btn"))return;const e=t.target.closest(".js-remove-btn").getAttribute("data-id"),s=JSON.parse(localStorage.getItem("exerciseData")).filter(r=>r._id!==e);localStorage.setItem("exerciseData",JSON.stringify(s)),f(s)}function f(t){if(t.length!==0){o.innerHTML="";const e=t.map(({_id:a,name:s,burnedCalories:r,bodyPart:c,target:n})=>`
</li>`).join("");d.insertAdjacentHTML("beforeend",a)}}const n=document.querySelector(".favorites__list");n.addEventListener("click",_);function _(t){if(!t.target.closest(".js-remove-btn"))return;const a=t.target.closest(".js-remove-btn").getAttribute("data-id"),r=JSON.parse(localStorage.getItem("exerciseData")).filter(c=>c._id!==a);localStorage.setItem("exerciseData",JSON.stringify(r)),f()}function f(){const t=JSON.parse(localStorage.getItem("exerciseData"));if(t.length===0){n.innerHTML="";const a=`
<li class="favorites__empty">
It appears that you haven't added any exercises to your favorites
yet. To get started, you can add exercises that you like to your
favorites for easier access in the future.
</li>
`;n.insertAdjacentHTML("beforeend",a)}else{n.innerHTML="";const a=t.map(({_id:e,name:r,burnedCalories:c,bodyPart:i,target:o})=>`
<li class="fav-filters__item-card">
<div class="fav-card__wrap">
<div class="fav-card__block-btn">
<div class="fav-card__trash-btn-wrap">
<p class="fav-card__badge">Workout</p>
<button class="fav-card__btn js-remove-btn" data-id="${a}" type="button">
<button class="fav-card__btn js-remove-btn" data-id="${e}" type="button">
<svg class="fav-card__btn-trash-svg" width="16" height="16">
<use href="${icons}#icon-trash"></use>
<use href="${s}#icon-trash"></use>
</svg>
</button>
</div>
<button class="fav-card__btn-start" data-id="${a}" type="button">Start
<button class="fav-card__btn-start card__btn" data-id="${e}" type="button">Start
<svg class="fav-card__btn-start-svg" width="16" height="16">
<use href="${icons}#icon-arrow"></use>
<use href="${s}#icon-arrow"></use>
</svg>
</button>
</div>
<div class="fav-card__title-wrap">
<svg class="fav-card__title-svg" width="24" height="24">
<use href="${icons}#icon-running-stick-figure"></use>
<use href="${s}#icon-running-stick-figure"></use>
</svg>
<h2 class="fav-card__title">${s}</h2>
<h2 class="fav-card__title">${r}</h2>
</div>
<div class="fav-card__block-info">
<p class="fav-card__text-info"><span>Burned calories:</span>${r}</p>
<p class="fav-card__text-info"><span>Body part:</span>${c}</p>
<p class="fav-card__text-info"><span>Target:</span>${n}</p>
<p class="fav-card__text-info"><span>Burned calories:</span>${c}</p>
<p class="fav-card__text-info"><span>Body part:</span>${i}</p>
<p class="fav-card__text-info"><span>Target:</span>${o}</p>
</div>
</div>
</li>`).join("");o.insertAdjacentHTML("beforeend",e)}}
</li>`).join("");n.insertAdjacentHTML("beforeend",a)}}
42 changes: 42 additions & 0 deletions assets/index-6630d0a7.js

Large diffs are not rendered by default.

114 changes: 0 additions & 114 deletions assets/index-f1adf69c.js

This file was deleted.

Loading

0 comments on commit d8e8f01

Please sign in to comment.