Scenario generator for vore roleplay and story ideas.
https://scenario-generator.deliciousreya.net/responses
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
25 lines
821 B
25 lines
821 B
3 months ago
|
function onPulseEnd(e: AnimationEvent): void {
|
||
|
if (e.animationName === "pulse-bg" && e.target instanceof HTMLElement) {
|
||
|
e.target.classList.remove("pulse")
|
||
|
e.target.removeEventListener("animationend", onPulseEnd)
|
||
|
e.target.removeEventListener("animationcancel", onPulseEnd)
|
||
|
}
|
||
|
}
|
||
|
|
||
5 months ago
|
export function pulseElement(element: HTMLElement) {
|
||
3 months ago
|
element.removeEventListener("animationend", onPulseEnd)
|
||
|
element.removeEventListener("animationcancel", onPulseEnd)
|
||
|
if (element.classList.contains("pulse")) {
|
||
|
const anim =
|
||
|
element.getAnimations().find(v => v instanceof CSSAnimation && v.animationName === "pulse-bg")
|
||
|
if (anim) {
|
||
|
anim.finish()
|
||
|
anim.play()
|
||
|
}
|
||
|
} else {
|
||
|
element.classList.add("pulse")
|
||
|
}
|
||
|
element.addEventListener("animationend", onPulseEnd)
|
||
|
element.addEventListener("animationcancel", onPulseEnd)
|
||
5 months ago
|
}
|