[Client] Add some animations 🎨

This commit is contained in:
syuilo 2018-12-16 11:32:20 +09:00
parent a70070ac7d
commit d18ee12d2f
No known key found for this signature in database
GPG key ID: BDC4C49D06AB9D69
7 changed files with 67 additions and 40 deletions

View file

@ -225,6 +225,7 @@
"vue-loader": "15.4.2", "vue-loader": "15.4.2",
"vue-marquee-text-component": "1.1.0", "vue-marquee-text-component": "1.1.0",
"vue-router": "3.0.2", "vue-router": "3.0.2",
"vue-sequential-entrance": "1.1.3",
"vue-style-loader": "4.1.2", "vue-style-loader": "4.1.2",
"vue-svg-inline-loader": "1.2.4", "vue-svg-inline-loader": "1.2.4",
"vue-template-compiler": "2.5.17", "vue-template-compiler": "2.5.17",

View file

@ -18,6 +18,7 @@
<option value="remote">{{ $t('origin.remote') }}</option> <option value="remote">{{ $t('origin.remote') }}</option>
</ui-select> </ui-select>
</ui-horizon-group> </ui-horizon-group>
<sequential-entrance animation="entranceFromTop" delay="25">
<div class="kidvdlkg" v-for="file in files"> <div class="kidvdlkg" v-for="file in files">
<div @click="file._open = !file._open"> <div @click="file._open = !file._open">
<div> <div>
@ -41,6 +42,7 @@
<ui-button @click="del(file)"><fa :icon="faTrashAlt"/> {{ $t('delete') }}</ui-button> <ui-button @click="del(file)"><fa :icon="faTrashAlt"/> {{ $t('delete') }}</ui-button>
</div> </div>
</div> </div>
</sequential-entrance>
<ui-button v-if="existMore" @click="fetch">{{ $t('@.load-more') }}</ui-button> <ui-button v-if="existMore" @click="fetch">{{ $t('@.load-more') }}</ui-button>
</section> </section>
</ui-card> </ui-card>

View file

@ -38,6 +38,7 @@
<option value="remote">{{ $t('users.origin.remote') }}</option> <option value="remote">{{ $t('users.origin.remote') }}</option>
</ui-select> </ui-select>
</ui-horizon-group> </ui-horizon-group>
<sequential-entrance animation="entranceFromTop" delay="25">
<div class="kofvwchc" v-for="user in users"> <div class="kofvwchc" v-for="user in users">
<div> <div>
<a :href="user | userPage(null, true)"> <a :href="user | userPage(null, true)">
@ -57,6 +58,7 @@
</div> </div>
</div> </div>
</div> </div>
</sequential-entrance>
<ui-button v-if="existMore" @click="fetchUsers">{{ $t('@.load-more') }}</ui-button> <ui-button v-if="existMore" @click="fetchUsers">{{ $t('@.load-more') }}</ui-button>
</section> </section>
</ui-card> </ui-card>

View file

@ -10,3 +10,19 @@
opacity: 0; opacity: 0;
transform: scaleY(0); transform: scaleY(0);
} }
.entranceFromTop {
animation-duration: 0.5s;
animation-name: entranceFromTop;
}
@keyframes entranceFromTop {
from {
opacity: 0;
transform: translateY(-64px);
}
to {
opacity: 1;
transform: translateY(0);
}
}

View file

@ -1,9 +1,11 @@
<template> <template>
<mk-ui> <mk-ui>
<main v-if="!fetching"> <main v-if="!fetching">
<sequential-entrance animation="entranceFromTop" delay="25">
<template v-for="favorite in favorites"> <template v-for="favorite in favorites">
<mk-note-detail class="post" :note="favorite.note" :key="favorite.note.id"/> <mk-note-detail class="post" :note="favorite.note" :key="favorite.note.id"/>
</template> </template>
</sequential-entrance>
<div class="more" v-if="existMore"> <div class="more" v-if="existMore">
<ui-button inline @click="more">{{ $t('@.load-more') }}</ui-button> <ui-button inline @click="more">{{ $t('@.load-more') }}</ui-button>
</div> </div>
@ -75,7 +77,7 @@ main
padding 16px padding 16px
max-width 700px max-width 700px
> .post > * > .post
margin-bottom 16px margin-bottom 16px
> .more > .more

View file

@ -8,6 +8,7 @@ import VueRouter from 'vue-router';
import VAnimateCss from 'v-animate-css'; import VAnimateCss from 'v-animate-css';
import VModal from 'vue-js-modal'; import VModal from 'vue-js-modal';
import VueI18n from 'vue-i18n'; import VueI18n from 'vue-i18n';
import SequentialEntrance from 'vue-sequential-entrance';
import VueHotkey from './common/hotkey'; import VueHotkey from './common/hotkey';
import App from './app.vue'; import App from './app.vue';
@ -287,6 +288,7 @@ Vue.use(VAnimateCss);
Vue.use(VModal); Vue.use(VModal);
Vue.use(VueHotkey); Vue.use(VueHotkey);
Vue.use(VueI18n); Vue.use(VueI18n);
Vue.use(SequentialEntrance);
Vue.component('fa', FontAwesomeIcon); Vue.component('fa', FontAwesomeIcon);

View file

@ -3,9 +3,11 @@
<span slot="header"><span style="margin-right:4px;"><fa icon="star"/></span>{{ $t('title') }}</span> <span slot="header"><span style="margin-right:4px;"><fa icon="star"/></span>{{ $t('title') }}</span>
<main> <main>
<sequential-entrance animation="entranceFromTop" delay="25">
<template v-for="favorite in favorites"> <template v-for="favorite in favorites">
<mk-note-detail class="post" :note="favorite.note" :key="favorite.note.id"/> <mk-note-detail class="post" :note="favorite.note" :key="favorite.note.id"/>
</template> </template>
</sequential-entrance>
<ui-button v-if="existMore" @click="more">{{ $t('@.load-more') }}</ui-button> <ui-button v-if="existMore" @click="more">{{ $t('@.load-more') }}</ui-button>
</main> </main>
</mk-ui> </mk-ui>
@ -79,13 +81,13 @@ main
margin 0 auto margin 0 auto
padding 8px padding 8px
> .post > * > .post
margin-bottom 8px margin-bottom 8px
@media (min-width 500px) @media (min-width 500px)
padding 16px padding 16px
> .post > * > .post
margin-bottom 16px margin-bottom 16px
@media (min-width 600px) @media (min-width 600px)