Hide lower modals

This commit is contained in:
Samuel Elliott 2018-02-13 17:37:05 +00:00
parent 2ec2df6efd
commit 98261a864d
1 changed files with 3 additions and 3 deletions

View File

@ -12,7 +12,7 @@
<div class="bd-modals-container"> <div class="bd-modals-container">
<div v-for="(modal, index) in modals.stack" :key="`bd-modal-${index}`"> <div v-for="(modal, index) in modals.stack" :key="`bd-modal-${index}`">
<div class="bd-backdrop" :class="{'bd-backdrop-out': modal.closing}" :style="{opacity: index === 0 ? undefined : 0}"></div> <div class="bd-backdrop" :class="{'bd-backdrop-out': modal.closing}" :style="{opacity: index === 0 ? undefined : 0}"></div>
<div class="bd-modal-wrap" :style="{transform: `scale(${downscale(index + 1)})`, opacity: downscale(index + 1) / 0.5 + 0.5}"> <div class="bd-modal-wrap" :style="{transform: `scale(${downscale(index + 1, 0.2)})`, opacity: downscale(index + 1, 1)}">
<div class="bd-modal-close-area" @click="closeModal(modal)"></div> <div class="bd-modal-close-area" @click="closeModal(modal)"></div>
<component :is="modal.component" /> <component :is="modal.component" />
</div> </div>
@ -50,8 +50,8 @@
closeModal(modal) { closeModal(modal) {
modal.close(); modal.close();
}, },
downscale(index) { downscale(index, times) {
return 1 - ((this.modals.stack.filter(m => !m.closing).length - index) * 0.2); return 1 - ((this.modals.stack.filter(m => !m.closing).length - index) * times);
} }
} }
} }