Skip to content

Commit

Permalink
exercises update
Browse files Browse the repository at this point in the history
  • Loading branch information
TetiZ committed Feb 1, 2024
1 parent c6861cb commit ce0d44d
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 18 deletions.
24 changes: 10 additions & 14 deletions src/js/exersises.js
Original file line number Diff line number Diff line change
Expand Up @@ -792,13 +792,12 @@ function addPaginationBtns() {
}
}

if (pagesCounter) {
pagesCounter.addEventListener('click', async e => {
const buttonId = e.target.id;
favList.innerHTML = savedCards
.slice(buttonId, buttonId + 8)
.map(
({ bodyPart, name, target, burnedCalories, _id }, index) => `
pagesCounter.addEventListener('click', async e => {
const buttonId = e.target.id;
favList.innerHTML = savedCards
.slice(buttonId, buttonId + 8)
.map(
({ bodyPart, name, target, burnedCalories, _id }, index) => `
<li class="exercise-parts">
<div class="part-container">
<div class="exercise-head-container">
Expand Down Expand Up @@ -841,13 +840,10 @@ if (pagesCounter) {
</div>
</li>
`
)
.join('');
updateTrashButtonListeners();
});
} else {
console.error('pagesCounter не знайдено.');
}
)
.join('');
updateTrashButtonListeners();
});

const favModal = document.querySelector('.favorite-modal');
function favPopUp(data) {
Expand Down
6 changes: 2 additions & 4 deletions src/js/quote.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@

// Визначаємо константу для збереження ключа у localStorage
const QUOTE_KEY = 'quote';
const AUTHOR_KEY = 'author';

Expand All @@ -21,7 +19,7 @@ if (storedDate === currentDate) {
const author = data.author;

localStorage.setItem(QUOTE_KEY, quote);
localStorage.setItem(AUTHOR_KEY, author || 'автор невідомий'); // Зберігаємо значення "автор невідомий", якщо автор не доступний
localStorage.setItem(AUTHOR_KEY, author || 'автор невідомий');
localStorage.setItem('date', currentDate);

console.log(`Нова цитата: ${quote} - ${author || 'автор невідомий'}`);
Expand All @@ -46,4 +44,4 @@ function displayQuote(quoteData) {
quoteText.textContent = quoteData.quote;
quoteAuthor.textContent = quoteData.author;
}
}
}

0 comments on commit ce0d44d

Please sign in to comment.