-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
102 additions
and
113 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -97,4 +97,6 @@ | |
.show { | ||
display: block !important; /* Override display property to show the paragraph */ | ||
} | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,29 @@ | ||
document.addEventListener('DOMContentLoaded', function() { | ||
const card = document.getElementById('interactiveCard'); | ||
card.style.transform = 'scale(0)'; | ||
setTimeout(() => { | ||
card.style.transform = 'scale(1)'; | ||
card.style.transition = 'transform 0.5s ease'; | ||
}, 300); | ||
const cards = document.querySelectorAll('.interactiveCard'); | ||
|
||
cards.forEach(card => { | ||
card.style.transform = 'scale(0)'; | ||
setTimeout(() => { | ||
card.style.transform = 'scale(1)'; | ||
card.style.transition = 'transform 0.5s ease'; | ||
}, 300); | ||
|
||
const toggleDetailsBtn = document.getElementById('toggleDetails'); | ||
// Selecciona tanto párrafos como encabezados h5 | ||
const infoElements = document.querySelectorAll('.card-info p, .card-info h5'); | ||
let detailsVisible = false; | ||
const toggleDetailsBtn = card.querySelector('.toggleDetails'); | ||
const infoElements = card.querySelectorAll('.card-info p, .card-info h5'); | ||
let detailsVisible = false; | ||
|
||
toggleDetailsBtn.addEventListener('click', function() { | ||
detailsVisible = !detailsVisible; | ||
infoElements.forEach((element, index) => { | ||
if (detailsVisible) { | ||
setTimeout(() => { | ||
element.classList.add('active'); | ||
}, 100 * index); // Retraso incremental para cada elemento | ||
} else { | ||
element.classList.remove('active'); | ||
} | ||
toggleDetailsBtn.addEventListener('click', function() { | ||
detailsVisible = !detailsVisible; | ||
infoElements.forEach((element, index) => { | ||
if (detailsVisible) { | ||
setTimeout(() => { | ||
element.classList.add('active'); | ||
}, 100 * index); // Retraso incremental para cada elemento | ||
} else { | ||
element.classList.remove('active'); | ||
} | ||
}); | ||
this.textContent = detailsVisible ? 'Ocultar Detalles' : 'Mostrar Detalles'; | ||
}); | ||
this.textContent = detailsVisible ? 'Ocultar Detalles' : 'Mostrar Detalles'; | ||
}); | ||
|
||
|
||
|
||
}); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters