()
| 238 | } |
| 239 | } |
| 240 | fx3() { |
| 241 | const MAX_CELL_ITERATIONS = 10; |
| 242 | let finished = 0; |
| 243 | this.clearCells(); |
| 244 | |
| 245 | const loop = (line, cell, iteration = 0) => { |
| 246 | if ( iteration === MAX_CELL_ITERATIONS-1 ) { |
| 247 | cell.set(cell.original); |
| 248 | ++finished; |
| 249 | if ( finished === this.totalChars ) { |
| 250 | this.isAnimating = false; |
| 251 | } |
| 252 | } |
| 253 | else { |
| 254 | cell.set(this.getRandomChar()); |
| 255 | } |
| 256 | |
| 257 | ++iteration; |
| 258 | if ( iteration < MAX_CELL_ITERATIONS ) { |
| 259 | setTimeout(() => loop(line, cell, iteration), 80); |
| 260 | } |
| 261 | }; |
| 262 | |
| 263 | for (const line of this.lines) { |
| 264 | for (const cell of line.cells) { |
| 265 | setTimeout(() => loop(line, cell), randomNumber(0,2000)); |
| 266 | } |
| 267 | } |
| 268 | } |
| 269 | fx4() { |
| 270 | const MAX_CELL_ITERATIONS = 30; |
| 271 | let finished = 0; |
no test coverage detected