Show all recipes button on top of site added
Some checks failed
Deploy to GitHub Pages / build (push) Has been cancelled
Deploy to GitHub Pages / deploy (push) Has been cancelled

This commit is contained in:
2026-02-12 21:55:56 +01:00
parent ce9a0b9f41
commit b75be6f974
3 changed files with 40 additions and 0 deletions

View File

@@ -21,6 +21,9 @@
<header> <header>
<h1>Licores son Amores</h1> <h1>Licores son Amores</h1>
<p class="subtitle">Descubre qué cócteles puedes preparar</p> <p class="subtitle">Descubre qué cócteles puedes preparar</p>
<button id="show-all-recipes-button" disabled="false">
¡Ver todos los cocktails!
</button>
</header> </header>
<div class="section"> <div class="section">

View File

@@ -47,6 +47,17 @@ function toggleSpirit(index, forcedCheckValue) {
} }
function enableButtonsLogic() { function enableButtonsLogic() {
// Add logic to directly show all cocktails button
const allRecipesButton = document.getElementById("show-all-recipes-button");
console.log("allRecipesButton", allRecipesButton);
if (allRecipesButton) {
allRecipesButton.disabled = false;
allRecipesButton.addEventListener("click", (e) => {
selectAll();
findRecipes();
});
}
const grid = document.getElementById("spiritsGrid"); const grid = document.getElementById("spiritsGrid");
// Add toggle logic to cards // Add toggle logic to cards
spiritsData.map((spirit, index) => { spiritsData.map((spirit, index) => {
@@ -62,6 +73,7 @@ function enableButtonsLogic() {
}); });
section[0].querySelector(".mix-button").disabled = true; section[0].querySelector(".mix-button").disabled = true;
} }
// Add logic to select all / none buttons // Add logic to select all / none buttons
if (section && section.length > 0) { if (section && section.length > 0) {
section[0] section[0]

View File

@@ -117,6 +117,31 @@ h1 {
} }
} }
#show-all-recipes-button {
width: fit-content;
padding: 0.2rem 0.5rem;
font-family: "Fredoka", sans-serif;
font-size: 0.8rem;
background: linear-gradient(135deg, var(--deep-red) 0%, var(--cognac) 100%);
color: white;
border: none;
border-radius: 50px;
cursor: pointer;
transition: all 0.3s ease;
box-shadow: 0 8px 20px rgba(139, 21, 56, 0.4);
text-transform: uppercase;
letter-spacing: 0.05em;
opacity: 85%;
}
#show-all-recipes-button:hover {
transform: translateY(-3px);
box-shadow: 0 12px 30px rgba(139, 21, 56, 0.5);
}
#show-all-recipes-button:active {
transform: translateY(-1px);
}
.section { .section {
background: rgba(255, 255, 255, 0.85); background: rgba(255, 255, 255, 0.85);
backdrop-filter: blur(10px); backdrop-filter: blur(10px);