Skip to content

Commit

Permalink
restore old svg path
Browse files Browse the repository at this point in the history
  • Loading branch information
TetiZ committed Jan 31, 2024
1 parent 42d6714 commit da02a06
Showing 1 changed file with 11 additions and 25 deletions.
36 changes: 11 additions & 25 deletions src/js/exersises.js
Original file line number Diff line number Diff line change
Expand Up @@ -632,23 +632,6 @@ function dataToStorage(data) {

// FAVORITES

document.addEventListener('DOMContentLoaded', async function () {
const svgElem = document.createElementNS('http://www.w3.org/2000/svg', 'svg');
const useElem = document.createElementNS('http://www.w3.org/2000/svg', 'use');

await useElem.setAttributeNS(
'http://www.w3.org/1999/xlink',
'href',
'icons.svg#icon-trash'
);
svgElem.appendChild(useElem);

await renderCardsFromStorage();

const trashButton = document.querySelector('.exercise-trash-button');
trashButton.append(svgElem);
});

const savedCards = JSON.parse(localStorage.getItem('exercises'));
console.log(savedCards);

Expand All @@ -668,18 +651,19 @@ function renderCardsFromStorage(e) {
<div class="exercise-head-container">
<span class="exercise-badge">WORKOUT</span>
<button class="exercise-trash-button">
<svg class="exercise-trash-icon" width="16" height="16">
<use href="/icons.svg#icon-trash"></use>
<svg class="exercise-trash-icon" width="16" height="16">
<use href="/energy_flow/assets/icons-de67b048.svg#icon-trash"></use>
</svg>
</button>
<a
class="exercise-part-link"
href="./partials/pop-up-exercise-card.html"
>
<button class="exercise-part-button">
Start
<svg class="exercise-btn-icon" width="14" height="14">
<use href="/energy_flow/assets/icons-de67b048.svg#icon-arrow-right"></use>
</svg>
</button>
</a>
</div>
Expand Down Expand Up @@ -732,17 +716,19 @@ favoritesContainer.addEventListener('click', function (event) {
<div class="exercise-head-container">
<span class="exercise-badge">WORKOUT</span>
<button class="exercise-trash-button">
<svg class="close-icon">
<use xlink:href="#icon-trash"></use>
</svg>
<svg class="exercise-trash-icon" width="16" height="16">
<use href="/energy_flow/assets/icons-de67b048.svg#icon-trash"></use>
</svg>
</button>
<a
class="exercise-part-link"
href="./partials/pop-up-exercise-card.html"
>
<button class="exercise-part-button">
Start
<svg class="exercise-btn-icon" width="14" height="14">
<use href="/energy_flow/assets/icons-de67b048.svg#icon-arrow-right"></use>
</svg>
</button>
</a>
</div>
Expand Down

0 comments on commit da02a06

Please sign in to comment.