Skip to content
This repository has been archived by the owner on Feb 12, 2022. It is now read-only.

Commit

Permalink
fix animation on refresh page for is-at-final marbles
Browse files Browse the repository at this point in the history
  • Loading branch information
mort3za committed Jul 4, 2019
1 parent 7fb43d4 commit e88b724
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 2 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ludo",
"version": "v1.1.0",
"version": "v1.1.1",
"private": true,
"scripts": {
"start": "yarn serve",
Expand Down
17 changes: 16 additions & 1 deletion src/components/Marble.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,10 @@
:class="[{moveable: model.isMoveable, 'is-moving': model.isMoving}, `is-side-${model.side}`]"
:style="getWrapperStyle()"
>
<span class="inner d-block" :class="{'is-at-final': model.isAtFinal}"></span>
<span
class="inner d-block"
:class="{'is-at-final': model.isAtFinal, 'no-animation': noAnimation}"
></span>
</span>
</template>

Expand All @@ -17,9 +20,18 @@ import store from "@/store/index.ts";
@Component
export default class MarbleComponent extends Vue {
noAnimation = false;
@Prop({ type: Object as () => Marble })
public model!: Marble;
mounted() {
// no animation on refresh page
if (this.model.isAtFinal) {
this.noAnimation = true;
}
}
get boardWidth(): number {
return store.getters["board/boardWidth"];
}
Expand Down Expand Up @@ -64,6 +76,9 @@ export default class MarbleComponent extends Vue {
animation: #{$marble-go-to-heaven-duration}ms linear 0s 1 scale-easeInBounce;
transform: scale(0);
}
&.no-animation {
animation: none;
}
}
.moveable {
cursor: pointer;
Expand Down

0 comments on commit e88b724

Please sign in to comment.