Animationsbug behiben

This commit is contained in:
silas 2018-09-18 13:55:57 +02:00
parent d029ea130b
commit f7f3a5c405
4 changed files with 8 additions and 4 deletions

File diff suppressed because one or more lines are too long

View File

@ -4677,6 +4677,8 @@ class ParentSegment extends Segment {
}
async rotate() {
let timeout = 1250;
if (!this.getLevel().getHasWon()) {
this.rotation += 90;
this.rotation %= 360;
@ -4688,7 +4690,7 @@ class ParentSegment extends Segment {
let self = this;
let delayPromise = new Promise(function (resolve) {
setTimeout(resolve, 250);
setTimeout(resolve, timeout);
}).then(() => {
if (self.rotation === currentRotation) {
self.element.classList.remove("rotating");

View File

@ -50,6 +50,8 @@ export class ParentSegment extends Segment {
}
async rotate() {
let timeout = 250;
if (!this.getLevel().getHasWon()) {
this.rotation += 90;
this.rotation %= 360;
@ -61,7 +63,7 @@ export class ParentSegment extends Segment {
let self = this;
let delayPromise = new Promise(function (resolve) {
setTimeout(resolve, 250);
setTimeout(resolve, timeout);
}).then(() => {
if (self.rotation === currentRotation) {
self.element.classList.remove("rotating");

View File

@ -28,7 +28,6 @@ $animationDuration: 0.25s;
&.rotating {
z-index: 10 !important;
overflow: hidden;
vertical-align: top;
@for $i from 1 through length($rotationDegrees) {
&.rotate-#{nth($rotationDegrees, $i)} {
@ -108,6 +107,7 @@ $animationDuration: 0.25s;
}
.segment {
vertical-align: top;
white-space: initial;
cursor: pointer;
display: inline-block;