Add animation on modal open/close
This commit is contained in:
parent
a97682b2a4
commit
21025e759e
|
@ -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);
|
||||||
|
@ -85,4 +104,4 @@
|
||||||
40%, 60% {
|
40%, 60% {
|
||||||
transform: translate3d(4px, -4px, 0);
|
transform: translate3d(4px, -4px, 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,6 +8,11 @@
|
||||||
opacity: .85;
|
opacity: .85;
|
||||||
padding: 20px;
|
padding: 20px;
|
||||||
z-index: 9000;
|
z-index: 9000;
|
||||||
|
|
||||||
|
animation: bd-backdrop-in 0.22s ease;
|
||||||
|
&.bd-backdrop-out {
|
||||||
|
animation: bd-backdrop-out 0.22s ease;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.bd-modal {
|
.bd-modal {
|
||||||
|
@ -31,6 +36,11 @@
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
pointer-events: none;
|
pointer-events: none;
|
||||||
z-index: 9001;
|
z-index: 9001;
|
||||||
|
|
||||||
|
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 {
|
||||||
|
@ -139,4 +149,4 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -10,8 +10,8 @@
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<div>
|
<div>
|
||||||
<div class="bd-backdrop" @click="attemptToClose"></div>
|
<div class="bd-backdrop" :class="{'bd-backdrop-out': closing}" @click="attemptToClose"></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">
|
||||||
|
@ -50,7 +50,8 @@
|
||||||
return {
|
return {
|
||||||
changed: false,
|
changed: false,
|
||||||
warnclose: false,
|
warnclose: false,
|
||||||
configCache: []
|
configCache: [],
|
||||||
|
closing: false
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
components: {
|
components: {
|
||||||
|
@ -88,7 +89,14 @@
|
||||||
this.changed = false;
|
this.changed = false;
|
||||||
},
|
},
|
||||||
attemptToClose(e) {
|
attemptToClose(e) {
|
||||||
if (!this.changed) return this.close();
|
if (!this.changed) {
|
||||||
|
this.closing = true;
|
||||||
|
window.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