Skip to content

Commit 427ac67

Browse files
authored
Merge pull request #27 from danielaEsc/feat/prueba-release-automatizado
feat: add interactive scale animation to counter
2 parents 8e34758 + 372571d commit 427ac67

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

script.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,21 @@ const increaseBtn = document.getElementById('increase');
77

88
function updateDisplay() {
99
counterDisplay.textContent = count;
10+
11+
// Cambiar color según el valor
1012
if (count > 0) {
1113
counterDisplay.style.color = '#2ecc71';
1214
} else if (count < 0) {
1315
counterDisplay.style.color = '#e74c3c';
1416
} else {
1517
counterDisplay.style.color = '#2c3e50';
1618
}
19+
20+
// Pequeño efecto de escala al cambiar
21+
counterDisplay.style.transform = 'scale(1.2)';
22+
setTimeout(() => {
23+
counterDisplay.style.transform = 'scale(1)';
24+
}, 100);
1725
}
1826

1927
decreaseBtn.addEventListener('click', () => {

style.css

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,10 @@ h1 {
1616
font-weight: bold;
1717
margin: 1rem 0;
1818
color: #2c3e50;
19-
transition: transform 0.2s ease;
19+
transition:
20+
transform 0.1s cubic-bezier(0.175, 0.885, 0.32, 1.275),
21+
color 0.3s ease;
22+
display: inline-block;
2023
}
2124

2225
.counter-display:hover {

0 commit comments

Comments
 (0)