Compare commits

...

2 Commits

Author SHA1 Message Date
Derek 450c8f114b Changeable mascot
Doing this later ;)
2022-10-17 00:52:44 -04:00
Derek 3cb8080676 ChatUI modernization part 2 2022-10-17 00:52:22 -04:00
22 changed files with 80 additions and 83 deletions

View File

@ -7,15 +7,15 @@ doctype html
//
-
_____ _ _
| |_|___ ___| |_ ___ _ _
_____ _ _
| |_|___ ___| |_ ___ _ _
| | | | |_ -|_ -| '_| -_| | |
|_|_|_|_|___|___|_,_|___|_ |
|___|
Thank you for using Misskey!
If you are reading this message... how about joining the development?
https://github.com/misskey-dev/misskey
html
@ -31,9 +31,6 @@ html
link(rel='icon' href= icon || '/favicon.ico')
link(rel='apple-touch-icon' href= icon || '/apple-touch-icon.png')
link(rel='manifest' href='/manifest.json')
link(rel='prefetch' href='https://xn--931a.moe/assets/info.jpg')
link(rel='prefetch' href='https://xn--931a.moe/assets/not-found.jpg')
link(rel='prefetch' href='https://xn--931a.moe/assets/error.jpg')
link(rel='stylesheet' href='/assets/fontawesome/css/all.css')
link(rel='modulepreload' href=`/assets/${clientEntry.file}`)
@ -53,8 +50,8 @@ html
block meta
block og
meta(property='og:title' content= title || 'Misskey')
meta(property='og:description' content= desc || '✨🌎✨ A interplanetary communication platform ✨🚀✨')
meta(property='og:title' content= title || 'Misskey')
meta(property='og:description' content= desc || '✨🌎✨ A interplanetary communication platform ✨🚀✨')
meta(property='og:image' content= img)
style

Binary file not shown.

After

Width:  |  Height:  |  Size: 40 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 40 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 40 KiB

View File

@ -2,7 +2,7 @@
<MkPagination ref="pagingComponent" :pagination="pagination">
<template #empty>
<div class="_fullinfo">
<img src="https://xn--931a.moe/assets/info.jpg" class="_ghost"/>
<img src="/client-assets/mascot/info.jpg" class="_ghost"/>
<div>{{ i18n.ts.noNotes }}</div>
</div>
</template>

View File

@ -2,7 +2,7 @@
<MkPagination ref="pagingComponent" :pagination="pagination">
<template #empty>
<div class="_fullinfo">
<img src="https://xn--931a.moe/assets/info.jpg" class="_ghost"/>
<img src="/client-assets/mascot/info.jpg" class="_ghost"/>
<div>{{ i18n.ts.noNotifications }}</div>
</div>
</template>

View File

@ -7,7 +7,7 @@
<div v-else-if="empty" key="_empty_" class="empty">
<slot name="empty">
<div class="_fullinfo">
<img src="https://xn--931a.moe/assets/info.jpg" class="_ghost"/>
<img src="/client-assets/mascot/info.jpg" class="_ghost"/>
<div>{{ i18n.ts.nothing }}</div>
</div>
</slot>

View File

@ -2,7 +2,7 @@
<MkPagination ref="pagingComponent" :pagination="pagination">
<template #empty>
<div class="_fullinfo">
<img src="https://xn--931a.moe/assets/info.jpg" class="_ghost"/>
<img src="/client-assets/mascot/info.jpg" class="_ghost"/>
<div>{{ i18n.ts.noUsers }}</div>
</div>
</template>

View File

@ -1,7 +1,7 @@
<template>
<transition :name="$store.state.animation ? 'zoom' : ''" appear>
<div class="mjndxjcg">
<img src="https://xn--931a.moe/assets/error.jpg" class="_ghost"/>
<img src="/client-assets/mascot/error.jpg" class="_ghost"/>
<p><i class="fas fa-exclamation-triangle"></i> {{ i18n.ts.somethingHappened }}</p>
<MkButton class="button" @click="() => $emit('retry')">{{ i18n.ts.retry }}</MkButton>
</div>

View File

@ -1,5 +1,5 @@
<template>
<KeepAlive :max="defaultStore.state.numberOfPageCache">
<KeepAlive :max="defaultStore.state.numberOfPageCache" v-bind="props.keepalive">
<Suspense>
<component :is="currentPageComponent" :key="key" v-bind="Object.fromEntries(currentPageProps)"/>
@ -17,6 +17,7 @@ import { defaultStore } from '@/store';
const props = defineProps<{
router?: Router;
keepalive?: any;
}>();
const router = props.router ?? inject('router');

View File

@ -2,7 +2,7 @@
<MkLoading v-if="!loaded"/>
<transition :name="$store.state.animation ? 'zoom' : ''" appear>
<div v-show="loaded" class="mjndxjch">
<img src="https://xn--931a.moe/assets/error.jpg" class="_ghost"/>
<img src="/client-assets/mascot/error.jpg" class="_ghost"/>
<p><b><i class="fas fa-exclamation-triangle"></i> {{ i18n.ts.pageLoadError }}</b></p>
<p v-if="meta && (version === meta.version)">{{ i18n.ts.pageLoadErrorDescription }}</p>
<p v-else-if="serverIsDead">{{ i18n.ts.serverIsDead }}</p>

View File

@ -105,12 +105,12 @@ definePageMetadata(computed(() => channel ? {
color: #fff;
background: rgba(0, 0, 0, 0.5);
border-radius: 100%;
> i {
vertical-align: middle;
}
}
> .banner {
position: relative;
height: 200px;

View File

@ -5,7 +5,7 @@
<MkPagination ref="pagingComponent" :pagination="pagination">
<template #empty>
<div class="_fullinfo">
<img src="https://xn--931a.moe/assets/info.jpg" class="_ghost"/>
<img src="/client-assets/mascot/info.jpg" class="_ghost"/>
<div>{{ i18n.ts.noNotes }}</div>
</div>
</template>

View File

@ -5,7 +5,7 @@
<MkPagination ref="paginationComponent" :pagination="pagination">
<template #empty>
<div class="_fullinfo">
<img src="https://xn--931a.moe/assets/info.jpg" class="_ghost"/>
<img src="/client-assets/mascot/info.jpg" class="_ghost"/>
<div>{{ i18n.ts.noFollowRequests }}</div>
</div>
</template>

View File

@ -33,7 +33,7 @@
</MkA>
</div>
<div v-if="!fetching && messages.length == 0" class="_fullinfo">
<img src="https://xn--931a.moe/assets/info.jpg" class="_ghost"/>
<img src="/client-assets/mascot/info.jpg" class="_ghost"/>
<div>{{ $ts.noHistory }}</div>
</div>
<MkLoading v-if="fetching"/>

View File

@ -10,7 +10,7 @@
<MkPagination v-if="pagination" ref="pagingComponent" :key="userAcct || groupId" :pagination="pagination">
<template #empty>
<div class="_fullinfo">
<img src="https://xn--931a.moe/assets/info.jpg" class="_ghost"/>
<img src="/client-assets/mascot/info.jpg" class="_ghost"/>
<div>{{ i18n.ts.noMessagesYet }}</div>
</div>
</template>

View File

@ -1,7 +1,7 @@
<template>
<div class="ipledcug">
<div class="_fullinfo">
<img src="https://xn--931a.moe/assets/not-found.jpg" class="_ghost"/>
<img src="/client-assets/mascot/not-found.jpg" class="_ghost"/>
<div>{{ i18n.ts.notFoundDescription }}</div>
</div>
</div>

View File

@ -3,7 +3,7 @@
<FormPagination ref="list" :pagination="pagination">
<template #empty>
<div class="_fullinfo">
<img src="https://xn--931a.moe/assets/info.jpg" class="_ghost"/>
<img src="/client-assets/mascot/info.jpg" class="_ghost"/>
<div>{{ i18n.ts.nothing }}</div>
</div>
</template>

View File

@ -3,14 +3,13 @@
<div class="nav">
<header class="header">
<div class="left">
<button class="_button account" @click="openAccountMenu">
<button class="_button account" @click="handleAccountSwitcher">
<MkAvatar :user="$i" class="avatar"/><!--<MkAcct class="text" :user="$i"/>-->
</button>
</div>
<div class="right">
<MkA v-tooltip="$ts.favorites" class="item" to="/my/favorites"><i class="fas fa-star icon"></i><span v-if="$i.hasUnreadMessagingMessage" class="indicator"><i class="fas fa-circle"></i></span></MkA>
<MkA v-tooltip="$ts.messaging" class="item" to="/my/messaging"><i class="fas fa-comments icon"></i><span v-if="$i.hasUnreadMessagingMessage" class="indicator"><i class="fas fa-circle"></i></span></MkA>
<MkA v-tooltip="$ts.directNotes" class="item" to="/my/messages"><i class="fas fa-envelope icon"></i><span v-if="$i.hasUnreadSpecifiedNotes" class="indicator"><i class="fas fa-circle"></i></span></MkA>
<MkA v-tooltip="$ts.mentions" class="item" to="/my/mentions"><i class="fas fa-at icon"></i><span v-if="$i.hasUnreadMentions" class="indicator"><i class="fas fa-circle"></i></span></MkA>
<MkA v-tooltip="$ts.notifications" class="item" to="/my/notifications"><i class="fas fa-bell icon"></i><span v-if="$i.hasUnreadNotification" class="indicator"><i class="fas fa-circle"></i></span></MkA>
</div>
</header>
@ -48,11 +47,6 @@
<MkA v-for="antenna in antennas" :key="antenna.id" :to="`/timeline/antenna/${ antenna.id }`" class="item" :class="{ active: tl === `antenna:${ antenna.id }` }"><i class="fas fa-satellite icon"></i>{{ antenna.name }}</MkA>
</div>
</div>
<div class="container">
<div class="body">
<MkA to="/my/favorites" class="item"><i class="fas fa-star icon"></i>{{ $ts.favorites }}</MkA>
</div>
</div>
<MkAd class="a" :prefer="['square']"/>
</div>
<footer class="footer">
@ -71,13 +65,7 @@
</div>
<main class="main" @contextmenu.stop="onContextmenu">
<RouterView v-slot="{ Component }">
<transition :name="$store.state.animation ? 'page' : ''" mode="out-in" @enter="onTransition">
<KeepAlive :include="['timeline']">
<component :is="Component" class="body"/>
</KeepAlive>
</transition>
</RouterView>
<RouterView :keepalive="{ exclude: ['timeline'] }"/>
</main>
<XSide ref="side" class="side" @open="sideViewOpening = true" @close="sideViewOpening = false"/>
@ -117,7 +105,7 @@ import makeList from '@/scripts/new-list.ts';
import copyToClipboard from '@/scripts/copy-to-clipboard';
import { PageMetadata, provideMetadataReceiver, setPageMetadata } from '@/scripts/page-metadata';
import { store } from './chat/store';
import { openAccountMenu } from '@/account';
import { openAccountMenu, $i } from '@/account';
const side = ref();
@ -268,6 +256,12 @@ function onContextmenu(e) {
}], e);
};
function handleAccountSwitcher(ev: event) {
return openAccountMenu({
withExtraOperation: true,
}, ev);
}
onMounted(() => {
if (window.innerWidth < 1024) {
@ -304,7 +298,7 @@ onMounted(() => {
}
.mk-app {
$header-height: 54px; // TODO:
$header-height: 55px; // TODO:
$ui-font-size: 1em; // TODO:
// 100vh ... https://css-tricks.com/the-trick-to-viewport-units-on-mobile/

View File

@ -1,7 +1,7 @@
<template>
<div class="">
<div v-if="empty" class="_fullinfo">
<img src="https://xn--931a.moe/assets/info.jpg" class="_ghost"/>
<img src="/client-assets/mascot/info.jpg" class="_ghost"/>
<div>{{ $ts.noNotes }}</div>
</div>

View File

@ -1,20 +1,21 @@
<template>
<div class="dbiokgaf">
<div v-if="date" class="info">
<MkInfo>{{ i18n.ts.showingPastTimeline }} <button class="_textButton clear" @click="timetravel()">{{ i18n.ts.clear }}</button></MkInfo>
<MkPageHeader @click="goTop()"/>
<div class="dbiokgaf">
<div v-if="date" class="info">
<MkInfo>{{ i18n.ts.showingPastTimeline }} <button class="_textButton clear" @click="timetravel()">{{ i18n.ts.clear }}</button></MkInfo>
</div>
<div class="top">
<XPostForm/>
</div>
<div ref="body" class="tl">
<div v-if="queue > 0" class="new" :style="{ width: width + 'px', top: top + 'px' }"><button class="_buttonPrimary" @click="goTop()">{{ i18n.ts.newNoteRecived }}</button></div>
<XNotes ref="tl" class="tl" :pagination="pagination" @queue="queueUpdated"/>
</div>
</div>
<div class="top">
<XPostForm/>
</div>
<div ref="body" class="tl">
<div v-if="queue > 0" class="new" :style="{ width: width + 'px', top: top + 'px' }"><button class="_buttonPrimary" @click="goTop()">{{ i18n.ts.newNoteRecived }}</button></div>
<XNotes ref="tl" class="tl" :pagination="pagination" @queue="queueUpdated"/>
</div>
</div>
</template>
<script lang="ts" setup>
import { computed, markRaw, onBeforeUnmount, ref, reactive, withDefaults } from 'vue';
import { computed, markRaw, onBeforeUnmount, ref, reactive, withDefaults, watchEffect } from 'vue';
import XNotes from '../notes.vue';
import * as os from '@/os';
import { stream } from '@/stream';
@ -41,8 +42,6 @@ const baseQuery = {
includeLocalRenotes: defaultStore.state.showLocalRenotes
};
const connection = ref(null);
const connection2 = ref(null);
const query = reactive({});
const queue = ref(0);
const width = ref(0);
@ -78,32 +77,43 @@ const onChangeFollowing = () => {
}
};
let endpoint;
const connection = ref(null);
const connection2 = ref(null);
const endpoint = ref(null);
if (props.src == 'home') {
endpoint = 'notes/timeline';
connection.value = markRaw(stream.useChannel('homeTimeline'));
connection.value.on('note', prepend);
watchEffect((onCleanup) => {
console.log(props.src, defaultStore.state.numberOfPageCache);
if (props.src == 'home') {
endpoint.value = 'notes/timeline';
connection.value = markRaw(stream.useChannel('homeTimeline'));
connection.value.on('note', prepend);
connection2.value = markRaw(stream.useChannel('main'));
connection2.value.on('follow', onChangeFollowing);
connection2.value.on('unfollow', onChangeFollowing);
} else if (props.src == 'local') {
endpoint = 'notes/local-timeline';
connection.value = markRaw(stream.useChannel('localTimeline'));
connection.value.on('note', prepend);
} else if (props.src == 'social') {
endpoint = 'notes/hybrid-timeline';
connection.value = markRaw(stream.useChannel('hybridTimeline'));
connection.value.on('note', prepend);
} else if (props.src == 'global') {
endpoint = 'notes/global-timeline';
connection.value = markRaw(stream.useChannel('globalTimeline'));
connection.value.on('note', prepend);
}
connection2.value = markRaw(stream.useChannel('main'));
connection2.value.on('follow', onChangeFollowing);
connection2.value.on('unfollow', onChangeFollowing);
} else if (props.src == 'local') {
endpoint.value = 'notes/local-timeline';
connection.value = markRaw(stream.useChannel('localTimeline'));
connection.value.on('note', prepend);
} else if (props.src == 'social') {
endpoint.value = 'notes/hybrid-timeline';
connection.value = markRaw(stream.useChannel('hybridTimeline'));
connection.value.on('note', prepend);
} else if (props.src == 'global') {
endpoint.value = 'notes/global-timeline';
connection.value = markRaw(stream.useChannel('globalTimeline'));
connection.value.on('note', prepend);
}
onCleanup(() => {
console.log('cleaning');
connection.value.dispose();
if (connection2.value) connection2.value.dispose();
});
});
const pagination = computed(() => ({
endpoint: endpoint,
endpoint: endpoint.value,
limit: 10,
params: init => ({
untilDate: date.value?.getTime(),
@ -112,11 +122,6 @@ const pagination = computed(() => ({
}));
onBeforeUnmount(() => {
connection.value.dispose();
if (connection2.value) connection2.value.dispose();
});
function focus() {
body.value.focus();
};

View File

@ -104,7 +104,7 @@ export default defineComponent({
<style lang="scss" scoped>
.mrajymqm {
$header-height: 54px; // TODO:
$header-height: 55px; // TODO:
--root-margin: 16px;
--margin: var(--marginHalf);