Not quite... (animation jumps when interrupted)
parent
fa1c9b6f2c
commit
60062d8505
|
@ -82,6 +82,9 @@
|
|||
set_theme(new_theme);
|
||||
button.remove();
|
||||
};
|
||||
button.onmouseenter = () => {
|
||||
button.classList.add("enable-reverse-animation"); // needed for reverse animation to not play at page load
|
||||
};
|
||||
document.body.appendChild(button);
|
||||
grinch_button = button;
|
||||
}
|
||||
|
|
|
@ -160,6 +160,9 @@ button.grinch-button {
|
|||
background-color: transparent;
|
||||
cursor: pointer;
|
||||
}
|
||||
button.grinch-button.enable-reverse-animation {
|
||||
animation: grinch-smile-reverse 2s steps(37) forwards;
|
||||
}
|
||||
button.grinch-button:hover {
|
||||
animation: grinch-smile 2s steps(37) forwards;
|
||||
}
|
||||
|
@ -171,3 +174,11 @@ button.grinch-button:hover {
|
|||
background-position: -3700px 0;
|
||||
}
|
||||
}
|
||||
@keyframes grinch-smile-reverse {
|
||||
from {
|
||||
background-position: -3700px 0;
|
||||
}
|
||||
to {
|
||||
background-position: 0 0;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue