2019-06-24 00:29:14 +02:00
|
|
|
<template>
|
|
|
|
<div>
|
2020-01-08 00:39:20 +01:00
|
|
|
<div class="container" v-if="this.showAccounts">
|
2020-01-31 14:03:46 +01:00
|
|
|
<!-- header -->
|
|
|
|
<div class="columns is-gapless is-mobile is-centered">
|
2020-01-11 16:46:59 +01:00
|
|
|
<div class="column is-three-quarters-mobile is-one-third-tablet is-one-quarter-desktop is-one-quarter-widescreen is-one-quarter-fullhd">
|
2020-01-31 14:03:46 +01:00
|
|
|
<!-- toolbar -->
|
|
|
|
<div class="toolbar has-text-centered" v-if="editMode">
|
2020-01-31 23:05:06 +01:00
|
|
|
<a class="button" :class="{ 'is-dark': selectedAccounts.length === 0, 'is-danger': selectedAccounts.length > 0 }" :disabled="selectedAccounts.length == 0" @click="destroyAccounts">
|
2020-01-31 14:03:46 +01:00
|
|
|
<span class="icon is-small">
|
|
|
|
<font-awesome-icon :icon="['fas', 'trash']" />
|
|
|
|
</span>
|
2020-02-02 22:57:43 +01:00
|
|
|
<span>{{ $t('commons.delete') }}</span>
|
2020-01-31 14:03:46 +01:00
|
|
|
</a>
|
|
|
|
</div>
|
|
|
|
<!-- search -->
|
|
|
|
<div class="field" v-else>
|
2020-01-11 16:46:59 +01:00
|
|
|
<div class="control has-icons-right">
|
2020-01-12 19:55:17 +01:00
|
|
|
<input type="text" class="input is-rounded is-search" v-model="search">
|
2020-01-11 16:46:59 +01:00
|
|
|
<span class="icon is-small is-right">
|
|
|
|
<font-awesome-icon :icon="['fas', 'search']" v-if="!search" />
|
|
|
|
<a class="delete" v-if="search" @click="search = '' "></a>
|
|
|
|
</span>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
2020-01-29 14:54:39 +01:00
|
|
|
<!-- accounts -->
|
2020-02-10 10:23:21 +01:00
|
|
|
<vue-pull-refresh :on-refresh="onRefresh" :config="{
|
|
|
|
errorLabel: 'error',
|
|
|
|
startLabel: '',
|
|
|
|
readyLabel: '',
|
|
|
|
loadingLabel: 'refreshing'
|
|
|
|
}" class="accounts columns is-multiline is-centered">
|
|
|
|
<div class="tfa column is-narrow has-text-white" v-for="account in filteredAccounts">
|
|
|
|
<div class="tfa-container">
|
2020-02-10 17:28:30 +01:00
|
|
|
<transition name="slideCheckbox">
|
|
|
|
<div class="tfa-checkbox" v-if="editMode">
|
|
|
|
<div class="field">
|
|
|
|
<input class="is-checkradio is-small is-white" :id="'ckb_' + account.id" :value="account.id" type="checkbox" :name="'ckb_' + account.id" v-model="selectedAccounts">
|
|
|
|
<label :for="'ckb_' + account.id"></label>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</transition>
|
2020-02-10 10:23:21 +01:00
|
|
|
<div class="tfa-content is-size-3 is-size-4-mobile" @click.stop="showAccount(account)">
|
|
|
|
<div class="tfa-text has-ellipsis">
|
|
|
|
<img :src="'/storage/icons/' + account.icon" v-if="account.icon">
|
|
|
|
{{ account.service }}
|
|
|
|
<span class="is-family-primary is-size-6 is-size-7-mobile has-text-grey ">{{ account.account }}</span>
|
2020-01-30 23:06:16 +01:00
|
|
|
</div>
|
|
|
|
</div>
|
2020-02-10 17:28:30 +01:00
|
|
|
<transition name="fadeInOut">
|
|
|
|
<div class="tfa-dots has-text-grey" v-if="editMode">
|
|
|
|
<router-link :to="{ name: 'edit', params: { twofaccountId: account.id }}" class="tag is-dark is-rounded">
|
|
|
|
{{ $t('commons.edit') }}
|
|
|
|
</router-link>
|
|
|
|
</div>
|
|
|
|
</transition>
|
2020-01-29 14:54:39 +01:00
|
|
|
</div>
|
2020-02-10 10:23:21 +01:00
|
|
|
</div>
|
|
|
|
</vue-pull-refresh>
|
2019-06-24 00:29:14 +02:00
|
|
|
</div>
|
2020-01-29 14:54:39 +01:00
|
|
|
<!-- No account -->
|
2020-02-04 17:06:11 +01:00
|
|
|
<div class="container has-text-centered" v-show="showQuickForm">
|
|
|
|
<div class="columns is-mobile" :class="{ 'is-invisible' : this.accounts.length > 0}">
|
2020-02-04 22:42:18 +01:00
|
|
|
<div class="column quickform-header">
|
2020-02-04 17:06:11 +01:00
|
|
|
{{ $t('twofaccounts.no_account_here') }}<br>
|
|
|
|
{{ $t('twofaccounts.add_first_account') }}
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="container">
|
|
|
|
<form @submit.prevent="createAccount" @keydown="form.onKeydown($event)">
|
|
|
|
<div class="columns is-mobile no-account is-vcentered">
|
|
|
|
<div class="column has-text-centered">
|
2020-02-10 17:28:30 +01:00
|
|
|
<label :class="{'is-loading' : form.isBusy}" class="button is-link is-medium is-rounded is-focused">
|
2020-02-04 17:06:11 +01:00
|
|
|
<input class="file-input" type="file" accept="image/*" v-on:change="uploadQrcode" ref="qrcodeInput">
|
|
|
|
{{ $t('twofaccounts.forms.use_qrcode.val') }}
|
|
|
|
</label>
|
|
|
|
</div>
|
|
|
|
</div>
|
2020-02-05 17:51:45 +01:00
|
|
|
<field-error :form="form" field="qrcode" />
|
2020-02-04 17:06:11 +01:00
|
|
|
</form>
|
|
|
|
</div>
|
|
|
|
<div class="columns is-mobile">
|
2020-02-04 22:42:18 +01:00
|
|
|
<div class="column quickform-footer">
|
2020-02-04 17:06:11 +01:00
|
|
|
<router-link :to="{ name: 'create' }" class="is-link">{{ $t('twofaccounts.use_full_form') }}</router-link>
|
|
|
|
</div>
|
|
|
|
</div>
|
2020-01-07 17:05:13 +01:00
|
|
|
</div>
|
2020-01-29 17:23:32 +01:00
|
|
|
<!-- modal -->
|
2019-12-21 23:25:19 +01:00
|
|
|
<modal v-model="ShowTwofaccountInModal">
|
2020-01-22 17:32:41 +01:00
|
|
|
<twofaccount-show ref="TwofaccountShow" ></twofaccount-show>
|
2019-06-24 00:29:14 +02:00
|
|
|
</modal>
|
2020-01-29 17:23:32 +01:00
|
|
|
<!-- footer -->
|
2020-01-07 11:46:18 +01:00
|
|
|
<footer class="has-background-black-ter">
|
2020-01-07 21:45:47 +01:00
|
|
|
<div class="columns is-gapless" v-if="this.accounts.length > 0">
|
2020-01-07 11:46:18 +01:00
|
|
|
<div class="column has-text-centered">
|
2020-01-07 23:10:04 +01:00
|
|
|
<div class="field is-grouped">
|
2020-02-04 17:06:11 +01:00
|
|
|
<!-- New item buttons -->
|
|
|
|
<p class="control" v-if="!showQuickForm && !editMode">
|
|
|
|
<a class="button is-link is-rounded is-focus" @click="showQuickForm = true">
|
2020-01-12 19:55:17 +01:00
|
|
|
<span>{{ $t('twofaccounts.new') }}</span>
|
2020-01-07 11:46:18 +01:00
|
|
|
<span class="icon is-small">
|
2020-01-07 23:10:04 +01:00
|
|
|
<font-awesome-icon :icon="['fas', 'qrcode']" />
|
2020-01-07 11:46:18 +01:00
|
|
|
</span>
|
2020-02-04 17:06:11 +01:00
|
|
|
</a>
|
|
|
|
</p>
|
|
|
|
<!-- Manage button -->
|
|
|
|
<p class="control" v-if="!showQuickForm && !editMode">
|
|
|
|
<a class="button is-dark is-rounded" @click="setEditModeTo(true)">{{ $t('twofaccounts.manage') }}</a>
|
2020-01-07 11:46:18 +01:00
|
|
|
</p>
|
2020-02-04 17:06:11 +01:00
|
|
|
<!-- Done button -->
|
|
|
|
<p class="control" v-if="!showQuickForm && editMode">
|
|
|
|
<a class="button is-success is-rounded" @click="setEditModeTo(false)">
|
2020-01-12 19:55:17 +01:00
|
|
|
<span>{{ $t('twofaccounts.done') }}</span>
|
2020-01-07 11:46:18 +01:00
|
|
|
<span class="icon is-small">
|
2020-01-07 23:10:04 +01:00
|
|
|
<font-awesome-icon :icon="['fas', 'check']" />
|
2020-01-07 11:46:18 +01:00
|
|
|
</span>
|
2020-01-07 23:10:04 +01:00
|
|
|
</a>
|
2020-01-07 11:46:18 +01:00
|
|
|
</p>
|
2020-02-04 17:06:11 +01:00
|
|
|
<!-- Cancel QuickFormButton -->
|
|
|
|
<p class="control" v-if="showQuickForm">
|
2020-02-05 17:51:45 +01:00
|
|
|
<a class="button is-dark is-rounded" @click="cancelQuickForm">
|
2020-02-04 17:06:11 +01:00
|
|
|
{{ $t('commons.cancel') }}
|
|
|
|
</a>
|
|
|
|
</p>
|
2020-01-07 11:46:18 +01:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="content has-text-centered">
|
2020-01-23 23:02:54 +01:00
|
|
|
{{ $t('auth.hello', {username: username}) }} <router-link :to="{ name: 'profile' }" class="has-text-grey">{{ $t('commons.profile') }}</router-link> - <a class="has-text-grey" @click="logout">{{ $t('auth.sign_out') }}</a>
|
2020-01-07 11:46:18 +01:00
|
|
|
</div>
|
|
|
|
</footer>
|
2019-06-24 00:29:14 +02:00
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
|
|
<script>
|
2020-01-19 22:31:23 +01:00
|
|
|
|
2019-06-24 00:29:14 +02:00
|
|
|
import Modal from '../components/Modal'
|
2019-12-21 23:25:19 +01:00
|
|
|
import TwofaccountShow from '../components/TwofaccountShow'
|
2020-02-04 17:06:11 +01:00
|
|
|
import Form from './../components/Form'
|
2020-02-09 23:04:46 +01:00
|
|
|
import vuePullRefresh from 'vue-pull-refresh';
|
2019-06-28 01:16:51 +02:00
|
|
|
|
2019-06-24 00:29:14 +02:00
|
|
|
export default {
|
|
|
|
data(){
|
|
|
|
return {
|
|
|
|
accounts : [],
|
2020-01-31 23:05:06 +01:00
|
|
|
selectedAccounts: [],
|
2019-12-21 23:25:19 +01:00
|
|
|
ShowTwofaccountInModal : false,
|
2020-01-11 16:46:59 +01:00
|
|
|
search: '',
|
2020-01-07 11:46:18 +01:00
|
|
|
username : null,
|
2020-01-08 00:39:20 +01:00
|
|
|
editMode: this.InitialEditMode,
|
2020-02-09 23:04:46 +01:00
|
|
|
showQuickForm: false,
|
2020-02-04 17:06:11 +01:00
|
|
|
form: new Form({
|
|
|
|
qrcode: null
|
|
|
|
}),
|
2019-06-24 00:29:14 +02:00
|
|
|
}
|
|
|
|
},
|
2020-01-07 15:46:48 +01:00
|
|
|
|
2020-01-11 16:46:59 +01:00
|
|
|
computed: {
|
|
|
|
filteredAccounts() {
|
|
|
|
return this.accounts.filter(
|
|
|
|
item => {
|
|
|
|
return item.service.toLowerCase().includes(this.search.toLowerCase()) || item.account.toLowerCase().includes(this.search.toLowerCase());
|
|
|
|
}
|
|
|
|
);
|
2020-01-31 23:05:06 +01:00
|
|
|
},
|
2020-02-04 17:06:11 +01:00
|
|
|
|
|
|
|
showAccounts() {
|
2020-02-09 23:04:46 +01:00
|
|
|
return this.accounts.length > 0 && !this.showQuickForm ? true : false
|
2020-02-04 17:06:11 +01:00
|
|
|
},
|
2020-01-11 16:46:59 +01:00
|
|
|
},
|
|
|
|
|
2020-01-07 15:46:48 +01:00
|
|
|
props: ['InitialEditMode'],
|
|
|
|
|
2020-01-30 16:13:51 +01:00
|
|
|
created() {
|
2019-06-24 00:29:14 +02:00
|
|
|
|
2020-01-15 23:00:06 +01:00
|
|
|
this.username = localStorage.getItem('user')
|
2020-01-31 23:05:06 +01:00
|
|
|
this.fetchAccounts()
|
2019-07-02 00:48:48 +02:00
|
|
|
|
2020-01-07 17:05:13 +01:00
|
|
|
// stop OTP generation on modal close
|
2019-07-02 00:48:48 +02:00
|
|
|
this.$on('modalClose', function() {
|
|
|
|
console.log('modalClose triggered')
|
2020-01-22 15:27:33 +01:00
|
|
|
this.$refs.TwofaccountShow.clearOTP()
|
2019-07-02 00:48:48 +02:00
|
|
|
});
|
2020-01-07 17:05:13 +01:00
|
|
|
|
2019-06-24 00:29:14 +02:00
|
|
|
},
|
2020-01-07 15:46:48 +01:00
|
|
|
|
2019-06-24 00:29:14 +02:00
|
|
|
components: {
|
|
|
|
Modal,
|
2019-12-21 23:25:19 +01:00
|
|
|
TwofaccountShow,
|
2020-02-09 23:04:46 +01:00
|
|
|
'vue-pull-refresh': vuePullRefresh
|
2019-06-24 00:29:14 +02:00
|
|
|
},
|
2020-01-08 00:39:20 +01:00
|
|
|
|
2019-06-24 00:29:14 +02:00
|
|
|
methods: {
|
2020-01-31 23:05:06 +01:00
|
|
|
|
2020-02-09 23:04:46 +01:00
|
|
|
onRefresh() {
|
|
|
|
var that = this
|
|
|
|
|
|
|
|
return new Promise(function (resolve, reject) {
|
|
|
|
setTimeout(function () {
|
|
|
|
that.fetchAccounts()
|
|
|
|
resolve();
|
|
|
|
}, 1000);
|
|
|
|
});
|
|
|
|
},
|
|
|
|
|
2020-02-04 17:06:11 +01:00
|
|
|
async uploadQrcode(event) {
|
|
|
|
|
|
|
|
let imgdata = new FormData();
|
|
|
|
imgdata.append('qrcode', this.$refs.qrcodeInput.files[0]);
|
|
|
|
|
|
|
|
const { data } = await this.form.upload('/api/qrcode/decode', imgdata)
|
|
|
|
|
|
|
|
this.$router.push({ name: 'create', params: { qrAccount: data } });
|
|
|
|
|
|
|
|
},
|
|
|
|
|
2020-01-31 23:05:06 +01:00
|
|
|
fetchAccounts() {
|
|
|
|
this.accounts = []
|
|
|
|
this.selectedAccounts = []
|
|
|
|
|
|
|
|
this.axios.get('api/twofaccounts').then(response => {
|
|
|
|
response.data.forEach((data) => {
|
|
|
|
this.accounts.push({
|
|
|
|
id : data.id,
|
|
|
|
service : data.service,
|
|
|
|
account : data.account ? data.account : '-',
|
|
|
|
icon : data.icon
|
|
|
|
})
|
|
|
|
})
|
|
|
|
|
2020-02-09 23:04:46 +01:00
|
|
|
this.showQuickForm = response.data.length === 0 ? true: false
|
2020-01-31 23:05:06 +01:00
|
|
|
})
|
|
|
|
},
|
|
|
|
|
2020-02-06 16:08:46 +01:00
|
|
|
showAccount(account) {
|
|
|
|
if(this.editMode) {
|
|
|
|
|
|
|
|
for (var i=0 ; i<this.selectedAccounts.length ; i++) {
|
|
|
|
if ( this.selectedAccounts[i] === account.id ) {
|
|
|
|
this.selectedAccounts.splice(i,1);
|
|
|
|
return
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
this.selectedAccounts.push(account.id)
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
this.$refs.TwofaccountShow.showAccount(account.id)
|
|
|
|
}
|
2020-01-02 00:09:52 +01:00
|
|
|
},
|
|
|
|
|
|
|
|
deleteAccount: function (id) {
|
2020-01-12 19:55:17 +01:00
|
|
|
if(confirm(this.$t('twofaccounts.confirm.delete'))) {
|
2020-01-26 21:04:33 +01:00
|
|
|
this.axios.delete('/api/twofaccounts/' + id)
|
2020-01-08 00:39:20 +01:00
|
|
|
|
2020-01-31 23:05:06 +01:00
|
|
|
// Remove the deleted account from the collection
|
|
|
|
this.accounts = this.accounts.filter(a => a.id !== id)
|
2020-01-06 22:03:40 +01:00
|
|
|
}
|
2020-01-07 11:46:18 +01:00
|
|
|
},
|
|
|
|
|
2020-01-31 23:05:06 +01:00
|
|
|
async destroyAccounts() {
|
|
|
|
if(confirm(this.$t('twofaccounts.confirm.delete'))) {
|
|
|
|
|
|
|
|
let ids = []
|
2020-02-06 16:08:46 +01:00
|
|
|
this.selectedAccounts.forEach(id => ids.push(id))
|
2020-01-31 23:05:06 +01:00
|
|
|
|
|
|
|
// Backend will delete all accounts at the same time
|
|
|
|
await this.axios.delete('/api/twofaccounts/batch', {data: ids} )
|
|
|
|
|
|
|
|
// we fetch the accounts again to prevent the js collection being
|
|
|
|
// desynchronize from the backend php collection
|
|
|
|
this.fetchAccounts()
|
|
|
|
}
|
|
|
|
},
|
|
|
|
|
2020-01-26 21:57:53 +01:00
|
|
|
async logout(evt) {
|
2020-01-12 19:55:17 +01:00
|
|
|
if(confirm(this.$t('auth.confirm.logout'))) {
|
2020-01-07 11:46:18 +01:00
|
|
|
|
2020-01-26 21:57:53 +01:00
|
|
|
await this.axios.get('api/logout')
|
2020-01-16 17:12:25 +01:00
|
|
|
|
2020-01-26 21:57:53 +01:00
|
|
|
localStorage.removeItem('jwt');
|
|
|
|
localStorage.removeItem('user');
|
2020-01-07 11:46:18 +01:00
|
|
|
|
2020-01-26 21:57:53 +01:00
|
|
|
delete this.axios.defaults.headers.common['Authorization'];
|
|
|
|
|
|
|
|
this.$router.go('/login');
|
2020-01-19 22:29:36 +01:00
|
|
|
|
2020-01-07 11:46:18 +01:00
|
|
|
}
|
2020-01-31 11:44:45 +01:00
|
|
|
},
|
|
|
|
|
|
|
|
setEditModeTo(state) {
|
2020-01-31 23:12:51 +01:00
|
|
|
if( state === false ) {
|
|
|
|
this.selectedAccounts = []
|
|
|
|
}
|
2020-02-06 16:31:05 +01:00
|
|
|
else {
|
|
|
|
this.search = '';
|
|
|
|
}
|
2020-01-31 23:12:51 +01:00
|
|
|
|
2020-01-31 11:44:45 +01:00
|
|
|
this.editMode = state
|
|
|
|
this.$parent.showToolbar = state
|
2020-02-04 17:06:11 +01:00
|
|
|
},
|
2020-01-07 11:46:18 +01:00
|
|
|
|
2020-02-05 17:51:45 +01:00
|
|
|
cancelQuickForm() {
|
|
|
|
this.form.clear()
|
|
|
|
this.showQuickForm = false
|
|
|
|
}
|
2019-06-24 00:29:14 +02:00
|
|
|
},
|
2020-01-08 00:39:20 +01:00
|
|
|
|
2020-01-27 21:13:21 +01:00
|
|
|
beforeRouteEnter (to, from, next) {
|
|
|
|
if ( ! localStorage.getItem('jwt')) {
|
|
|
|
return next('login')
|
|
|
|
}
|
2019-06-24 00:29:14 +02:00
|
|
|
|
2020-01-27 21:13:21 +01:00
|
|
|
next()
|
|
|
|
}
|
2020-02-10 17:28:30 +01:00
|
|
|
};
|
2019-06-28 01:16:51 +02:00
|
|
|
|
2019-06-24 00:29:14 +02:00
|
|
|
</script>
|
|
|
|
|
2020-02-10 17:28:30 +01:00
|
|
|
<style>
|
|
|
|
|
|
|
|
.fadeInOut-enter-active {
|
|
|
|
animation: fadeIn 500ms
|
|
|
|
}
|
|
|
|
.fadeInOut-leave-active {
|
|
|
|
animation: fadeOut 500ms
|
|
|
|
}
|
|
|
|
|
|
|
|
.slideCheckbox-enter-active {
|
|
|
|
animation: enterFromTop 500ms
|
|
|
|
}
|
|
|
|
|
|
|
|
.slideCheckbox-enter-active + .tfa-content {
|
|
|
|
animation: addTopOffset 500ms
|
|
|
|
}
|
|
|
|
|
|
|
|
.slideCheckbox-leave-active {
|
|
|
|
animation: leaveToTop 500ms
|
|
|
|
}
|
|
|
|
|
|
|
|
.slideCheckbox-leave-active + .tfa-content {
|
|
|
|
animation: removeTopOffset 500ms
|
|
|
|
}
|
|
|
|
|
|
|
|
@media screen and (max-width: 768px) {
|
|
|
|
.slideCheckbox-enter-active {
|
|
|
|
animation: enterFromLeft 500ms
|
|
|
|
}
|
|
|
|
|
|
|
|
.slideCheckbox-enter-active + .tfa-content {
|
|
|
|
animation: addLeftOffset 500ms
|
|
|
|
}
|
|
|
|
|
|
|
|
.slideCheckbox-leave-active {
|
|
|
|
animation: leaveToLeft 500ms
|
|
|
|
}
|
|
|
|
|
|
|
|
.slideCheckbox-leave-active + .tfa-content {
|
|
|
|
animation: removeLeftOffset 500ms
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/*FadeInOut*/
|
|
|
|
|
|
|
|
@keyframes fadeIn {
|
|
|
|
from {
|
|
|
|
opacity: 0;
|
|
|
|
}
|
|
|
|
to {
|
|
|
|
opacity: 1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
@media screen and (max-width: 768px) {
|
|
|
|
@keyframes fadeIn {
|
|
|
|
from {
|
|
|
|
opacity: 0;
|
|
|
|
}
|
|
|
|
75% {
|
|
|
|
opacity: 0;
|
|
|
|
}
|
|
|
|
to {
|
|
|
|
opacity: 1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
@keyframes fadeOut {
|
|
|
|
from {
|
|
|
|
opacity: 1;
|
|
|
|
}
|
|
|
|
to {
|
|
|
|
opacity: 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/*Enter from left*/
|
|
|
|
@keyframes enterFromLeft {
|
|
|
|
from {
|
|
|
|
transform: translateX(-100%);
|
|
|
|
opacity: 0;
|
|
|
|
}
|
|
|
|
to {
|
|
|
|
transform: translateX(0);
|
|
|
|
opacity: 1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
@keyframes addLeftOffset {
|
|
|
|
from {
|
|
|
|
transform: translateX(-2.875rem);
|
|
|
|
}
|
|
|
|
to {
|
|
|
|
transform: translateX(0);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/*Enter from top*/
|
|
|
|
@keyframes enterFromTop {
|
|
|
|
from {
|
|
|
|
transform: translateY(-50%);
|
|
|
|
opacity: 0;
|
|
|
|
}
|
|
|
|
to {
|
|
|
|
transform: translateY(0);
|
|
|
|
opacity: 1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
@keyframes addTopOffset {
|
|
|
|
from {
|
|
|
|
transform: translateY(-2rem);
|
|
|
|
}
|
|
|
|
to {
|
|
|
|
transform: translateY(0);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/*Leave from left*/
|
|
|
|
@keyframes leaveToLeft {
|
|
|
|
from {
|
|
|
|
transform: translateX(0);
|
|
|
|
}
|
|
|
|
to {
|
|
|
|
transform: translateX(-100%);
|
|
|
|
opacity: 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
@keyframes removeLeftOffset {
|
|
|
|
from {
|
|
|
|
transform: translateX(0);
|
|
|
|
}
|
|
|
|
to {
|
|
|
|
transform: translateX(-2.875rem);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/*Leave from top*/
|
|
|
|
@keyframes leaveToTop {
|
|
|
|
from {
|
|
|
|
transform: translateY(0);
|
|
|
|
}
|
|
|
|
to {
|
|
|
|
transform: translateY(-50%);
|
|
|
|
opacity: 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
@keyframes removeTopOffset {
|
|
|
|
from {
|
|
|
|
transform: translateY(0);
|
|
|
|
}
|
|
|
|
to {
|
|
|
|
transform: translateY(-2rem);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
</style>
|