mirror of
https://github.com/lus/pasty.git
synced 2023-08-10 21:13:09 +03:00
Improve the frontend (API v2 functionalities) (#18)
* Fix line number height issue * Fix notification container position * Remove line wrapping * Switch to the new API * Rework JS & implement paste editing * Implement paste reports * Document the report webhook
This commit is contained in:
committed by
GitHub
parent
149abf77f1
commit
70c4392390
12
web/assets/js/modules/animation.js
Normal file
12
web/assets/js/modules/animation.js
Normal file
@@ -0,0 +1,12 @@
|
||||
// Properly animates an element
|
||||
export function animate(element, animation, duration, after) {
|
||||
element.style.setProperty("--animate-duration", duration);
|
||||
element.classList.add("animate__animated", animation);
|
||||
element.addEventListener("animationend", () => {
|
||||
element.style.removeProperty("--animate-duration");
|
||||
element.classList.remove("animate__animated", animation);
|
||||
if (after) {
|
||||
after();
|
||||
}
|
||||
}, {once: true});
|
||||
}
|
||||
Reference in New Issue
Block a user