import { Animation } from "./animation" ; import { ANIME , EASE_TYPE } from "../cubicons/constants" ; import { FADE_TYPES } from "../cubicons/constants" ; /**
 * Fade out a cubicon on the screen.
 */ export class FadeOut extends Animation { constructor ( params ) { super ( { cubicon : params . cubicon , duration : params . duration ?? ANIME . FADEOUT , ease : params . ease , } ) ; } play ( sleepTime ) { this . fadeOut ( this . cubicon , sleepTime ) ; } private fadeOut ( cubicon , sleepTime ) { cubicon . def_cubiconBase . transition ( ) . ease ( this . ease ) . delay ( cubicon . elapsedTime + sleepTime ) . duration ( this . duration ) . style ( "opacity" , 0 ) ; cubicon . elapsedTime += this . duration + sleepTime ; } }