diff --git a/assets/css/dark_mode.css b/assets/css/dark_mode.css index 171fc77f..979aa84a 100644 --- a/assets/css/dark_mode.css +++ b/assets/css/dark_mode.css @@ -63,4 +63,8 @@ display: none; } +.body-dark-mode .fav__button { + color: #ffffff; +} + /*# sourceMappingURL=dark_mode.css.map */ diff --git a/assets/css/style.css b/assets/css/style.css index bbb36385..2f27c774 100644 --- a/assets/css/style.css +++ b/assets/css/style.css @@ -84,8 +84,10 @@ html { } .fav__button { + font-size: 2.5rem; width: 24px; cursor: pointer; + color: #6e6197; } .main { diff --git a/assets/js/script.js b/assets/js/script.js index ee41d572..f6f288f5 100644 --- a/assets/js/script.js +++ b/assets/js/script.js @@ -214,17 +214,16 @@ function insertCardsIntoHtml(data) { }" id="${cardId}">

${card.title}

- star + class="${ + card.tags.includes("Favoritos") + ? "ph-fill ph-star" + : "ph ph-star" + } fav__button"> +

${card.description}

`; @@ -266,10 +265,10 @@ function setCardAsFavorite(cardId) { const favIcon = document.querySelector(`#fav_${cardId}`); if (favoriteCards.includes(cardId)) { - favIcon.src = starIcon; + favIcon.className = "ph ph-star fav__button"; favoriteCards.splice(favoriteCards.indexOf(cardId), 1); } else { - favIcon.src = starIconFilled; + favIcon.className = "ph-fill ph-star fav__button"; favoriteCards.push(cardId); }