Skip to content

Commit

Permalink
Decrease particle fade animation speed by half. See #97.
Browse files Browse the repository at this point in the history
  • Loading branch information
Luisav1 committed Jul 20, 2023
1 parent c9ce895 commit aed163b
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions js/chart-intro/view/ChartIntroScreenView.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ export type NuclideChartIntroScreenViewOptions = BANScreenViewOptions;
const CHART_VERTICAL_MARGINS = 10;
const NUMBER_OF_PROTONS_IN_ALPHA_PARTICLE = 2;
const NUMBER_OF_NEUTRONS_IN_ALPHA_PARTICLE = 2;
const PERCENT_TO_REDUCE_ANIMATION_SPEED = 0.5;

class ChartIntroScreenView extends BANScreenView<ChartIntroModel> {

Expand Down Expand Up @@ -292,7 +293,7 @@ class ChartIntroScreenView extends BANScreenView<ChartIntroModel> {
const fadeAnimation = new Animation( {
property: particleView.opacityProperty,
to: 0,
duration: animationDuration,
duration: animationDuration * PERCENT_TO_REDUCE_ANIMATION_SPEED,
easing: Easing.LINEAR
} );
fadeAnimation.endedEmitter.addListener( () => {
Expand Down Expand Up @@ -380,7 +381,7 @@ class ChartIntroScreenView extends BANScreenView<ChartIntroModel> {
const fadeAnimation = new Animation( {
property: particleView.opacityProperty,
to: 1,
duration: animationDuration,
duration: animationDuration * PERCENT_TO_REDUCE_ANIMATION_SPEED,
easing: Easing.LINEAR
} );
this.model.particleAnimations.push( fadeAnimation );
Expand Down

0 comments on commit aed163b

Please sign in to comment.