{"size": 1425, "ext": "js", "max_stars_repo_path": "src/scenes/TweenHelper.js", "max_stars_repo_name": "ArielleDOM/job-hunt", "max_stars_repo_stars_event_min_datetime": "2020-07-16T01:39:54.000Z", "max_stars_repo_stars_event_max_datetime": "2021-01-09T15:25:12.000Z", "max_issues_repo_path": "src/scenes/TweenHelper.js", "max_issues_repo_name": "ArielleDOM/job-hunt", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "src/scenes/TweenHelper.js", "max_forks_repo_name": "ArielleDOM/job-hunt", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": 2, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 34.756097561, "max_line_length": 126, "alphanum_fraction": 0.3242105263}
export default class TweenHelper {
    static flashElement(scene, element, repeat = true, easing = 'Linear', overallDuration = 900, visiblePauseDuration = 500) {
        if (scene && element) {
            let flashDuration = overallDuration - visiblePauseDuration / 2;

            scene.tweens.timeline({
                tweens: [
                    {
                        targets: element,
                        duration: 0,
                        alpha: 0,
                        ease: easing
                    },
                    {
                        targets: element,
                        duration: flashDuration,
                        alpha: 1,
                        ease: easing
                    },
                    {
                        targets: element,
                        duration: visiblePauseDuration,
                        alpha: 1,
                        ease: easing
                    },
                    {
                        targets: element,
                        duration: flashDuration,
                        alpha: 0,
                        ease: easing,
                        onComplete: () => {
                            if (repeat === true) {
                                this.flashElement(scene, element);
                            }
                        }
                    }
                ]
            });
        }
    }
}