@@ -130,15 +130,18 @@ addCanvas(2, (ctx, width, height, animate) => {
130130 const startPeriod = Math . E * 1000 ;
131131 const endPeriod = Math . PI * 1000 ;
132132
133- // TODO animate handle length.
134133 animate ( ( frameTime ) => {
135134 const startPercentage = calcBouncePercentage ( startPeriod , timingFunctions . ease , frameTime ) ;
136135 const startAngle = split ( startPercentage , - 45 , + 45 ) ;
137- const start = point ( width * 0.2 , height * 0.5 , 0 , 0 , startAngle , width * 0.25 ) ;
136+ const startLengthPercentage = mod ( startPercentage * 0.8 , 1 ) ;
137+ const startLength = width * 0.2 + width * 0.1 * startLengthPercentage ;
138+ const start = point ( width * 0.2 , height * 0.5 , 0 , 0 , startAngle , startLength ) ;
138139
139140 const endPercentage = calcBouncePercentage ( endPeriod , timingFunctions . ease , frameTime ) ;
140141 const endAngle = split ( endPercentage , 135 , 225 ) ;
141- const end = point ( width * 0.8 , height * 0.5 , endAngle , width * 0.25 , 0 , 0 ) ;
142+ const endLengthPercentage = mod ( endPercentage * 0.8 , 1 ) ;
143+ const endLength = width * 0.2 + width * 0.1 * endLengthPercentage ;
144+ const end = point ( width * 0.8 , height * 0.5 , endAngle , endLength , 0 , 0 ) ;
142145
143146 drawOpen ( ctx , start , end , true ) ;
144147 } ) ;
0 commit comments