Skip to content

Commit

Permalink
Deploying to gh-pages from @ 394fd98 🚀
Browse files Browse the repository at this point in the history
  • Loading branch information
ViktorSvertoka committed Dec 15, 2023
1 parent ed4287a commit ad2bcc2
Show file tree
Hide file tree
Showing 9 changed files with 186 additions and 121 deletions.
57 changes: 57 additions & 0 deletions assets/favorites-1597bae8.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
import{i}from"./sprite-82e4ec91.js";const l=document.querySelector(".favorites__list"),d=document.getElementById("favoritesButton");d.addEventListener("click",_());function _(){const t=JSON.parse(localStorage.getItem("exerciseData"));if(t!==null){l.innerHTML="";const a=t.map(({_id:e,name:s,burnedCalories:r,bodyPart:c,target:n})=>`
<li class="filters__item-card">
<div class="card__wrap">
<div class="card__block-btn">
<p class="card__badge">Workout</p>
<button class="card__btn js-remove-btn" data-id="${e}" type="button">Remove
<svg class="card__btn-arrow" width="16" height="16">
<use href="${i}#icon-arrow-menu-mobile"></use>
</svg>
</button>
<button class="card__btn" data-id="${e}" type="button">Start
<svg class="card__btn-arrow" width="16" height="16">
<use href="${i}#icon-arrow-menu-mobile"></use>
</svg>
</button>
</div>
<div class="card__wrap-title">
<svg class="card__title-svg" width="24" height="24">
<use href="${i}#icon-running-stick-figure"></use>
</svg>
<h2 class="card__title">${s}</h2>
</div>
<div class="card__block-info">
<p class="card__text-info"><span>Burned calories:</span>${r}</p>
<p class="card__text-info"><span>Body part:</span>${c}</p>
<p class="card__text-info"><span>Target:</span>${n}</p>
</div>
</div>
</li>`).join("");l.insertAdjacentHTML("beforeend",a)}}const o=document.querySelector(".favorites__list");o.addEventListener("click",u);function u(t){if(!t.target.closest(".js-remove-btn"))return;const a=t.target.closest(".js-remove-btn").getAttribute("data-id"),s=JSON.parse(localStorage.getItem("exerciseData")).filter(r=>r._id!==a);localStorage.setItem("exerciseData",JSON.stringify(s)),p(s)}function p(t){if(t.length!==0){o.innerHTML="";const a=t.map(({_id:e,name:s,burnedCalories:r,bodyPart:c,target:n})=>`
<li class="filters__item-card">
<div class="card__wrap">
<div class="card__block-btn">
<p class="card__badge">Workout</p>
<button class="card__btn" id="remove" data-id="${e}" type="button">Remove
<svg class="card__btn-arrow" width="16" height="16">
<use href="${icons}#icon-arrow-menu-mobile"></use>
</svg>
</button>
<button class="card__btn" data-id="${e}" type="button">Start
<svg class="card__btn-arrow" width="16" height="16">
<use href="${icons}#icon-arrow-menu-mobile"></use>
</svg>
</button>
</div>
<div class="card__wrap-title">
<svg class="card__title-svg" width="24" height="24">
<use href="${icons}#icon-running-stick-figure"></use>
</svg>
<h2 class="card__title">${s}</h2>
</div>
<div class="card__block-info">
<p class="card__text-info"><span>Burned calories:</span>${r}</p>
<p class="card__text-info"><span>Body part:</span>${c}</p>
<p class="card__text-info"><span>Target:</span>${n}</p>
</div>
</div>
</li>`).join("");o.insertAdjacentHTML("beforeend",a)}}
106 changes: 106 additions & 0 deletions assets/index-6c2e439d.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions assets/index-e5212ee8.css

Large diffs are not rendered by default.

110 changes: 0 additions & 110 deletions assets/main-9b69be7a.js

This file was deleted.

1 change: 0 additions & 1 deletion assets/main-db4b3837.css

This file was deleted.

5 changes: 5 additions & 0 deletions assets/sprite-82e4ec91.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions assets/sprite-8e57e165.css

Large diffs are not rendered by default.

20 changes: 12 additions & 8 deletions favorites.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,9 @@
/>
<title>Your Energy</title>

<script type="module" crossorigin src="/your-energy/assets/main-9b69be7a.js"></script>
<link rel="stylesheet" href="/your-energy/assets/main-db4b3837.css">
<script type="module" crossorigin src="/your-energy/assets/favorites-1597bae8.js"></script>
<link rel="modulepreload" crossorigin href="/your-energy/assets/sprite-82e4ec91.js">
<link rel="stylesheet" href="/your-energy/assets/sprite-8e57e165.css">
</head>
<body>
<header>
Expand Down Expand Up @@ -207,12 +208,13 @@ <h3 class="white-card__headline">10 mins</h3>
</div>

<div class="favorites__container">
<p 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.
</p>
<ul class="favorites__list"></ul>
<ul class="favorites__list">
<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>
</ul>
</div>
</div>
</div>
Expand Down Expand Up @@ -286,5 +288,7 @@ <h3 class="white-card__headline">10 mins</h3>
</footer>




</body>
</html>
6 changes: 4 additions & 2 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,10 @@
/>
<title>Your Energy</title>

<script type="module" crossorigin src="/your-energy/assets/main-9b69be7a.js"></script>
<link rel="stylesheet" href="/your-energy/assets/main-db4b3837.css">
<script type="module" crossorigin src="/your-energy/assets/index-6c2e439d.js"></script>
<link rel="modulepreload" crossorigin href="/your-energy/assets/sprite-82e4ec91.js">
<link rel="stylesheet" href="/your-energy/assets/sprite-8e57e165.css">
<link rel="stylesheet" href="/your-energy/assets/index-e5212ee8.css">
</head>
<body>
<header>
Expand Down

0 comments on commit ad2bcc2

Please sign in to comment.