Skip to content

Commit

Permalink
smooth-reflow doesn't work well with transition on browser other than…
Browse files Browse the repository at this point in the history
  • Loading branch information
Senryoku committed Jun 20, 2020
1 parent f467e35 commit e8d1eae
Show file tree
Hide file tree
Showing 5 changed files with 40 additions and 4 deletions.
13 changes: 9 additions & 4 deletions client/public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,7 @@
</div>

<!-- Draft Controls -->
<template v-if="drafting">
<smooth-reflow v-if="drafting" :options="{transitionEvent: { selector: 'div', property: 'opacity' }}">
<transition :name="'slide-fade-'+((boosterNumber % 2)?'left':'right')" mode="out-in">
<div v-if="draftingState == DraftState.Watching" key="draft-watching" class="draft-watching">
<div class="draft-watching-state">
Expand Down Expand Up @@ -423,7 +423,12 @@ <h2>Winston Draft</h2>
</span>
</div>
<div class="winston-piles">
<div v-for="(pile, index) in winstonDraftState.piles" class="winston-pile" :class="{'winston-current-pile': index === winstonDraftState.currentPile}">
<div
v-for="(pile, index) in winstonDraftState.piles"
:key="`winston-pile-${index}`"
class="winston-pile"
:class="{'winston-current-pile': index === winstonDraftState.currentPile}"
>
<template v-if="userID === winstonDraftState.currentPlayer && index === winstonDraftState.currentPile">
<div class="card-column winstom-card-column">
<card v-for="card in pile" :key="card.uniqueID" :card="card" :language="language"></card>
Expand All @@ -438,7 +443,7 @@ <h2>Winston Draft</h2>
</template>
<template v-else>
<div class="card-column winstom-card-column">
<div v-for="card in pile" class="card"><card-placeholder></card-placeholder></div>
<div v-for="card in pile" :key="card.uniqueID" class="card"><card-placeholder></card-placeholder></div>
</div>
<div class="winston-pile-status" v-show="index === winstonDraftState.currentPile">
{{userByID[winstonDraftState.currentPlayer].userName}} is looking at this pile...
Expand All @@ -447,7 +452,7 @@ <h2>Winston Draft</h2>
</div>
</div>
</div>
</template>
</smooth-reflow>

<!-- Brewing controls (Deck & Sideboard) -->
<div class="container" v-show="(deck !== undefined && deck.length > 0) || (drafting && draftingState !== DraftState.Watching) || draftingState == DraftState.Brewing">
Expand Down
23 changes: 23 additions & 0 deletions client/src/components/SmoothReflow.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<template>
<component :is="tag">
<slot />
</component>
</template>

<script>
import smoothReflow from "vue-smooth-reflow";
export default {
name: "SmoothReflow",
mixins: [smoothReflow],
props: {
tag: {
type: String,
default: "div",
},
options: Object,
},
mounted() {
this.$smoothReflow(this.options);
},
};
</script>
2 changes: 2 additions & 0 deletions client/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import VTooltip from "v-tooltip";
import VueClazyLoad from "./vue-clazy-load.js";
import Multiselect from "vue-multiselect";
import Swal from "sweetalert2";
import SmoothReflow from "./components/SmoothReflow.vue";

import Constant from "./constants.json";
import DefaultLoc from "../public/data/MTGACards.en.json";
Expand Down Expand Up @@ -68,6 +69,7 @@ var app = new Vue({
el: "#main-vue",
components: {
Modal,
SmoothReflow,
Toggle,
CardPlaceholder,
Card,
Expand Down
5 changes: 5 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
"v-tooltip": "^2.0.3",
"vue": "^2.6.11",
"vue-multiselect": "^2.1.6",
"vue-smooth-reflow": "^0.1.12",
"vuedraggable": "^2.23.2"
},
"devDependencies": {
Expand Down

0 comments on commit e8d1eae

Please sign in to comment.