perf(client): ウェルカムページを最適化 (#9960)

* perf(client): ウェルカムページの最適化

* remove max
This commit is contained in:
tamaina 2023-02-17 12:38:30 +09:00 committed by GitHub
parent dd52be3a01
commit e8c5307f66
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 60 additions and 81 deletions

View file

@ -32,7 +32,7 @@
</div>
</div>
</div>
<div v-if="instances" class="federation">
<div v-if="instances && instances.length > 0" class="federation">
<MarqueeText :duration="40">
<MkA v-for="instance in instances" :key="instance.id" :class="$style.federationInstance" :to="`/instance-info/${instance.host}`" behavior="window">
<!--<MkInstanceCardMini :instance="instance"/>-->
@ -56,33 +56,16 @@ import MkFeaturedPhotos from '@/components/MkFeaturedPhotos.vue';
import { instanceName } from '@/config';
import * as os from '@/os';
import { i18n } from '@/i18n';
import { Instance } from 'misskey-js/built/entities';
let meta = $ref();
let stats = $ref();
let tags = $ref();
let onlineUsersCount = $ref();
let instances = $ref();
let meta = $ref<Instance>();
let instances = $ref<any[]>();
os.api('meta', { detail: true }).then(_meta => {
meta = _meta;
});
os.api('stats').then(_stats => {
stats = _stats;
});
os.api('get-online-users-count').then(res => {
onlineUsersCount = res.count;
});
os.api('hashtags/list', {
sort: '+mentionedLocalUsers',
limit: 8,
}).then(_tags => {
tags = _tags;
});
os.api('federation/instances', {
os.apiGet('federation/instances', {
sort: '+pubSub',
limit: 20,
}).then(_instances => {
@ -147,8 +130,9 @@ function showMenu(ev) {
bottom: 0;
right: 64px;
margin: auto;
padding: 128px 0;
width: 500px;
height: calc(100% - 128px);
height: calc(100% - 256px);
overflow: hidden;
-webkit-mask-image: linear-gradient(0deg, rgba(0,0,0,0) 0%, rgba(0,0,0,1) 128px, rgba(0,0,0,1) calc(100% - 128px), rgba(0,0,0,0) 100%);
mask-image: linear-gradient(0deg, rgba(0,0,0,0) 0%, rgba(0,0,0,1) 128px, rgba(0,0,0,1) calc(100% - 128px), rgba(0,0,0,0) 100%);