@@ -412,92 +412,6 @@ export class JuicerBoard extends LitElement {
412
412
}
413
413
}
414
414
415
- // private createPieceEnterAnimation(elm: HTMLElement, coord: Coord): [Animation, () => void] {
416
- // const [row, col] = rowColFromCoord(coord, this.orientation);
417
- // const deltaX = row * (this.boardSize / COLS);
418
- // const deltaY = col * (this.boardSize / ROWS);
419
- // const keyframes: Keyframe[] = [
420
- // { opacity: 0, transform: `translate(${deltaX}px, ${deltaY}px)` },
421
- // { opacity: 1, transform: `translate(${deltaX}px, ${deltaY}px)` },
422
- // ];
423
- // const options: KeyframeAnimationOptions = {
424
- // duration: this.animationInDuration,
425
- // easing: 'ease-in',
426
- // };
427
- // const anim = new Animation(new KeyframeEffect(elm, keyframes, options));
428
- // anim.id = `piece-enter-${crypto.randomUUID()}`;
429
- // const cb = () => {
430
- // translateElement(elm, deltaX, deltaY);
431
- // };
432
- // return [anim, cb];
433
- // }
434
-
435
- // private createPieceExitAnimation(elm: HTMLElement): [Animation, () => void] {
436
- // const keyframes: Keyframe[] = [{ opacity: 1 }, { opacity: 0 }];
437
- // const options: KeyframeAnimationOptions = {
438
- // duration: this.animationOutDuration,
439
- // easing: 'ease-out',
440
- // };
441
- // const anim = new Animation(new KeyframeEffect(elm, keyframes, options));
442
- // anim.id = `piece-exit-${crypto.randomUUID()}`;
443
- // const cb = () => {
444
- // hideElement(elm);
445
- // };
446
- // return [anim, cb];
447
- // }
448
-
449
- // private createPieceMoveAnimation(elm: HTMLElement, src: Coord, dest: Coord): [Animation, () => void] {
450
- // const [srcRow, srcCol] = rowColFromCoord(src, this.orientation);
451
- // const [destRow, destCol] = rowColFromCoord(dest, this.orientation);
452
- // const srcDeltaX = srcCol * (this.boardSize / COLS);
453
- // const srcDeltaY = srcRow * (this.boardSize / ROWS);
454
- // const destDeltaX = destCol * (this.boardSize / COLS);
455
- // const destDeltaY = destRow * (this.boardSize / ROWS);
456
- // const keyframes: Keyframe[] = [
457
- // { transform: `translate(${srcDeltaX}px, ${srcDeltaY}px)` },
458
- // { transform: `translate(${destDeltaX}px, ${destDeltaY}px)` },
459
- // ];
460
- // const options: KeyframeAnimationOptions = {
461
- // duration: this.animationMoveDuration,
462
- // easing: 'ease-in-out',
463
- // };
464
- // const anim = new Animation(new KeyframeEffect(elm, keyframes, options));
465
- // anim.id = `piece-move-${crypto.randomUUID()}`;
466
- // const cb = () => {
467
- // translateElement(elm, destDeltaX, destDeltaY);
468
- // };
469
- // return [anim, cb];
470
- // }
471
-
472
- // private createPieceAnimation(elm: HTMLElement, change: Change): [Animation, () => void] {
473
- // switch (change.op) {
474
- // case 'add':
475
- // return this.createPieceEnterAnimation(elm, change.coord);
476
- // case 'remove':
477
- // return this.createPieceExitAnimation(elm);
478
- // case 'move':
479
- // return this.createPieceMoveAnimation(elm, change.src, change.dest);
480
- // default:
481
- // assertUnreachable(change);
482
- // }
483
- // }
484
-
485
- // private playAnimation(
486
- // animation: Animation,
487
- // opts?: { onFinish?: () => void; onCancel?: () => void; onRemove?: () => void }
488
- // ): void {
489
- // if (opts?.onFinish) {
490
- // animation.addEventListener('finish', opts.onFinish, { once: true });
491
- // }
492
- // if (opts?.onCancel) {
493
- // animation.addEventListener('cancel', opts.onCancel, { once: true });
494
- // }
495
- // if (opts?.onRemove) {
496
- // animation.addEventListener('remove', opts.onRemove, { once: true });
497
- // }
498
- // animation.play();
499
- // }
500
-
501
415
private updateAdoptedStylesheet ( ) : void {
502
416
const sheet = new CSSStyleSheet ( ) ;
503
417
const rules = this . positionCopy . values ( ) . reduce ( ( acc , pd ) => {
0 commit comments