Merge pull request #79 from samuelthomas2774/add-modal-animation
Add animation on modal open/close
This commit is contained in:
commit
e65e4d116e
|
@ -69,6 +69,25 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@keyframes bd-modal-in {
|
||||||
|
0% { transform: scale(0.8); opacity: 0; }
|
||||||
|
90% { transform: scale(1.01); opacity: 1; }
|
||||||
|
100% { transform: scale(1); opacity: 1; }
|
||||||
|
}
|
||||||
|
@keyframes bd-modal-out {
|
||||||
|
0% { transform: scale(1); opacity: 1; }
|
||||||
|
10% { transform: scale(1.01); opacity: 1; }
|
||||||
|
90% { opacity: 0; }
|
||||||
|
100% { transform: scale(0.8); opacity: 0; }
|
||||||
|
}
|
||||||
|
|
||||||
|
@keyframes bd-backdrop-in {
|
||||||
|
0% { opacity: 0; }
|
||||||
|
}
|
||||||
|
@keyframes bd-backdrop-out {
|
||||||
|
100% { opacity: 0; }
|
||||||
|
}
|
||||||
|
|
||||||
@keyframes bd-warn-shake {
|
@keyframes bd-warn-shake {
|
||||||
10%, 90% {
|
10%, 90% {
|
||||||
transform: translate3d(-4px, -4px, 0);
|
transform: translate3d(-4px, -4px, 0);
|
||||||
|
|
|
@ -32,6 +32,11 @@
|
||||||
pointer-events: none;
|
pointer-events: none;
|
||||||
z-index: 9001;
|
z-index: 9001;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
|
animation: bd-modal-in 0.22s ease;
|
||||||
|
|
||||||
|
&.bd-modal-out {
|
||||||
|
animation: bd-modal-out 0.22s ease;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.bd-modal .bd-modal-inner {
|
.bd-modal .bd-modal-inner {
|
||||||
|
|
|
@ -10,8 +10,8 @@
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<div class="bd-plugin-settings-modal">
|
<div class="bd-plugin-settings-modal">
|
||||||
<div class="bd-backdrop" @click="attemptToClose"></div>
|
<div class="bd-backdrop" @click="attemptToClose" :class="{'bd-backdrop-out': closing}"></div>
|
||||||
<Modal :headerText="plugin.name + ' Settings'" :close="attemptToClose">
|
<Modal :headerText="plugin.name + ' Settings'" :close="attemptToClose" :class="{'bd-modal-out': closing}">
|
||||||
<div slot="body" class="bd-plugin-settings-body">
|
<div slot="body" class="bd-plugin-settings-body">
|
||||||
<template v-for="category in configCache">
|
<template v-for="category in configCache">
|
||||||
<div v-if="category.category === 'default' || !category.type">
|
<div v-if="category.category === 'default' || !category.type">
|
||||||
|
@ -52,7 +52,8 @@
|
||||||
return {
|
return {
|
||||||
changed: false,
|
changed: false,
|
||||||
warnclose: false,
|
warnclose: false,
|
||||||
configCache: []
|
configCache: [],
|
||||||
|
closing: false
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
components: {
|
components: {
|
||||||
|
@ -91,7 +92,13 @@
|
||||||
this.changed = false;
|
this.changed = false;
|
||||||
},
|
},
|
||||||
attemptToClose(e) {
|
attemptToClose(e) {
|
||||||
if (!this.changed) return this.close();
|
if (!this.chagned) {
|
||||||
|
this.closing = true;
|
||||||
|
setTimeout(() => {
|
||||||
|
this.close();
|
||||||
|
}, 200);
|
||||||
|
return;
|
||||||
|
}
|
||||||
this.warnclose = true;
|
this.warnclose = true;
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
this.warnclose = false;
|
this.warnclose = false;
|
||||||
|
|
|
@ -15,13 +15,13 @@
|
||||||
<div class="bd-flex-grow bd-button" :class="{'bd-active': local}" @click="showLocal">
|
<div class="bd-flex-grow bd-button" :class="{'bd-active': local}" @click="showLocal">
|
||||||
<h3>Local</h3>
|
<h3>Local</h3>
|
||||||
<div class="bd-material-button" @click="refreshLocal">
|
<div class="bd-material-button" @click="refreshLocal">
|
||||||
<refresh />
|
<MiRefresh />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="bd-flex-grow bd-button" :class="{'bd-active': !local}" @click="showOnline">
|
<div class="bd-flex-grow bd-button" :class="{'bd-active': !local}" @click="showOnline">
|
||||||
<h3>Online</h3>
|
<h3>Online</h3>
|
||||||
<div class="bd-material-button">
|
<div class="bd-material-button">
|
||||||
<refresh />
|
<MiRefresh />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -42,7 +42,7 @@
|
||||||
import { SettingsWrapper } from './';
|
import { SettingsWrapper } from './';
|
||||||
import PluginCard from './PluginCard.vue';
|
import PluginCard from './PluginCard.vue';
|
||||||
import PluginSettingsModal from './PluginSettingsModal.vue';
|
import PluginSettingsModal from './PluginSettingsModal.vue';
|
||||||
import Refresh from 'vue-material-design-icons/refresh.vue';
|
import { MiRefresh } from '../common';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
|
@ -53,7 +53,8 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
components: {
|
components: {
|
||||||
SettingsWrapper, PluginCard, PluginSettingsModal, Refresh
|
SettingsWrapper, PluginCard, PluginSettingsModal,
|
||||||
|
MiRefresh
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
showLocal() {
|
showLocal() {
|
||||||
|
|
Loading…
Reference in New Issue