File tree Expand file tree Collapse file tree 1 file changed +9
-5
lines changed
Expand file tree Collapse file tree 1 file changed +9
-5
lines changed Original file line number Diff line number Diff line change @@ -71,19 +71,23 @@ document.body.appendChild(input);
7171const autoplayButton = document . createElement ( "button" ) ;
7272let cancel : any ;
7373const loop = ( ) => {
74- input . value = ( 1 + input . value ) % + input . max ;
74+ debugger ;
75+
76+ input . value = ( + input . value + 1 ) % + input . max ;
7577 update ( + input . value ) ;
7678 cancelAnimationFrame ( cancel ) ;
7779 cancel = requestAnimationFrame ( loop ) ;
7880} ;
7981const setAutoPlay = ( a : boolean ) => {
80- autoplayButton . innerHTML = a ? "pause ⏸ " : "play ▶ " ;
82+ autoplayButton . innerHTML = a ? "pause" : "play" ;
8183 if ( a ) loop ( ) ;
8284 else cancelAnimationFrame ( cancel ) ;
8385} ;
84- autoplayButton . addEventListener ( "click" , ( ) =>
85- setAutoPlay ( autoplayButton . innerHTML === "pause ⏸" )
86- ) ;
86+ autoplayButton . addEventListener ( "click" , ( ) => {
87+ debugger ;
88+ setAutoPlay ( autoplayButton . innerHTML === "play" ) ;
89+ } ) ;
90+ document . body . appendChild ( autoplayButton ) ;
8791
8892setAutoPlay ( true ) ;
8993update ( + input . value ) ;
You can’t perform that action at this time.
0 commit comments