Skip to content

Commit

Permalink
BlGaussianEffectOpacityAnimation : + #widthTrasition as a boolean to …
Browse files Browse the repository at this point in the history
…update or not the width of the effect according to the current animation progress
  • Loading branch information
plantec committed Nov 21, 2023
1 parent 2119177 commit 72828e9
Show file tree
Hide file tree
Showing 14 changed files with 190 additions and 149 deletions.
24 changes: 13 additions & 11 deletions src/Bloc-Animation/BlAnimation.class.st
Original file line number Diff line number Diff line change
@@ -1,54 +1,56 @@
Class {
#name : #BlAnimation,
#superclass : #BlBaseAnimation,
#name : 'BlAnimation',
#superclass : 'BlBaseAnimation',
#instVars : [
'duration',
'easing'
],
#category : #'Bloc-Animation-Basic'
#category : 'Bloc-Animation-Basic',
#package : 'Bloc-Animation',
#tag : 'Basic'
}

{ #category : #pulse }
{ #category : 'pulse' }
BlAnimation >> applyValue: anObject [
"Change this animation to be at the point indicated by the argument. The argument is an object already interpolated."

self subclassResponsibility
]

{ #category : #pulse }
{ #category : 'pulse' }
BlAnimation >> doStep [

self applyValue: (self valueForStep: (easing interpolate: progress))
]

{ #category : #accessing }
{ #category : 'accessing' }
BlAnimation >> duration [

^ duration
]

{ #category : #'api - configuration' }
{ #category : 'api - configuration' }
BlAnimation >> duration: aDuration [
"Establish the duration of this animation. Duration must be positive."

duration := aDuration
]

{ #category : #accessing }
{ #category : 'accessing' }
BlAnimation >> easing [
"Answer the easing strategy that applies to the progress on each step."

^ easing
]

{ #category : #accessing }
{ #category : 'accessing' }
BlAnimation >> easing: aBlEasing [
"Establish the easing strategy that applies to the progress."

easing := aBlEasing
]

{ #category : #initialization }
{ #category : 'initialization' }
BlAnimation >> initialize [

super initialize.
Expand All @@ -57,7 +59,7 @@ BlAnimation >> initialize [
easing := BlEasing linear
]

{ #category : #pulse }
{ #category : 'pulse' }
BlAnimation >> valueForStep: aNumber [
"Answer an Object that corresponds to aNumber, which belongs to the [0,1] closed interval that ALREADY HAS the easing function applied."

Expand Down
8 changes: 5 additions & 3 deletions src/Bloc-Animation/BlAnimationLoopDoneEvent.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@ Is sent as soon as animation loop is done (loop progress >= 1)
"
Class {
#name : #BlAnimationLoopDoneEvent,
#superclass : #BlEvent,
#category : #'Bloc-Animation-Events'
#name : 'BlAnimationLoopDoneEvent',
#superclass : 'BlEvent',
#category : 'Bloc-Animation-Events',
#package : 'Bloc-Animation',
#tag : 'Events'
}
12 changes: 7 additions & 5 deletions src/Bloc-Animation/BlAnimationStepEvent.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,23 @@ I am sent after every animation step with current progress as a parameter
"
Class {
#name : #BlAnimationStepEvent,
#superclass : #BlEvent,
#name : 'BlAnimationStepEvent',
#superclass : 'BlEvent',
#instVars : [
'progress'
],
#category : #'Bloc-Animation-Events'
#category : 'Bloc-Animation-Events',
#package : 'Bloc-Animation',
#tag : 'Events'
}

{ #category : #accessing }
{ #category : 'accessing' }
BlAnimationStepEvent >> progress [

^ progress
]

{ #category : #accessing }
{ #category : 'accessing' }
BlAnimationStepEvent >> progress: aNumber [
"Establish the progress, which must be within interval [0...1]"

Expand Down
Loading

0 comments on commit 72828e9

Please sign in to comment.