Default UI redesign (#7429)

* wip

* wip

* wip

* wip

* Update default.sidebar.vue

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* Update sticky-sidebar.ts

* wip

* wip

* Update messaging-room.form.vue

* Update timeline.vue
This commit is contained in:
syuilo 2021-04-10 12:40:50 +09:00 committed by GitHub
parent 7d2126e2b2
commit d3fe02fb3e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
81 changed files with 1532 additions and 658 deletions

View file

@ -710,6 +710,7 @@ typingUsers: "{users}が入力中"
jumpToSpecifiedDate: "特定の日付にジャンプ" jumpToSpecifiedDate: "特定の日付にジャンプ"
showingPastTimeline: "過去のタイムラインを表示しています" showingPastTimeline: "過去のタイムラインを表示しています"
clear: "クリア" clear: "クリア"
markAllAsRead: "全て既読にする"
_email: _email:
_follow: _follow:

View file

@ -80,6 +80,6 @@ export default defineComponent({
<style lang="scss" scoped> <style lang="scss" scoped>
.dpvffvvy { .dpvffvvy {
--section-padding: 16px; --root-margin: 16px;
} }
</style> </style>

View file

@ -123,7 +123,7 @@ export default defineComponent({
> footer { > footer {
padding: 12px 16px; padding: 12px 16px;
border-top: solid 1px var(--divider); border-top: solid 0.5px var(--divider);
> span { > span {
opacity: 0.7; opacity: 0.7;

View file

@ -37,14 +37,16 @@ export default defineComponent({
}); });
} }
const noGap = [...document.querySelectorAll('._noGap_')].some(el => el.contains(this.$parent.$el));
return h(this.$store.state.animation ? TransitionGroup : 'div', this.$store.state.animation ? { return h(this.$store.state.animation ? TransitionGroup : 'div', this.$store.state.animation ? {
class: 'sqadhkmv _list_', class: 'sqadhkmv' + (noGap ? ' _block' : ''),
name: 'list', name: 'list',
tag: 'div', tag: 'div',
'data-direction': this.direction, 'data-direction': this.direction,
'data-reversed': this.reversed ? 'true' : 'false', 'data-reversed': this.reversed ? 'true' : 'false',
} : { } : {
class: 'sqadhkmv _list_', class: 'sqadhkmv',
}, this.items.map((item, i) => { }, this.items.map((item, i) => {
const el = this.$slots.default({ const el = this.$slots.default({
item: item item: item
@ -117,11 +119,7 @@ export default defineComponent({
transform: translateY(-64px); transform: translateY(-64px);
} }
} }
}
</style>
<style lang="scss">
.sqadhkmv {
> .separator { > .separator {
text-align: center; text-align: center;
@ -155,4 +153,25 @@ export default defineComponent({
} }
} }
} }
._noGap_ .sqadhkmv {
> * {
margin: 0 !important;
border: none;
border-radius: 0;
box-shadow: none;
&:not(:last-child) {
border-bottom: solid 0.5px var(--divider);
}
}
}
._inContainer_ .sqadhkmv > * {
margin: 0 !important;
border: none;
border-bottom: solid 0.5px var(--divider);
border-radius: 0;
box-shadow: none;
}
</style> </style>

View file

@ -330,8 +330,8 @@ export default defineComponent({
} }
> .thumbnail { > .thumbnail {
width: 128px; width: 110px;
height: 128px; height: 110px;
margin: auto; margin: auto;
} }

View file

@ -704,6 +704,7 @@ export default defineComponent({
> .main { > .main {
flex: 1; flex: 1;
overflow: auto; overflow: auto;
padding: var(--margin);
&, * { &, * {
user-select: none; user-select: none;
@ -735,7 +736,7 @@ export default defineComponent({
> .folder, > .folder,
> .file { > .file {
flex-grow: 1; flex-grow: 1;
width: 144px; width: 128px;
margin: 4px; margin: 4px;
box-sizing: border-box; box-sizing: border-box;
} }
@ -743,7 +744,7 @@ export default defineComponent({
> .padding { > .padding {
flex-grow: 1; flex-grow: 1;
pointer-events: none; pointer-events: none;
width: 144px + 8px; width: 128px + 8px;
} }
} }

View file

@ -123,7 +123,7 @@ export default defineComponent({
> .index { > .index {
min-height: var(--height); min-height: var(--height);
position: relative; position: relative;
border-bottom: solid 1px var(--divider); border-bottom: solid 0.5px var(--divider);
> .arrow { > .arrow {
position: absolute; position: absolute;
@ -181,7 +181,7 @@ export default defineComponent({
} }
&.result { &.result {
border-bottom: solid 1px var(--divider); border-bottom: solid 0.5px var(--divider);
&:empty { &:empty {
display: none; display: none;

View file

@ -119,7 +119,7 @@ export default defineComponent({
> .index { > .index {
min-height: var(--height); min-height: var(--height);
position: relative; position: relative;
border-bottom: solid 1px var(--divider); border-bottom: solid 0.5px var(--divider);
> .arrow { > .arrow {
position: absolute; position: absolute;
@ -177,7 +177,7 @@ export default defineComponent({
} }
&.result { &.result {
border-bottom: solid 1px var(--divider); border-bottom: solid 0.5px var(--divider);
&:empty { &:empty {
display: none; display: none;

View file

@ -402,7 +402,7 @@ export default defineComponent({
> .tab { > .tab {
flex: 1; flex: 1;
height: 38px; height: 38px;
border-top: solid 1px var(--divider); border-top: solid 0.5px var(--divider);
&.active { &.active {
border-top: solid 1px var(--accent); border-top: solid 1px var(--accent);
@ -425,7 +425,7 @@ export default defineComponent({
> div { > div {
&:not(.index) { &:not(.index) {
padding: 4px 0 8px 0; padding: 4px 0 8px 0;
border-top: solid 1px var(--divider); border-top: solid 0.5px var(--divider);
} }
> header { > header {
@ -492,7 +492,7 @@ export default defineComponent({
} }
&.result { &.result {
border-bottom: solid 1px var(--divider); border-bottom: solid 0.5px var(--divider);
&:empty { &:empty {
display: none; display: none;

View file

@ -146,7 +146,7 @@ export default defineComponent({
> .sub { > .sub {
margin-top: 8px; margin-top: 8px;
padding-top: 8px; padding-top: 8px;
border-top: solid 1px var(--divider); border-top: solid 0.5px var(--divider);
} }
} }
</style> </style>

View file

@ -123,7 +123,7 @@ export default defineComponent({
.gqnyydlz { .gqnyydlz {
position: relative; position: relative;
border: solid 1px var(--divider); border: solid 0.5px var(--divider);
> i { > i {
display: block; display: block;

View file

@ -1,6 +1,6 @@
<template> <template>
<div <div
class="note _panel" class="note _block"
v-if="!muted" v-if="!muted"
v-show="!isDeleted" v-show="!isDeleted"
:tabindex="!isDeleted ? '-1' : null" :tabindex="!isDeleted ? '-1' : null"
@ -1007,7 +1007,7 @@ export default defineComponent({
margin: 0 0.5em; margin: 0 0.5em;
padding: 4px 6px; padding: 4px 6px;
font-size: 80%; font-size: 80%;
border: solid 1px var(--divider); border: solid 0.5px var(--divider);
border-radius: 4px; border-radius: 4px;
} }
@ -1110,7 +1110,7 @@ export default defineComponent({
} }
> .reply { > .reply {
border-top: solid 1px var(--divider); border-top: solid 0.5px var(--divider);
} }
&.max-width_500px { &.max-width_500px {

View file

@ -78,7 +78,7 @@ export default defineComponent({
margin: 0 .5em 0 0; margin: 0 .5em 0 0;
padding: 1px 6px; padding: 1px 6px;
font-size: 80%; font-size: 80%;
border: solid 1px var(--divider); border: solid 0.5px var(--divider);
border-radius: 3px; border-radius: 3px;
} }

View file

@ -139,7 +139,7 @@ export default defineComponent({
} }
> .reply { > .reply {
border-left: solid 1px var(--divider); border-left: solid 0.5px var(--divider);
margin-top: 10px; margin-top: 10px;
} }
} }

View file

@ -1,6 +1,6 @@
<template> <template>
<div <div
class="tkcbzcuz _panel" class="tkcbzcuz"
v-if="!muted" v-if="!muted"
v-show="!isDeleted" v-show="!isDeleted"
:tabindex="!isDeleted ? '-1' : null" :tabindex="!isDeleted ? '-1' : null"
@ -90,7 +90,7 @@
</div> </div>
</article> </article>
</div> </div>
<div v-else class="_panel muted" @click="muted = false"> <div v-else class="muted" @click="muted = false">
<I18n :src="$ts.userSaysSomething" tag="small"> <I18n :src="$ts.userSaysSomething" tag="small">
<template #name> <template #name>
<MkA class="name" :to="userPage(appearNote.user)" v-user-preview="appearNote.userId"> <MkA class="name" :to="userPage(appearNote.user)" v-user-preview="appearNote.userId">
@ -851,6 +851,7 @@ export default defineComponent({
position: relative; position: relative;
transition: box-shadow 0.1s ease; transition: box-shadow 0.1s ease;
overflow: hidden; overflow: hidden;
overflow: clip;
contain: content; contain: content;
// //
@ -981,11 +982,17 @@ export default defineComponent({
> .avatar { > .avatar {
flex-shrink: 0; flex-shrink: 0;
display: block; display: block;
//position: sticky;
//top: 72px;
margin: 0 14px 8px 0; margin: 0 14px 8px 0;
width: 58px; width: 58px;
height: 58px; height: 58px;
position: sticky;
top: calc(22px + var(--stickyTop, 0px));
left: 0;
/* iOSはoverflow: clipをサポートしていない影響でposition: stickyが動作しない */
@supports (-webkit-touch-callout: none) {
top: 0;
}
} }
> .main { > .main {
@ -1106,7 +1113,7 @@ export default defineComponent({
} }
> .reply { > .reply {
border-top: solid 1px var(--divider); border-top: solid 0.5px var(--divider);
} }
&.max-width_500px { &.max-width_500px {
@ -1129,6 +1136,12 @@ export default defineComponent({
margin: 0 10px 8px 0; margin: 0 10px 8px 0;
width: 50px; width: 50px;
height: 50px; height: 50px;
top: calc(14px + var(--stickyTop, 0px));
/* iOSはoverflow: clipをサポートしていない影響でposition: stickyが動作しない */
@supports (-webkit-touch-callout: none) {
top: 0;
}
} }
} }
} }

View file

@ -1,5 +1,5 @@
<template> <template>
<div class="_list_"> <div>
<div class="_fullinfo" v-if="empty"> <div class="_fullinfo" v-if="empty">
<img src="https://xn--931a.moe/assets/info.jpg" class="_ghost"/> <img src="https://xn--931a.moe/assets/info.jpg" class="_ghost"/>
<div>{{ $ts.noNotes }}</div> <div>{{ $ts.noNotes }}</div>
@ -15,7 +15,7 @@
</div> </div>
<XList ref="notes" :items="notes" v-slot="{ item: note }" :direction="reversed ? 'up' : 'down'" :reversed="reversed"> <XList ref="notes" :items="notes" v-slot="{ item: note }" :direction="reversed ? 'up' : 'down'" :reversed="reversed">
<XNote :note="note" @update:note="updated(note, $event)" :key="note._featuredId_ || note._prId_ || note.id"/> <XNote :note="note" class="_block _isolated" @update:note="updated(note, $event)" :key="note._featuredId_ || note._prId_ || note.id"/>
</XList> </XList>
<div v-show="more && !reversed" style="margin-top: var(--margin);"> <div v-show="more && !reversed" style="margin-top: var(--margin);">

View file

@ -14,7 +14,7 @@
<button class="_button" @click="back()" v-if="history.length > 0"><Fa :icon="faChevronLeft"/></button> <button class="_button" @click="back()" v-if="history.length > 0"><Fa :icon="faChevronLeft"/></button>
<button class="_button" style="pointer-events: none;" v-else><!-- マージンのバランスを取るためのダミー --></button> <button class="_button" style="pointer-events: none;" v-else><!-- マージンのバランスを取るためのダミー --></button>
</template> </template>
<div class="yrolvcoq" style="min-height: 100%; background: var(--bg);"> <div class="yrolvcoq _flat_">
<component :is="component" v-bind="props" :ref="changePage"/> <component :is="component" v-bind="props" :ref="changePage"/>
</div> </div>
</XWindow> </XWindow>
@ -155,6 +155,7 @@ export default defineComponent({
<style lang="scss" scoped> <style lang="scss" scoped>
.yrolvcoq { .yrolvcoq {
--section-padding: 16px; min-height: 100%;
background: var(--bg);
} }
</style> </style>

View file

@ -110,7 +110,7 @@ export default defineComponent({
position: relative; position: relative;
margin: 4px 0; margin: 4px 0;
padding: 4px 8px; padding: 4px 8px;
border: solid 1px var(--divider); border: solid 0.5px var(--divider);
border-radius: 4px; border-radius: 4px;
overflow: hidden; overflow: hidden;
cursor: pointer; cursor: pointer;

View file

@ -767,7 +767,7 @@ export default defineComponent({
> .cw { > .cw {
z-index: 1; z-index: 1;
padding-bottom: 8px; padding-bottom: 8px;
border-bottom: solid 1px var(--divider); border-bottom: solid 0.5px var(--divider);
} }
> .text { > .text {

View file

@ -1,6 +1,6 @@
<template> <template>
<form class="eppvobhk" :class="{ signing, totpLogin }" @submit.prevent="onSubmit"> <form class="eppvobhk _root" :class="{ signing, totpLogin }" @submit.prevent="onSubmit">
<div class="auth _section"> <div class="auth">
<div class="avatar" :style="{ backgroundImage: user ? `url('${ user.avatarUrl }')` : null }" v-show="withAvatar"></div> <div class="avatar" :style="{ backgroundImage: user ? `url('${ user.avatarUrl }')` : null }" v-show="withAvatar"></div>
<div class="normal-signin" v-if="!totpLogin"> <div class="normal-signin" v-if="!totpLogin">
<MkInput v-model:value="username" type="text" pattern="^[a-zA-Z0-9_]+$" spellcheck="false" autofocus required @update:value="onUsernameChange"> <MkInput v-model:value="username" type="text" pattern="^[a-zA-Z0-9_]+$" spellcheck="false" autofocus required @update:value="onUsernameChange">
@ -38,7 +38,8 @@
</div> </div>
</div> </div>
</div> </div>
<div class="social _section"> <div class="_hr"></div>
<div class="social">
<a class="_borderButton _vMargin" v-if="meta && meta.enableTwitterIntegration" :href="`${apiUrl}/signin/twitter`"><Fa :icon="faTwitter" style="margin-right: 4px;"/>{{ $t('signinWith', { x: 'Twitter' }) }}</a> <a class="_borderButton _vMargin" v-if="meta && meta.enableTwitterIntegration" :href="`${apiUrl}/signin/twitter`"><Fa :icon="faTwitter" style="margin-right: 4px;"/>{{ $t('signinWith', { x: 'Twitter' }) }}</a>
<a class="_borderButton _vMargin" v-if="meta && meta.enableGithubIntegration" :href="`${apiUrl}/signin/github`"><Fa :icon="faGithub" style="margin-right: 4px;"/>{{ $t('signinWith', { x: 'GitHub' }) }}</a> <a class="_borderButton _vMargin" v-if="meta && meta.enableGithubIntegration" :href="`${apiUrl}/signin/github`"><Fa :icon="faGithub" style="margin-right: 4px;"/>{{ $t('signinWith', { x: 'GitHub' }) }}</a>
<a class="_borderButton _vMargin" v-if="meta && meta.enableDiscordIntegration" :href="`${apiUrl}/signin/discord`"><Fa :icon="faDiscord" style="margin-right: 4px;"/>{{ $t('signinWith', { x: 'Discord' }) }}</a> <a class="_borderButton _vMargin" v-if="meta && meta.enableDiscordIntegration" :href="`${apiUrl}/signin/discord`"><Fa :icon="faDiscord" style="margin-right: 4px;"/>{{ $t('signinWith', { x: 'Discord' }) }}</a>

View file

@ -7,7 +7,7 @@
> >
<template #header>{{ $ts.signup }}</template> <template #header>{{ $ts.signup }}</template>
<div class="_section"> <div class="_root">
<XSignup :auto-set="autoSet" @signup="onSignup"/> <XSignup :auto-set="autoSet" @signup="onSignup"/>
</div> </div>
</XModalWindow> </XModalWindow>

View file

@ -9,7 +9,7 @@
<template #header>Req Viewer</template> <template #header>Req Viewer</template>
<div class="rlkneywz"> <div class="rlkneywz">
<MkTab v-model:value="tab" style="border-bottom: solid 1px var(--divider);"> <MkTab v-model:value="tab" style="border-bottom: solid 0.5px var(--divider);">
<option value="req">Request</option> <option value="req">Request</option>
<option value="res">Response</option> <option value="res">Response</option>
</MkTab> </MkTab>

View file

@ -4,7 +4,7 @@
<Fa :icon="faTerminal" style="margin-right: 0.5em;"/>Task Manager <Fa :icon="faTerminal" style="margin-right: 0.5em;"/>Task Manager
</template> </template>
<div class="qljqmnzj _monospace"> <div class="qljqmnzj _monospace">
<MkTab v-model:value="tab" style="border-bottom: solid 1px var(--divider);"> <MkTab v-model:value="tab" style="border-bottom: solid 0.5px var(--divider);">
<option value="windows">Windows</option> <option value="windows">Windows</option>
<option value="stream">Stream</option> <option value="stream">Stream</option>
<option value="streamPool">Stream (Pool)</option> <option value="streamPool">Stream (Pool)</option>
@ -215,7 +215,7 @@ export default defineComponent({
width: 100%; width: 100%;
padding: 8px 16px; padding: 8px 16px;
box-sizing: border-box; box-sizing: border-box;
border-top: solid 1px var(--divider); border-top: solid 0.5px var(--divider);
font-size: 0.9em; font-size: 0.9em;
> div { > div {

View file

@ -1,5 +1,5 @@
<template> <template>
<div class="ukygtjoj _panel" :class="{ naked, hideHeader: !showHeader, scrollable, closed: !showBody }" v-size="{ max: [380] }"> <div class="ukygtjoj _block _isolated" :class="{ naked, hideHeader: !showHeader, scrollable, closed: !showBody }" v-size="{ max: [380] }">
<header v-if="showHeader" ref="header"> <header v-if="showHeader" ref="header">
<div class="title"><slot name="header"></slot></div> <div class="title"><slot name="header"></slot></div>
<div class="sub"> <div class="sub">
@ -136,7 +136,7 @@ export default defineComponent({
position: relative; position: relative;
color: var(--panelHeaderFg); color: var(--panelHeaderFg);
background: var(--panelHeaderBg); background: var(--panelHeaderBg);
box-shadow: 0 1px 0 0 var(--panelHeaderDivider); border-bottom: solid 0.5px var(--panelHeaderDivider);
z-index: 2; z-index: 2;
line-height: 1.4em; line-height: 1.4em;
@ -172,7 +172,7 @@ export default defineComponent({
padding: 24px; padding: 24px;
& + ._content { & + ._content {
border-top: solid 1px var(--divider); border-top: solid 0.5px var(--divider);
} }
} }
} }

View file

@ -137,4 +137,8 @@ export default defineComponent({
} }
} }
} }
._flat_ .ssazuxis {
margin: var(--margin);
}
</style> </style>

View file

@ -94,10 +94,10 @@ export default defineComponent({
flex-direction: column; flex-direction: column;
contain: content; contain: content;
--section-padding: 24px; --root-margin: 24px;
@media (max-width: 500px) { @media (max-width: 500px) {
--section-padding: 16px; --root-margin: 16px;
} }
> .header { > .header {

View file

@ -104,7 +104,7 @@ export default defineComponent({
> .description { > .description {
padding: 16px; padding: 16px;
font-size: 0.8em; font-size: 0.8em;
border-top: solid 1px var(--divider); border-top: solid 0.5px var(--divider);
> .mfm { > .mfm {
display: -webkit-box; display: -webkit-box;
@ -116,7 +116,7 @@ export default defineComponent({
> .status { > .status {
padding: 10px 16px; padding: 10px 16px;
border-top: solid 1px var(--divider); border-top: solid 0.5px var(--divider);
> div { > div {
display: inline-block; display: inline-block;

View file

@ -153,7 +153,7 @@ export default defineComponent({
> .user { > .user {
display: flex; display: flex;
align-items: center; align-items: center;
padding: 8px var(--section-padding); padding: 8px var(--root-margin);
font-size: 14px; font-size: 14px;
&:hover { &:hover {

View file

@ -97,7 +97,7 @@ export default defineComponent({
> .divider { > .divider {
margin: 8px 0; margin: 8px 0;
border-top: solid 1px var(--divider); border-top: solid 0.5px var(--divider);
} }
> button { > button {

View file

@ -161,6 +161,7 @@ const app = createApp(await (
ui === 'deck' ? import('@client/ui/deck.vue') : ui === 'deck' ? import('@client/ui/deck.vue') :
ui === 'desktop' ? import('@client/ui/desktop.vue') : ui === 'desktop' ? import('@client/ui/desktop.vue') :
ui === 'chat' ? import('@client/ui/chat/index.vue') : ui === 'chat' ? import('@client/ui/chat/index.vue') :
ui === 'pope' ? import('@client/ui/universal.vue') :
import('@client/ui/default.vue') import('@client/ui/default.vue')
).then(x => x.default)); ).then(x => x.default));

View file

@ -142,7 +142,7 @@ export default defineComponent({
> .user { > .user {
$height: 32px; $height: 32px;
padding: 16px; padding: 16px;
border-top: solid 1px var(--divider); border-top: solid 0.5px var(--divider);
line-height: $height; line-height: $height;
> .avatar { > .avatar {

View file

@ -150,7 +150,7 @@ export default defineComponent({
font-size: 1.25em; font-size: 1.25em;
padding: 0 0 0.5em 0; padding: 0 0 0.5em 0;
margin: 1.5em 0 1em 0; margin: 1.5em 0 1em 0;
border-bottom: solid 1px var(--divider); border-bottom: solid 0.5px var(--divider);
} }
::v-deep(table) { ::v-deep(table) {
@ -170,7 +170,7 @@ export default defineComponent({
::v-deep(kbd.key) { ::v-deep(kbd.key) {
display: inline-block; display: inline-block;
padding: 6px 8px; padding: 6px 8px;
border: solid 1px var(--divider); border: solid 0.5px var(--divider);
border-radius: 4px; border-radius: 4px;
box-shadow: 0 1px 1px rgba(0, 0, 0, 0.1); box-shadow: 0 1px 1px rgba(0, 0, 0, 0.1);
} }

View file

@ -6,7 +6,7 @@
<script lang="ts"> <script lang="ts">
import { computed, defineComponent } from 'vue'; import { computed, defineComponent } from 'vue';
import { faCloud, faEllipsisH } from '@fortawesome/free-solid-svg-icons'; import { faCloud } from '@fortawesome/free-solid-svg-icons';
import XDrive from '@client/components/drive.vue'; import XDrive from '@client/components/drive.vue';
import * as os from '@client/os'; import * as os from '@client/os';
@ -20,19 +20,10 @@ export default defineComponent({
INFO: { INFO: {
title: computed(() => this.folder ? this.folder.name : this.$ts.drive), title: computed(() => this.folder ? this.folder.name : this.$ts.drive),
icon: faCloud, icon: faCloud,
action: { menu: () => this.$refs.drive.getMenu()
icon: faEllipsisH,
handler: this.menu
}
}, },
folder: null, folder: null,
}; };
}, },
methods: {
menu(ev) {
os.modalMenu(this.$refs.drive.getMenu(), ev.currentTarget || ev.target);
}
}
}); });
</script> </script>

View file

@ -1,5 +1,5 @@
<template> <template>
<div class="lznhrdub"> <div class="lznhrdub _root">
<div class="_section"> <div class="_section">
<MkInput v-model:value="query" :debounce="true" type="search"><template #icon><Fa :icon="faSearch"/></template><span>{{ $ts.searchUser }}</span></MkInput> <MkInput v-model:value="query" :debounce="true" type="search"><template #icon><Fa :icon="faSearch"/></template><span>{{ $ts.searchUser }}</span></MkInput>

View file

@ -500,12 +500,12 @@ export default defineComponent({
} }
&:not(:first-child) { &:not(:first-child) {
border-top: solid 1px var(--divider); border-top: solid 0.5px var(--divider);
} }
} }
> .chart { > .chart {
border-top: solid 1px var(--divider); border-top: solid 0.5px var(--divider);
padding: 16px 0 12px 0; padding: 16px 0 12px 0;
> .header { > .header {

View file

@ -1,40 +1,38 @@
<template> <template>
<div class="_section"> <div class="yweeujhr _root" v-size="{ max: [400] }">
<div class="mk-messaging _content" v-size="{ max: [400] }"> <MkButton @click="start" primary class="start"><Fa :icon="faPlus"/> {{ $ts.startMessaging }}</MkButton>
<MkButton @click="start" primary class="start"><Fa :icon="faPlus"/> {{ $ts.startMessaging }}</MkButton>
<div class="history" v-if="messages.length > 0"> <div class="history" v-if="messages.length > 0">
<MkA v-for="(message, i) in messages" <MkA v-for="(message, i) in messages"
class="message _panel" class="message _block _isolated"
:class="{ isMe: isMe(message), isRead: message.groupId ? message.reads.includes($i.id) : message.isRead }" :class="{ isMe: isMe(message), isRead: message.groupId ? message.reads.includes($i.id) : message.isRead }"
:to="message.groupId ? `/my/messaging/group/${message.groupId}` : `/my/messaging/${getAcct(isMe(message) ? message.recipient : message.user)}`" :to="message.groupId ? `/my/messaging/group/${message.groupId}` : `/my/messaging/${getAcct(isMe(message) ? message.recipient : message.user)}`"
:data-index="i" :data-index="i"
:key="message.id" :key="message.id"
v-anim="i" v-anim="i"
> >
<div> <div>
<MkAvatar class="avatar" :user="message.groupId ? message.user : isMe(message) ? message.recipient : message.user"/> <MkAvatar class="avatar" :user="message.groupId ? message.user : isMe(message) ? message.recipient : message.user"/>
<header v-if="message.groupId"> <header v-if="message.groupId">
<span class="name">{{ message.group.name }}</span> <span class="name">{{ message.group.name }}</span>
<MkTime :time="message.createdAt" class="time"/> <MkTime :time="message.createdAt" class="time"/>
</header> </header>
<header v-else> <header v-else>
<span class="name"><MkUserName :user="isMe(message) ? message.recipient : message.user"/></span> <span class="name"><MkUserName :user="isMe(message) ? message.recipient : message.user"/></span>
<span class="username">@{{ acct(isMe(message) ? message.recipient : message.user) }}</span> <span class="username">@{{ acct(isMe(message) ? message.recipient : message.user) }}</span>
<MkTime :time="message.createdAt" class="time"/> <MkTime :time="message.createdAt" class="time"/>
</header> </header>
<div class="body"> <div class="body">
<p class="text"><span class="me" v-if="isMe(message)">{{ $ts.you }}:</span>{{ message.text }}</p> <p class="text"><span class="me" v-if="isMe(message)">{{ $ts.you }}:</span>{{ message.text }}</p>
</div>
</div> </div>
</MkA> </div>
</div> </MkA>
<div class="_fullinfo" v-if="!fetching && messages.length == 0">
<img src="https://xn--931a.moe/assets/info.jpg" class="_ghost"/>
<div>{{ $ts.noHistory }}</div>
</div>
<MkLoading v-if="fetching"/>
</div> </div>
<div class="_fullinfo" v-if="!fetching && messages.length == 0">
<img src="https://xn--931a.moe/assets/info.jpg" class="_ghost"/>
<div>{{ $ts.noHistory }}</div>
</div>
<MkLoading v-if="fetching"/>
</div> </div>
</template> </template>
@ -167,10 +165,10 @@ export default defineComponent({
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.mk-messaging { .yweeujhr {
> .start { > .start {
margin: 0 auto var(--margin) auto; margin: var(--margin) auto var(--margin) auto;
} }
> .history { > .history {

View file

@ -1,5 +1,5 @@
<template> <template>
<div class="mk-messaging-form _panel" <div class="pemppnzi _block"
@dragover.stop="onDragover" @dragover.stop="onDragover"
@drop.stop="onDrop" @drop.stop="onDrop"
> >
@ -230,7 +230,7 @@ export default defineComponent({
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.mk-messaging-form { .pemppnzi {
position: relative; position: relative;
> textarea { > textarea {

View file

@ -96,7 +96,7 @@ export default defineComponent({
> .description { > .description {
margin-top: 8px; margin-top: 8px;
padding-top: 8px; padding-top: 8px;
border-top: solid 1px var(--divider); border-top: solid 0.5px var(--divider);
} }
} }
} }

View file

@ -1,12 +1,12 @@
<template> <template>
<div class="fcuexfpr"> <div class="fcuexfpr _root">
<div v-if="note" class="note" v-anim> <div v-if="note" class="note" v-anim>
<div class="_section" v-if="showNext"> <div class="_vMargin" v-if="showNext">
<XNotes class="_content _noGap_" :pagination="next"/> <XNotes class="_content _noGap_" :pagination="next"/>
</div> </div>
<div class="_section main"> <div class="main _vMargin">
<MkButton v-if="!showNext && hasNext" class="load next _content" @click="showNext = true"><Fa :icon="faChevronUp"/></MkButton> <MkButton v-if="!showNext && hasNext" class="load next" @click="showNext = true"><Fa :icon="faChevronUp"/></MkButton>
<div class="_content _vMargin"> <div class="_content _vMargin">
<MkRemoteCaution v-if="note.user.host != null" :href="note.url || note.uri" class="_vMargin"/> <MkRemoteCaution v-if="note.user.host != null" :href="note.url || note.uri" class="_vMargin"/>
<XNoteDetailed v-model:note="note" :key="note.id" class="_vMargin"/> <XNoteDetailed v-model:note="note" :key="note.id" class="_vMargin"/>
@ -21,10 +21,10 @@
</div> </div>
</MkA> </MkA>
</div> </div>
<MkButton v-if="!showPrev && hasPrev" class="load prev _content" @click="showPrev = true"><Fa :icon="faChevronDown"/></MkButton> <MkButton v-if="!showPrev && hasPrev" class="load prev" @click="showPrev = true"><Fa :icon="faChevronDown"/></MkButton>
</div> </div>
<div class="_section" v-if="showPrev"> <div class="_vMargin" v-if="showPrev">
<XNotes class="_content _noGap_" :pagination="prev"/> <XNotes class="_content _noGap_" :pagination="prev"/>
</div> </div>
</div> </div>
@ -137,6 +137,7 @@ export default defineComponent({
> .main { > .main {
> .load { > .load {
min-width: 0; min-width: 0;
margin: 0 auto;
border-radius: 999px; border-radius: 999px;
&.next { &.next {
@ -165,7 +166,7 @@ export default defineComponent({
> .user { > .user {
$height: 32px; $height: 32px;
padding-top: 16px; padding-top: 16px;
border-top: solid 1px var(--divider); border-top: solid 0.5px var(--divider);
line-height: $height; line-height: $height;
> .avatar { > .avatar {

View file

@ -1,8 +1,6 @@
<template> <template>
<div> <div class="_root">
<div class="_section"> <XNotifications class="_content" @before="before" @after="after" page/>
<XNotifications class="_content" @before="before" @after="after" page/>
</div>
</div> </div>
</template> </template>

View file

@ -1,87 +1,85 @@
<template> <template>
<div class="_section"> <div class="_root">
<div class="_content"> <MkA class="view" v-if="pageId" :to="`/@${ author.username }/pages/${ currentName }`"><Fa :icon="faExternalLinkSquareAlt"/> {{ $ts._pages.viewPage }}</MkA>
<MkA class="view" v-if="pageId" :to="`/@${ author.username }/pages/${ currentName }`"><Fa :icon="faExternalLinkSquareAlt"/> {{ $ts._pages.viewPage }}</MkA>
<div class="buttons" style="margin: 16px 0;"> <div class="buttons" style="margin: 16px;">
<MkButton inline @click="save" primary class="save" v-if="!readonly"><Fa :icon="faSave"/> {{ $ts.save }}</MkButton> <MkButton inline @click="save" primary class="save" v-if="!readonly"><Fa :icon="faSave"/> {{ $ts.save }}</MkButton>
<MkButton inline @click="duplicate" class="duplicate" v-if="pageId"><Fa :icon="faCopy"/> {{ $ts.duplicate }}</MkButton> <MkButton inline @click="duplicate" class="duplicate" v-if="pageId"><Fa :icon="faCopy"/> {{ $ts.duplicate }}</MkButton>
<MkButton inline @click="del" class="delete" v-if="pageId && !readonly"><Fa :icon="faTrashAlt"/> {{ $ts.delete }}</MkButton> <MkButton inline @click="del" class="delete" v-if="pageId && !readonly"><Fa :icon="faTrashAlt"/> {{ $ts.delete }}</MkButton>
</div> </div>
<MkContainer :body-togglable="true" :expanded="true" class="_vMargin"> <MkContainer :body-togglable="true" :expanded="true" class="_vMargin">
<template #header><Fa :icon="faCog"/> {{ $ts._pages.pageSetting }}</template> <template #header><Fa :icon="faCog"/> {{ $ts._pages.pageSetting }}</template>
<div class="_section"> <div style="padding: 16px;">
<MkInput v-model:value="title"> <MkInput v-model:value="title">
<span>{{ $ts._pages.title }}</span> <span>{{ $ts._pages.title }}</span>
</MkInput> </MkInput>
<MkInput v-model:value="summary"> <MkInput v-model:value="summary">
<span>{{ $ts._pages.summary }}</span> <span>{{ $ts._pages.summary }}</span>
</MkInput> </MkInput>
<MkInput v-model:value="name"> <MkInput v-model:value="name">
<template #prefix>{{ url }}/@{{ author.username }}/pages/</template> <template #prefix>{{ url }}/@{{ author.username }}/pages/</template>
<span>{{ $ts._pages.url }}</span> <span>{{ $ts._pages.url }}</span>
</MkInput> </MkInput>
<MkSwitch v-model:value="alignCenter">{{ $ts._pages.alignCenter }}</MkSwitch> <MkSwitch v-model:value="alignCenter">{{ $ts._pages.alignCenter }}</MkSwitch>
<MkSelect v-model:value="font"> <MkSelect v-model:value="font">
<template #label>{{ $ts._pages.font }}</template> <template #label>{{ $ts._pages.font }}</template>
<option value="serif">{{ $ts._pages.fontSerif }}</option> <option value="serif">{{ $ts._pages.fontSerif }}</option>
<option value="sans-serif">{{ $ts._pages.fontSansSerif }}</option> <option value="sans-serif">{{ $ts._pages.fontSansSerif }}</option>
</MkSelect> </MkSelect>
<MkSwitch v-model:value="hideTitleWhenPinned">{{ $ts._pages.hideTitleWhenPinned }}</MkSwitch> <MkSwitch v-model:value="hideTitleWhenPinned">{{ $ts._pages.hideTitleWhenPinned }}</MkSwitch>
<div class="eyeCatch"> <div class="eyeCatch">
<MkButton v-if="eyeCatchingImageId == null && !readonly" @click="setEyeCatchingImage"><Fa :icon="faPlus"/> {{ $ts._pages.eyeCatchingImageSet }}</MkButton> <MkButton v-if="eyeCatchingImageId == null && !readonly" @click="setEyeCatchingImage"><Fa :icon="faPlus"/> {{ $ts._pages.eyeCatchingImageSet }}</MkButton>
<div v-else-if="eyeCatchingImage"> <div v-else-if="eyeCatchingImage">
<img :src="eyeCatchingImage.url" :alt="eyeCatchingImage.name" style="max-width: 100%;"/> <img :src="eyeCatchingImage.url" :alt="eyeCatchingImage.name" style="max-width: 100%;"/>
<MkButton @click="removeEyeCatchingImage()" v-if="!readonly"><Fa :icon="faTrashAlt"/> {{ $ts._pages.eyeCatchingImageRemove }}</MkButton> <MkButton @click="removeEyeCatchingImage()" v-if="!readonly"><Fa :icon="faTrashAlt"/> {{ $ts._pages.eyeCatchingImageRemove }}</MkButton>
</div>
</div> </div>
</div> </div>
</MkContainer> </div>
</MkContainer>
<MkContainer :body-togglable="true" :expanded="true" class="_vMargin"> <MkContainer :body-togglable="true" :expanded="true" class="_vMargin">
<template #header><Fa :icon="faStickyNote"/> {{ $ts._pages.contents }}</template> <template #header><Fa :icon="faStickyNote"/> {{ $ts._pages.contents }}</template>
<div class="_section"> <div style="padding: 16px;">
<XBlocks class="content" v-model:value="content" :hpml="hpml"/> <XBlocks class="content" v-model:value="content" :hpml="hpml"/>
<MkButton @click="add()" v-if="!readonly"><Fa :icon="faPlus"/></MkButton> <MkButton @click="add()" v-if="!readonly"><Fa :icon="faPlus"/></MkButton>
</div> </div>
</MkContainer> </MkContainer>
<MkContainer :body-togglable="true" class="_vMargin"> <MkContainer :body-togglable="true" class="_vMargin">
<template #header><Fa :icon="faMagic"/> {{ $ts._pages.variables }}</template> <template #header><Fa :icon="faMagic"/> {{ $ts._pages.variables }}</template>
<div class="qmuvgica"> <div class="qmuvgica">
<XDraggable tag="div" class="variables" v-show="variables.length > 0" v-model="variables" item-key="name" handle=".drag-handle" :group="{ name: 'variables' }" animation="150" swap-threshold="0.5"> <XDraggable tag="div" class="variables" v-show="variables.length > 0" v-model="variables" item-key="name" handle=".drag-handle" :group="{ name: 'variables' }" animation="150" swap-threshold="0.5">
<template #item="{element}"> <template #item="{element}">
<XVariable <XVariable
:value="element" :value="element"
:removable="true" :removable="true"
@remove="() => removeVariable(element)" @remove="() => removeVariable(element)"
:hpml="hpml" :hpml="hpml"
:name="element.name" :name="element.name"
:title="element.name" :title="element.name"
:draggable="true" :draggable="true"
/> />
</template> </template>
</XDraggable> </XDraggable>
<MkButton @click="addVariable()" class="add" v-if="!readonly"><Fa :icon="faPlus"/></MkButton> <MkButton @click="addVariable()" class="add" v-if="!readonly"><Fa :icon="faPlus"/></MkButton>
</div> </div>
</MkContainer> </MkContainer>
<MkContainer :body-togglable="true" :expanded="true" class="_vMargin"> <MkContainer :body-togglable="true" :expanded="true" class="_vMargin">
<template #header><Fa :icon="faCode"/> {{ $ts.script }}</template> <template #header><Fa :icon="faCode"/> {{ $ts.script }}</template>
<div> <div>
<MkTextarea class="_code" v-model:value="script"/> <MkTextarea class="_code" v-model:value="script"/>
</div> </div>
</MkContainer> </MkContainer>
</div>
</div> </div>
</template> </template>

View file

@ -259,7 +259,7 @@ export default defineComponent({
> footer { > footer {
display: flex; display: flex;
align-items: baseline; align-items: baseline;
border-top: solid 1px var(--divider); border-top: solid 0.5px var(--divider);
padding: 6px 8px; padding: 6px 8px;
font-size: 0.9em; font-size: 0.9em;

View file

@ -1,39 +1,37 @@
<template> <template>
<div class="cmuxhskf" v-hotkey.global="keymap"> <div class="cmuxhskf _root" v-hotkey.global="keymap">
<div class="new" v-if="queue > 0" :style="{ width: width + 'px' }"><button class="_buttonPrimary" @click="top()">{{ $ts.newNoteRecived }}</button></div> <div class="new" v-if="queue > 0" :style="{ width: width + 'px' }"><button class="_buttonPrimary" @click="top()">{{ $ts.newNoteRecived }}</button></div>
<div class="_section"> <XTutorial v-if="$store.reactiveState.tutorial.value != -1" class="tutorial _block _isolated"/>
<XTutorial v-if="$store.reactiveState.tutorial.value != -1" class="tutorial _content _vMargin"/> <XPostForm v-if="$store.reactiveState.showFixedPostForm.value" class="post-form _block _isolated" fixed/>
<XPostForm v-if="$store.reactiveState.showFixedPostForm.value" class="post-form _panel _content _vMargin" fixed/> <div class="tabs _block _vMargin">
<div class="tabs _panel _vMargin"> <div class="left">
<div class="left"> <button class="_button tab" @click="() => { src = 'home'; saveSrc(); }" :class="{ active: src === 'home' }" v-tooltip="$ts._timelines.home"><Fa :icon="faHome"/></button>
<button class="_button tab" @click="() => { src = 'home'; saveSrc(); }" :class="{ active: src === 'home' }" v-tooltip="$ts._timelines.home"><Fa :icon="faHome"/></button> <button class="_button tab" @click="() => { src = 'local'; saveSrc(); }" :class="{ active: src === 'local' }" v-tooltip="$ts._timelines.local" v-if="isLocalTimelineAvailable"><Fa :icon="faComments"/></button>
<button class="_button tab" @click="() => { src = 'local'; saveSrc(); }" :class="{ active: src === 'local' }" v-tooltip="$ts._timelines.local" v-if="isLocalTimelineAvailable"><Fa :icon="faComments"/></button> <button class="_button tab" @click="() => { src = 'social'; saveSrc(); }" :class="{ active: src === 'social' }" v-tooltip="$ts._timelines.social" v-if="isLocalTimelineAvailable"><Fa :icon="faShareAlt"/></button>
<button class="_button tab" @click="() => { src = 'social'; saveSrc(); }" :class="{ active: src === 'social' }" v-tooltip="$ts._timelines.social" v-if="isLocalTimelineAvailable"><Fa :icon="faShareAlt"/></button> <button class="_button tab" @click="() => { src = 'global'; saveSrc(); }" :class="{ active: src === 'global' }" v-tooltip="$ts._timelines.global" v-if="isGlobalTimelineAvailable"><Fa :icon="faGlobe"/></button>
<button class="_button tab" @click="() => { src = 'global'; saveSrc(); }" :class="{ active: src === 'global' }" v-tooltip="$ts._timelines.global" v-if="isGlobalTimelineAvailable"><Fa :icon="faGlobe"/></button> <span class="divider"></span>
<span class="divider"></span> <button class="_button tab" @click="() => { src = 'mentions'; saveSrc(); }" :class="{ active: src === 'mentions' }" v-tooltip="$ts.mentions"><Fa :icon="faAt"/><Fa :icon="faCircle" class="i" v-if="$i.hasUnreadMentions"/></button>
<button class="_button tab" @click="() => { src = 'mentions'; saveSrc(); }" :class="{ active: src === 'mentions' }" v-tooltip="$ts.mentions"><Fa :icon="faAt"/><Fa :icon="faCircle" class="i" v-if="$i.hasUnreadMentions"/></button> <button class="_button tab" @click="() => { src = 'directs'; saveSrc(); }" :class="{ active: src === 'directs' }" v-tooltip="$ts.directNotes"><Fa :icon="faEnvelope"/><Fa :icon="faCircle" class="i" v-if="$i.hasUnreadSpecifiedNotes"/></button>
<button class="_button tab" @click="() => { src = 'directs'; saveSrc(); }" :class="{ active: src === 'directs' }" v-tooltip="$ts.directNotes"><Fa :icon="faEnvelope"/><Fa :icon="faCircle" class="i" v-if="$i.hasUnreadSpecifiedNotes"/></button> </div>
</div> <div class="right">
<div class="right"> <button class="_button tab" @click="chooseChannel" :class="{ active: src === 'channel' }" v-tooltip="$ts.channel"><Fa :icon="faSatelliteDish"/><Fa :icon="faCircle" class="i" v-if="$i.hasUnreadChannel"/></button>
<button class="_button tab" @click="chooseChannel" :class="{ active: src === 'channel' }" v-tooltip="$ts.channel"><Fa :icon="faSatelliteDish"/><Fa :icon="faCircle" class="i" v-if="$i.hasUnreadChannel"/></button> <button class="_button tab" @click="chooseAntenna" :class="{ active: src === 'antenna' }" v-tooltip="$ts.antennas"><Fa :icon="faSatellite"/><Fa :icon="faCircle" class="i" v-if="$i.hasUnreadAntenna"/></button>
<button class="_button tab" @click="chooseAntenna" :class="{ active: src === 'antenna' }" v-tooltip="$ts.antennas"><Fa :icon="faSatellite"/><Fa :icon="faCircle" class="i" v-if="$i.hasUnreadAntenna"/></button> <button class="_button tab" @click="chooseList" :class="{ active: src === 'list' }" v-tooltip="$ts.lists"><Fa :icon="faListUl"/></button>
<button class="_button tab" @click="chooseList" :class="{ active: src === 'list' }" v-tooltip="$ts.lists"><Fa :icon="faListUl"/></button>
</div>
</div> </div>
<XTimeline ref="tl"
class="_content _vMargin"
:key="src === 'list' ? `list:${list.id}` : src === 'antenna' ? `antenna:${antenna.id}` : src === 'channel' ? `channel:${channel.id}` : src"
:src="src"
:list="list ? list.id : null"
:antenna="antenna ? antenna.id : null"
:channel="channel ? channel.id : null"
:sound="true"
@before="before()"
@after="after()"
@queue="queueUpdated"
/>
</div> </div>
<XTimeline ref="tl"
class="_vMargin"
:key="src === 'list' ? `list:${list.id}` : src === 'antenna' ? `antenna:${antenna.id}` : src === 'channel' ? `channel:${channel.id}` : src"
:src="src"
:list="list ? list.id : null"
:antenna="antenna ? antenna.id : null"
:channel="channel ? channel.id : null"
:sound="true"
@before="before()"
@after="after()"
@queue="queueUpdated"
/>
</div> </div>
</template> </template>
@ -200,6 +198,18 @@ export default defineComponent({
}); });
}, },
async timetravel() {
const { canceled, result: date } = await os.dialog({
title: this.$ts.date,
input: {
type: 'date'
}
});
if (canceled) return;
this.$refs.tl.timetravel(new Date(date));
},
focus() { focus() {
(this.$refs.tl as any).focus(); (this.$refs.tl as any).focus();
} }
@ -221,70 +231,65 @@ export default defineComponent({
} }
} }
> ._section { > .tabs {
> .tabs { display: flex;
display: flex; box-sizing: border-box;
box-sizing: border-box; padding: 0 8px;
padding: 0 8px; white-space: nowrap;
max-width: var(--baseContentWidth); overflow: auto;
//
position: relative;
> .right {
margin-left: auto; margin-left: auto;
margin-right: auto; }
white-space: nowrap;
overflow: auto;
// > .left, > .right {
position: relative; > .tab {
position: relative;
height: 50px;
padding: 0 12px;
> .right { &:hover {
margin-left: auto; color: var(--fgHighlighted);
}
&.active {
color: var(--fgHighlighted);
&:after {
content: "";
display: block;
position: absolute;
bottom: 0;
left: 0;
right: 0;
margin: 0 auto;
width: calc(100% - 16px);
height: 4px;
background: var(--accent);
border-radius: 8px 8px 0 0;
}
}
> .i {
position: absolute;
top: 16px;
right: 8px;
color: var(--indicator);
font-size: 8px;
animation: blink 1s infinite;
}
} }
> .left, > .right { > .divider {
> .tab { display: inline-block;
position: relative; width: 1px;
height: 50px; height: 28px;
padding: 0 12px; vertical-align: middle;
margin: 0 8px;
&:hover { background: var(--divider);
color: var(--fgHighlighted);
}
&.active {
color: var(--fgHighlighted);
&:after {
content: "";
display: block;
position: absolute;
bottom: 0;
left: 0;
right: 0;
margin: 0 auto;
width: calc(100% - 16px);
height: 4px;
background: var(--accent);
border-radius: 8px 8px 0 0;
}
}
> .i {
position: absolute;
top: 16px;
right: 8px;
color: var(--indicator);
font-size: 8px;
animation: blink 1s infinite;
}
}
> .divider {
display: inline-block;
width: 1px;
height: 28px;
vertical-align: middle;
margin: 0 8px;
background: var(--divider);
}
} }
} }
} }

View file

@ -1,11 +1,11 @@
<template> <template>
<div> <div>
<MkTab v-model:value="with_" class="_vMargin"> <MkTab v-model:value="with_" class="_isolated _section">
<option :value="null">{{ $ts.notes }}</option> <option :value="null">{{ $ts.notes }}</option>
<option value="replies">{{ $ts.notesAndReplies }}</option> <option value="replies">{{ $ts.notesAndReplies }}</option>
<option value="files">{{ $ts.withFiles }}</option> <option value="files">{{ $ts.withFiles }}</option>
</MkTab> </MkTab>
<XNotes ref="timeline" class="_vMargin" :pagination="pagination" @before="$emit('before')" @after="e => $emit('after', e)"/> <XNotes ref="timeline" class="_section _noGap_" :pagination="pagination" @before="$emit('before')" @after="e => $emit('after', e)"/>
</div> </div>
</template> </template>

View file

@ -93,15 +93,15 @@
</div> </div>
</div> </div>
</div> </div>
<div class="ftskorzw narrow _section" v-else-if="user && narrow === true" v-size="{ max: [500] }"> <div class="ftskorzw narrow _root" v-else-if="user && narrow === true" v-size="{ max: [500] }">
<!-- TODO --> <!-- TODO -->
<!-- <div class="punished" v-if="user.isSuspended"><Fa :icon="faExclamationTriangle" style="margin-right: 8px;"/> {{ $ts.userSuspended }}</div> --> <!-- <div class="punished" v-if="user.isSuspended"><Fa :icon="faExclamationTriangle" style="margin-right: 8px;"/> {{ $ts.userSuspended }}</div> -->
<!-- <div class="punished" v-if="user.isSilenced"><Fa :icon="faExclamationTriangle" style="margin-right: 8px;"/> {{ $ts.userSilenced }}</div> --> <!-- <div class="punished" v-if="user.isSilenced"><Fa :icon="faExclamationTriangle" style="margin-right: 8px;"/> {{ $ts.userSilenced }}</div> -->
<div class="profile _content _vMargin"> <div class="profile">
<MkRemoteCaution v-if="user.host != null" :href="user.url" class="_vMargin"/> <MkRemoteCaution v-if="user.host != null" :href="user.url" class="_vMargin"/>
<div class="_vMargin _panel main" :key="user.id"> <div class="_vMargin _block main" :key="user.id">
<div class="banner-container" :style="style"> <div class="banner-container" :style="style">
<div class="banner" ref="banner" :style="style"></div> <div class="banner" ref="banner" :style="style"></div>
<div class="fade"></div> <div class="fade"></div>
@ -177,37 +177,39 @@
</div> </div>
</div> </div>
<div class="nav _vMargin"> <div class="contents">
<MkA :to="userPage(user)" :class="{ active: page === 'index' }" class="link"> <div class="nav _isolated">
<Fa :icon="faCommentAlt" class="icon"/> <MkA :to="userPage(user)" :class="{ active: page === 'index' }" class="link">
<span>{{ $ts.notes }}</span> <Fa :icon="faCommentAlt" class="icon"/>
</MkA> <span>{{ $ts.notes }}</span>
<MkA :to="userPage(user, 'clips')" :class="{ active: page === 'clips' }" class="link"> </MkA>
<Fa :icon="faPaperclip" class="icon"/> <MkA :to="userPage(user, 'clips')" :class="{ active: page === 'clips' }" class="link">
<span>{{ $ts.clips }}</span> <Fa :icon="faPaperclip" class="icon"/>
</MkA> <span>{{ $ts.clips }}</span>
<MkA :to="userPage(user, 'pages')" :class="{ active: page === 'pages' }" class="link"> </MkA>
<Fa :icon="faFileAlt" class="icon"/> <MkA :to="userPage(user, 'pages')" :class="{ active: page === 'pages' }" class="link">
<span>{{ $ts.pages }}</span> <Fa :icon="faFileAlt" class="icon"/>
</MkA> <span>{{ $ts.pages }}</span>
</div> </MkA>
</div>
<template v-if="page === 'index'"> <template v-if="page === 'index'">
<div class="_content _vMargin"> <div>
<div v-if="user.pinnedNotes.length > 0" class="_vMargin"> <div v-if="user.pinnedNotes.length > 0">
<XNote v-for="note in user.pinnedNotes" class="note _vMargin" :note="note" @update:note="pinnedNoteUpdated(note, $event)" :key="note.id" :pinned="true"/> <XNote v-for="note in user.pinnedNotes" class="note _block _isolated" :note="note" @update:note="pinnedNoteUpdated(note, $event)" :key="note.id" :pinned="true"/>
</div>
<XPhotos :user="user" :key="user.id"/>
<XActivity :user="user" :key="user.id"/>
</div> </div>
<XPhotos :user="user" :key="user.id" class="_vMargin"/> <div>
<XActivity :user="user" :key="user.id" class="_vMargin"/> <XUserTimeline :user="user"/>
</div> </div>
<div class="_content _vMargin"> </template>
<XUserTimeline :user="user" class="_content"/> <XFollowList v-else-if="page === 'following'" type="following" :user="user" class="_content _vMargin"/>
</div> <XFollowList v-else-if="page === 'followers'" type="followers" :user="user" class="_content _vMargin"/>
</template> <XClips v-else-if="page === 'clips'" :user="user" class="_vMargin"/>
<XFollowList v-else-if="page === 'following'" type="following" :user="user" class="_content _vMargin"/> <XPages v-else-if="page === 'pages'" :user="user" class="_vMargin"/>
<XFollowList v-else-if="page === 'followers'" type="followers" :user="user" class="_content _vMargin"/> </div>
<XClips v-else-if="page === 'clips'" :user="user" class="_vMargin"/>
<XPages v-else-if="page === 'pages'" :user="user" class="_vMargin"/>
</div> </div>
<div v-else-if="error"> <div v-else-if="error">
<MkError @retry="fetch()"/> <MkError @retry="fetch()"/>
@ -234,6 +236,7 @@ import { getUserMenu } from '@client/scripts/get-user-menu';
import number from '../../filters/number'; import number from '../../filters/number';
import { userPage, acct as getAcct } from '../../filters/user'; import { userPage, acct as getAcct } from '../../filters/user';
import * as os from '@client/os'; import * as os from '@client/os';
import { url } from '@client/config';
export default defineComponent({ export default defineComponent({
components: { components: {
@ -268,6 +271,10 @@ export default defineComponent({
INFO: computed(() => this.user ? { INFO: computed(() => this.user ? {
userName: this.user, userName: this.user,
avatar: this.user, avatar: this.user,
share: {
title: this.user.name,
url: `${url}/@${this.user.username}`
},
action: { action: {
icon: faEllipsisH, icon: faEllipsisH,
handler: this.menu handler: this.menu
@ -304,7 +311,7 @@ export default defineComponent({
mounted() { mounted() {
window.requestAnimationFrame(this.parallaxLoop); window.requestAnimationFrame(this.parallaxLoop);
this.narrow = this.$el.clientWidth < 1000; this.narrow = true; //this.$el.clientWidth < 1000;
}, },
beforeUnmount() { beforeUnmount() {
@ -415,7 +422,7 @@ export default defineComponent({
font-size: 80%; font-size: 80%;
padding: 8px 12px; padding: 8px 12px;
margin-bottom: 20px; margin-bottom: 20px;
border: solid 1px var(--divider); border: solid 0.5px var(--divider);
border-radius: 999px; border-radius: 999px;
} }
} }
@ -423,7 +430,7 @@ export default defineComponent({
> .status { > .status {
display: flex; display: flex;
padding: 20px 16px; padding: 20px 16px;
border-top: solid 1px var(--divider); border-top: solid 0.5px var(--divider);
font-size: 90%; font-size: 90%;
> a { > a {
@ -451,13 +458,13 @@ export default defineComponent({
> .description { > .description {
padding: 20px 16px; padding: 20px 16px;
border-top: solid 1px var(--divider); border-top: solid 0.5px var(--divider);
font-size: 90%; font-size: 90%;
} }
> .fields { > .fields {
padding: 20px 16px; padding: 20px 16px;
border-top: solid 1px var(--divider); border-top: solid 0.5px var(--divider);
font-size: 90%; font-size: 90%;
> .field { > .field {
@ -540,9 +547,9 @@ export default defineComponent({
} }
.ftskorzw.narrow { .ftskorzw.narrow {
max-width: 100vw;
box-sizing: border-box; box-sizing: border-box;
overflow: hidden; overflow: hidden;
overflow: clip;
> .punished { > .punished {
font-size: 0.8em; font-size: 0.8em;
@ -654,7 +661,7 @@ export default defineComponent({
text-align: center; text-align: center;
padding: 50px 8px 16px 8px; padding: 50px 8px 16px 8px;
font-weight: bold; font-weight: bold;
border-bottom: solid 1px var(--divider); border-bottom: solid 0.5px var(--divider);
> .bottom { > .bottom {
> * { > * {
@ -689,7 +696,7 @@ export default defineComponent({
> .fields { > .fields {
padding: 24px; padding: 24px;
font-size: 0.9em; font-size: 0.9em;
border-top: solid 1px var(--divider); border-top: solid 0.5px var(--divider);
> .field { > .field {
display: flex; display: flex;
@ -726,7 +733,7 @@ export default defineComponent({
> .status { > .status {
display: flex; display: flex;
padding: 24px; padding: 24px;
border-top: solid 1px var(--divider); border-top: solid 0.5px var(--divider);
> a { > a {
flex: 1; flex: 1;
@ -753,41 +760,42 @@ export default defineComponent({
} }
} }
> .nav { > .contents {
display: flex; > .nav {
align-items: center; display: flex;
margin-top: var(--margin); align-items: center;
//font-size: 120%; //font-size: 120%;
font-weight: bold; font-weight: bold;
> .link { > .link {
flex: 1; flex: 1;
display: inline-block; display: inline-block;
padding: 16px; padding: 16px;
text-align: center; text-align: center;
border-bottom: solid 3px transparent; border-bottom: solid 3px transparent;
&:hover { &:hover {
text-decoration: none; text-decoration: none;
} }
&.active { &.active {
color: var(--accent); color: var(--accent);
border-bottom-color: var(--accent); border-bottom-color: var(--accent);
} }
&:not(.active):hover { &:not(.active):hover {
color: var(--fgHighlighted); color: var(--fgHighlighted);
} }
> .icon { > .icon {
margin-right: 6px; margin-right: 6px;
}
} }
} }
}
> .content { > .content {
margin-bottom: var(--margin); margin-bottom: var(--margin);
}
} }
&.max-width_500px { &.max-width_500px {
@ -831,8 +839,10 @@ export default defineComponent({
} }
} }
> .nav { > .contents {
font-size: 80%; > .nav {
font-size: 80%;
}
} }
} }
} }

View file

@ -283,7 +283,7 @@ export default defineComponent({
} }
> .status { > .status {
border-top: solid 1px var(--divider); border-top: solid 0.5px var(--divider);
padding: 32px; padding: 32px;
font-size: 90%; font-size: 90%;
@ -291,7 +291,7 @@ export default defineComponent({
> span:not(:last-child) { > span:not(:last-child) {
padding-right: 1em; padding-right: 1em;
margin-right: 1em; margin-right: 1em;
border-right: solid 1px var(--divider); border-right: solid 0.5px var(--divider);
} }
} }

View file

@ -255,7 +255,7 @@ export default defineComponent({
} }
> .status { > .status {
border-top: solid 1px var(--divider); border-top: solid 0.5px var(--divider);
padding: 32px; padding: 32px;
font-size: 90%; font-size: 90%;
@ -263,7 +263,7 @@ export default defineComponent({
> span:not(:last-child) { > span:not(:last-child) {
padding-right: 1em; padding-right: 1em;
margin-right: 1em; margin-right: 1em;
border-right: solid 1px var(--divider); border-right: solid 0.5px var(--divider);
} }
} }

View file

@ -1,40 +1,45 @@
export class StickySidebar { export class StickySidebar {
private lastScrollTop = 0; private lastScrollTop = 0;
private container: HTMLElement;
private el: HTMLElement; private el: HTMLElement;
private spacer: HTMLElement; private spacer: HTMLElement;
private marginTop: number; private marginTop: number;
private isTop = false; private isTop = false;
private isBottom = false; private isBottom = false;
private offsetTop: number;
constructor(el: StickySidebar['el'], spacer: StickySidebar['spacer'], marginTop = 0) { constructor(container: StickySidebar['container'], marginTop = 0) {
this.el = el; this.container = container;
this.spacer = spacer; this.el = this.container.children[0] as HTMLElement;
this.el.style.position = 'sticky';
this.spacer = document.createElement('div');
this.container.prepend(this.spacer);
this.marginTop = marginTop; this.marginTop = marginTop;
this.offsetTop = this.container.getBoundingClientRect().top;
} }
public calc(scrollTop: number) { public calc(scrollTop: number) {
if (scrollTop > this.lastScrollTop) { // downscroll if (scrollTop > this.lastScrollTop) { // downscroll
const overflow = this.el.clientHeight - window.innerHeight; const overflow = Math.max(0, (this.el.clientHeight + this.marginTop) - window.innerHeight);
this.el.style.bottom = null; this.el.style.bottom = null;
this.el.style.top = `${-overflow}px`; this.el.style.top = `${-overflow + this.marginTop}px`;
this.isBottom = (scrollTop + window.innerHeight) >= (this.el.offsetTop + this.el.clientHeight); this.isBottom = (scrollTop + window.innerHeight) >= (this.el.offsetTop + this.el.clientHeight);
if (this.isTop) { if (this.isTop) {
this.isTop = false; this.isTop = false;
this.spacer.style.marginTop = `${this.lastScrollTop}px`; this.spacer.style.marginTop = `${Math.max(0, this.lastScrollTop + this.marginTop - this.offsetTop)}px`;
} }
} else { // upscroll } else { // upscroll
const overflow = this.el.clientHeight - window.innerHeight; const overflow = (this.el.clientHeight + this.marginTop) - window.innerHeight;
this.el.style.top = null; this.el.style.top = null;
this.el.style.bottom = `${-overflow - this.marginTop}px`; this.el.style.bottom = `${-overflow}px`;
this.isTop = scrollTop <= this.el.offsetTop; this.isTop = scrollTop <= this.el.offsetTop;
if (this.isBottom) { if (this.isBottom) {
this.isBottom = false; this.isBottom = false;
const overflow = this.el.clientHeight - window.innerHeight; this.spacer.style.marginTop = `${this.lastScrollTop + this.marginTop - this.offsetTop - overflow}px`;
this.spacer.style.marginTop = `${this.lastScrollTop - (overflow + this.marginTop)}px`;
} }
} }

View file

@ -17,6 +17,7 @@ export const themeProps = Object.keys(lightTheme.props).filter(key => !key.start
export const builtinThemes = [ export const builtinThemes = [
require('../themes/l-light.json5'), require('../themes/l-light.json5'),
require('../themes/l-apricot.json5'), require('../themes/l-apricot.json5'),
require('../themes/l-rainy.json5'),
require('../themes/d-dark.json5'), require('../themes/d-dark.json5'),
require('../themes/d-persimmon.json5'), require('../themes/d-persimmon.json5'),

View file

@ -142,6 +142,12 @@ export const sidebarDef = {
localStorage.setItem('ui', 'deck'); localStorage.setItem('ui', 'deck');
unisonReload(); unisonReload();
} }
}, {
text: 'pope',
action: () => {
localStorage.setItem('ui', 'pope');
unisonReload();
}
}, { }, {
text: 'Chat (β)', text: 'Chat (β)',
action: () => { action: () => {

View file

@ -242,11 +242,21 @@ hr {
//border: var(--panelBorder); //border: var(--panelBorder);
box-shadow: var(--panelShadow); box-shadow: var(--panelShadow);
overflow: hidden; overflow: hidden;
overflow: clip;
}
._block {
@extend ._panel;
}
._isolated {
margin: var(--margin) 0;
} }
._card { ._card {
@extend ._panel; @extend ._panel;
// TODO: _cardTitle
> ._title { > ._title {
margin: 0; margin: 0;
padding: 22px 32px; padding: 22px 32px;
@ -262,6 +272,7 @@ hr {
} }
} }
// TODO: _cardContent
> ._content { > ._content {
padding: 32px; padding: 32px;
@ -274,12 +285,13 @@ hr {
} }
& + ._content { & + ._content {
border-top: solid 1px var(--divider); border-top: solid 0.5px var(--divider);
} }
} }
// TODO: _cardFooter
> ._footer { > ._footer {
border-top: solid 1px var(--divider); border-top: solid 0.5px var(--divider);
padding: 24px 32px; padding: 24px 32px;
@media (max-width: 500px) { @media (max-width: 500px) {
@ -288,26 +300,6 @@ hr {
} }
} }
._noGap_ ._list_ {
@extend ._panel;
> * {
margin: 0 !important;
border: none;
border-bottom: solid 1px var(--divider);
border-radius: 0;
box-shadow: none;
}
}
._inContainer_ ._list_ > * {
margin: 0 !important;
border: none;
border-bottom: solid 1px var(--divider);
border-radius: 0;
box-shadow: none;
}
._borderButton { ._borderButton {
@extend ._button; @extend ._button;
display: block; display: block;
@ -315,7 +307,7 @@ hr {
padding: 10px; padding: 10px;
box-sizing: border-box; box-sizing: border-box;
text-align: center; text-align: center;
border: solid 1px var(--divider); border: solid 0.5px var(--divider);
border-radius: var(--radius); border-radius: var(--radius);
&:active { &:active {
@ -329,47 +321,36 @@ hr {
contain: content; contain: content;
} }
._section { ._root {
padding: var(--section-padding, 32px); box-sizing: border-box;
margin: var(--root-margin, 32px) auto;
max-width: min(var(--baseContentWidth), calc(100% - (var(--root-margin, 32px) * 2)));
&:empty { ._hr {
display: none; margin: var(--margin) calc(var(--root-margin, 32px) * -1);
}
&:not(:empty) + ._section {
border-top: solid 1px var(--divider);
} }
@media (max-width: 500px) { @media (max-width: 500px) {
padding: var(--section-padding, 10px); --root-margin: 10px;
> ._title {
font-size: 1.1em;
font-weight: bold;
}
}
> ._title,
> ._content {
box-sizing: border-box;
max-width: var(--baseContentWidth);
margin: 0 auto;
}
> ._title {
margin-bottom: 24px;
font-weight: bold;
}
&._fitBottom {
padding-bottom: 0;
} }
} }
._narrow_ ._section { ._flat_ {
> ._title { --root-margin: 0;
padding: 8px; --baseContentWidth: 100%;
font-size: 1em; --panelShadow: none;
._block {
//border-top: solid 0.5px var(--divider);
//border-bottom: solid 0.5px var(--divider);
border-radius: 0;
box-shadow: none;
}
@media (max-width: 500px) {
._root {
--root-margin: 0;
}
} }
} }

View file

@ -30,7 +30,7 @@
panelShadow: '" 0 8px 24px rgba(0, 0, 0, 0.12)', panelShadow: '" 0 8px 24px rgba(0, 0, 0, 0.12)',
acrylicPanel: ':alpha<0.5<@panel', acrylicPanel: ':alpha<0.5<@panel',
shadow: 'rgba(0, 0, 0, 0.3)', shadow: 'rgba(0, 0, 0, 0.3)',
header: ':alpha<0.7<@bg', header: ':alpha<0.7<@panel',
navBg: '@panel', navBg: '@panel',
navFg: '@fg', navFg: '@fg',
navHoverFg: ':lighten<17<@fg', navHoverFg: ':lighten<17<@fg',

View file

@ -30,7 +30,7 @@
panelShadow: '" 0 8px 24px rgb(21 43 75 / 8%)', panelShadow: '" 0 8px 24px rgb(21 43 75 / 8%)',
acrylicPanel: ':alpha<0.5<@panel', acrylicPanel: ':alpha<0.5<@panel',
shadow: 'rgba(0, 0, 0, 0.1)', shadow: 'rgba(0, 0, 0, 0.1)',
header: ':alpha<0.7<@bg', header: ':alpha<0.7<@panel',
navBg: '@panel', navBg: '@panel',
navFg: '@fg', navFg: '@fg',
navHoverFg: ':darken<17<@fg', navHoverFg: ':darken<17<@fg',

View file

@ -18,7 +18,7 @@
panelHeaderDivider: '@divider', panelHeaderDivider: '@divider',
infoFg: '@accent', infoFg: '@accent',
infoBg: 'rgb(0, 0, 0)', infoBg: 'rgb(0, 0, 0)',
header: ':alpha<0.7<@bg', header: ':alpha<0.7<@panel',
navBg: '#363636', navBg: '#363636',
renote: '@accent', renote: '@accent',
mention: '#da6d35', mention: '#da6d35',

View file

@ -16,7 +16,6 @@
panelShadow: '" 0 8px 24px rgb(0 0 0 / 25%)', panelShadow: '" 0 8px 24px rgb(0 0 0 / 25%)',
infoFg: '@fg', infoFg: '@fg',
infoBg: '#333c3b', infoBg: '#333c3b',
header: ':alpha<0.7<@bg',
navBg: '#141714', navBg: '#141714',
renote: '@accent', renote: '@accent',
mention: '@accent', mention: '@accent',

View file

@ -9,9 +9,9 @@
props: { props: {
bg: '#f9f9f9', bg: '#f9f9f9',
fg: '#636b71', fg: '#676767',
divider: 'rgb(223, 223, 223)', divider: 'rgb(223, 223, 223)',
header: ':alpha<0.7<@bg', header: ':alpha<0.7<@panel',
navBg: '#fff', navBg: '#fff',
panel: '#fff', panel: '#fff',
panelShadow: '" 0 8px 24px rgb(21 43 75 / 8%)', panelShadow: '" 0 8px 24px rgb(21 43 75 / 8%)',

View file

@ -0,0 +1,21 @@
{
id: 'a58a0abb-ff8c-476a-8dec-0ad7837e7e96',
name: 'Mi Rainy',
author: 'syuilo',
base: 'light',
props: {
accent: '#5db0da',
bg: 'rgb(246 248 249)',
fg: '#636b71',
panel: '#fff',
divider: 'rgb(230 233 234)',
panelHeaderDivider: '@divider',
renote: '@accent',
link: '@accent',
mention: '@accent',
hashtag: '@accent',
},
}

View file

@ -12,14 +12,16 @@
<MkUserName v-else-if="info.userName" :user="info.userName" :nowrap="false" class="text"/> <MkUserName v-else-if="info.userName" :user="info.userName" :nowrap="false" class="text"/>
</div> </div>
</div> </div>
<button class="_button action" v-if="info.action" @click.stop="info.action.handler"><Fa :icon="info.action.icon" :key="info.action.icon"/></button> <button class="_button menu" @click.stop="menu"><Fa :icon="faEllipsisH"/></button>
<!--<button class="_button action" v-if="info.action" @click.stop="info.action.handler"><Fa :icon="info.action.icon" :key="info.action.icon"/></button>-->
</template> </template>
</div> </div>
</template> </template>
<script lang="ts"> <script lang="ts">
import { defineComponent } from 'vue'; import { defineComponent } from 'vue';
import { faChevronLeft, faCircle } from '@fortawesome/free-solid-svg-icons'; import { faChevronLeft, faCircle, faShareAlt, faEllipsisH } from '@fortawesome/free-solid-svg-icons';
import { modalMenu } from '@client/os';
export default defineComponent({ export default defineComponent({
props: { props: {
@ -42,7 +44,7 @@ export default defineComponent({
return { return {
canBack: false, canBack: false,
height: 0, height: 0,
faChevronLeft, faCircle faChevronLeft, faCircle, faShareAlt, faEllipsisH,
}; };
}, },
@ -66,6 +68,23 @@ export default defineComponent({
back() { back() {
if (this.canBack) this.$router.back(); if (this.canBack) this.$router.back();
}, },
share() {
navigator.share(this.info.share);
},
menu(ev) {
const menu = this.info.menu ? this.info.menu() : [];
if (this.info.share) {
if (menu.length > 0) menu.push(null);
menu.push({
text: this.$ts.share,
icon: faShareAlt,
action: this.share
});
}
modalMenu(menu, ev.currentTarget || ev.target);
}
} }
}); });
</script> </script>
@ -74,59 +93,33 @@ export default defineComponent({
.fdidabkb { .fdidabkb {
&.center { &.center {
text-align: center; text-align: center;
}
> .back {
height: var(--height);
width: var(--height);
}
> .action {
height: var(--height);
width: var(--height);
}
> .titleContainer {
width: calc(100% - (var(--height) * 2));
> .title {
height: var(--height);
> .avatar {
$size: 32px;
margin: calc((var(--height) - #{$size}) / 2) 8px calc((var(--height) - #{$size}) / 2) 0;
pointer-events: none;
}
}
}
}
</style>
<style lang="scss" scoped>
.fdidabkb {
> .back {
position: absolute;
z-index: 1;
top: 0;
left: 0;
}
> .action {
position: absolute;
z-index: 1;
top: 0;
right: 0;
}
&.center {
> .titleContainer { > .titleContainer {
margin: 0 auto; margin: 0 auto;
} }
} }
> .back,
> .menu {
position: absolute;
z-index: 1;
top: 0;
height: var(--height);
width: var(--height);
}
> .back {
left: 0;
}
> .menu {
right: 0;
}
> .titleContainer { > .titleContainer {
overflow: auto; overflow: auto;
white-space: nowrap; white-space: nowrap;
width: calc(100% - (var(--height) * 2));
> .title { > .title {
display: inline-block; display: inline-block;
@ -136,16 +129,7 @@ export default defineComponent({
text-overflow: ellipsis; text-overflow: ellipsis;
padding: 0 16px; padding: 0 16px;
position: relative; position: relative;
height: var(--height);
> .indicator {
position: absolute;
top: initial;
right: 8px;
top: 8px;
color: var(--indicator);
font-size: 12px;
animation: blink 1s infinite;
}
> .icon + .text { > .icon + .text {
margin-left: 8px; margin-left: 8px;
@ -157,6 +141,8 @@ export default defineComponent({
width: $size; width: $size;
height: $size; height: $size;
vertical-align: bottom; vertical-align: bottom;
margin: calc((var(--height) - #{$size}) / 2) 8px calc((var(--height) - #{$size}) / 2) 0;
pointer-events: none;
} }
} }
} }

View file

@ -235,12 +235,12 @@ export default defineComponent({
}, },
more(ev) { more(ev) {
os.popup(import('./launch-pad.vue'), {}, { os.popup(import('@client/components/launch-pad.vue'), {}, {
}, 'closed'); }, 'closed');
}, },
addAcount() { addAcount() {
os.popup(import('./signin-dialog.vue'), {}, { os.popup(import('@client/components/signin-dialog.vue'), {}, {
done: res => { done: res => {
addAccount(res.id, res.i); addAccount(res.id, res.i);
os.success(); os.success();
@ -249,7 +249,7 @@ export default defineComponent({
}, },
createAccount() { createAccount() {
os.popup(import('./signup-dialog.vue'), {}, { os.popup(import('@client/components/signup-dialog.vue'), {}, {
done: res => { done: res => {
addAccount(res.id, res.i); addAccount(res.id, res.i);
this.switchAccountWithToken(res.i); this.switchAccountWithToken(res.i);
@ -380,7 +380,7 @@ export default defineComponent({
> .divider { > .divider {
margin: 16px 0; margin: 16px 0;
border-top: solid 1px var(--divider); border-top: solid 0.5px var(--divider);
} }
> .item { > .item {
@ -443,13 +443,13 @@ export default defineComponent({
&:first-child { &:first-child {
top: 0; top: 0;
margin-bottom: 16px; margin-bottom: 16px;
border-bottom: solid 1px var(--divider); border-bottom: solid 0.5px var(--divider);
} }
&:last-child { &:last-child {
bottom: 0; bottom: 0;
margin-top: 16px; margin-top: 16px;
border-top: solid 1px var(--divider); border-top: solid 0.5px var(--divider);
} }
} }
} }

View file

@ -136,7 +136,7 @@ import { defineComponent, defineAsyncComponent } from 'vue';
import { faLayerGroup, faBars, faHome, faCircle, faWindowMaximize, faColumns, faPencilAlt, faShareAlt, faSatelliteDish, faListUl, faSatellite, faCog, faSearch, faPlus, faStar, faAt, faLink, faEllipsisH, faGlobe } from '@fortawesome/free-solid-svg-icons'; import { faLayerGroup, faBars, faHome, faCircle, faWindowMaximize, faColumns, faPencilAlt, faShareAlt, faSatelliteDish, faListUl, faSatellite, faCog, faSearch, faPlus, faStar, faAt, faLink, faEllipsisH, faGlobe } from '@fortawesome/free-solid-svg-icons';
import { faBell, faStar as farStar, faEnvelope, faComments, faCalendarAlt } from '@fortawesome/free-regular-svg-icons'; import { faBell, faStar as farStar, faEnvelope, faComments, faCalendarAlt } from '@fortawesome/free-regular-svg-icons';
import { instanceName, url } from '@client/config'; import { instanceName, url } from '@client/config';
import XSidebar from '@client/components/sidebar.vue'; import XSidebar from '@client/ui/_common_/sidebar.vue';
import XWidgets from './widgets.vue'; import XWidgets from './widgets.vue';
import XCommon from '../_common_/common.vue'; import XCommon from '../_common_/common.vue';
import XSide from './side.vue'; import XSide from './side.vue';
@ -354,7 +354,7 @@ export default defineComponent({
flex-direction: column; flex-direction: column;
width: 250px; width: 250px;
height: 100vh; height: 100vh;
border-right: solid 1px var(--divider); border-right: solid 0.5px var(--divider);
> .header, > .footer { > .header, > .footer {
$padding: 8px; $padding: 8px;
@ -367,11 +367,11 @@ export default defineComponent({
user-select: none; user-select: none;
&.header { &.header {
border-bottom: solid 1px var(--divider); border-bottom: solid 0.5px var(--divider);
} }
&.footer { &.footer {
border-top: solid 1px var(--divider); border-top: solid 0.5px var(--divider);
} }
> .left, > .right { > .left, > .right {
@ -526,7 +526,7 @@ export default defineComponent({
padding: $padding; padding: $padding;
box-sizing: border-box; box-sizing: border-box;
background-color: var(--panel); background-color: var(--panel);
border-bottom: solid 1px var(--divider); border-bottom: solid 0.5px var(--divider);
user-select: none; user-select: none;
> .left { > .left {
@ -599,7 +599,7 @@ export default defineComponent({
> .side { > .side {
width: 350px; width: 350px;
border-left: solid 1px var(--divider); border-left: solid 0.5px var(--divider);
&.widgets.sideViewOpening { &.widgets.sideViewOpening {
@media (max-width: 1400px) { @media (max-width: 1400px) {

View file

@ -79,7 +79,7 @@ export default defineComponent({
margin: 0 .5em 0 0; margin: 0 .5em 0 0;
padding: 1px 6px; padding: 1px 6px;
font-size: 80%; font-size: 80%;
border: solid 1px var(--divider); border: solid 0.5px var(--divider);
border-radius: 3px; border-radius: 3px;
} }

View file

@ -130,7 +130,7 @@ export default defineComponent({
} }
> .reply { > .reply {
border-left: solid 1px var(--divider); border-left: solid 0.5px var(--divider);
margin-top: 10px; margin-top: 10px;
} }
} }

View file

@ -1127,7 +1127,7 @@ export default defineComponent({
} }
> .reply { > .reply {
border-top: solid 1px var(--divider); border-top: solid 0.5px var(--divider);
} }
} }

View file

@ -615,7 +615,7 @@ export default defineComponent({
<style lang="scss" scoped> <style lang="scss" scoped>
.pxiwixjf { .pxiwixjf {
position: relative; position: relative;
border: solid 1px var(--divider); border: solid 0.5px var(--divider);
border-radius: 8px; border-radius: 8px;
> .form { > .form {
@ -696,7 +696,7 @@ export default defineComponent({
> .cw { > .cw {
z-index: 1; z-index: 1;
padding-bottom: 8px; padding-bottom: 8px;
border-bottom: solid 1px var(--divider); border-bottom: solid 0.5px var(--divider);
} }
> .text { > .text {

View file

@ -117,7 +117,7 @@ export default defineComponent({
.mrajymqm { .mrajymqm {
$header-height: 54px; // TODO: $header-height: 54px; // TODO:
--section-padding: 16px; --root-margin: 16px;
--margin: var(--marginHalf); --margin: var(--marginHalf);
height: 100%; height: 100%;
@ -137,7 +137,7 @@ export default defineComponent({
-webkit-backdrop-filter: blur(32px); -webkit-backdrop-filter: blur(32px);
backdrop-filter: blur(32px); backdrop-filter: blur(32px);
background-color: var(--header); background-color: var(--header);
border-bottom: solid 1px var(--divider); border-bottom: solid 0.5px var(--divider);
box-sizing: border-box; box-sizing: border-box;
> ._button { > ._button {

View file

@ -36,7 +36,7 @@ import { } from '@fortawesome/free-regular-svg-icons';
import { v4 as uuid } from 'uuid'; import { v4 as uuid } from 'uuid';
import { host } from '@client/config'; import { host } from '@client/config';
import DeckColumnCore from '@client/ui/deck/column-core.vue'; import DeckColumnCore from '@client/ui/deck/column-core.vue';
import XSidebar from '@client/components/sidebar.vue'; import XSidebar from '@client/ui/_common_/sidebar.vue';
import { getScrollContainer } from '@client/scripts/scroll'; import { getScrollContainer } from '@client/scripts/scroll';
import * as os from '@client/os'; import * as os from '@client/os';
import { sidebarDef } from '@client/sidebar'; import { sidebarDef } from '@client/sidebar';

View file

@ -265,7 +265,7 @@ export default defineComponent({
<style lang="scss" scoped> <style lang="scss" scoped>
.dnpfarvg { .dnpfarvg {
--section-padding: 10px; --root-margin: 10px;
height: 100%; height: 100%;
overflow: hidden; overflow: hidden;

View file

@ -4,7 +4,7 @@
<XHeader :info="pageInfo"/> <XHeader :info="pageInfo"/>
</template> </template>
<router-view v-slot="{ Component }"> <router-view v-slot="{ Component }" class="_flat_">
<transition> <transition>
<keep-alive :include="['timeline']"> <keep-alive :include="['timeline']">
<component :is="Component" :ref="changePage" @contextmenu.stop="onContextmenu"/> <component :is="Component" :ref="changePage" @contextmenu.stop="onContextmenu"/>

View file

@ -118,7 +118,7 @@ export default defineComponent({
.qvzfzxam { .qvzfzxam {
$header-height: 58px; // TODO: $header-height: 58px; // TODO:
--section-padding: 16px; --root-margin: 16px;
--margin: var(--marginHalf); --margin: var(--marginHalf);
> .container { > .container {

View file

@ -0,0 +1,362 @@
<template>
<div class="npcljfve" :class="{ iconOnly }">
<button class="item _button account" @click="openAccountMenu">
<MkAvatar :user="$i" class="avatar"/><MkAcct class="text" :user="$i"/>
</button>
<div class="post" @click="post">
<MkButton class="button" primary full>
<Fa :icon="faPencilAlt" fixed-width/><span class="text" v-if="!iconOnly">{{ $ts.note }}</span>
</MkButton>
</div>
<div class="divider"></div>
<MkA class="item index" active-class="active" to="/" exact>
<Fa :icon="faHome" fixed-width/><span class="text">{{ $ts.timeline }}</span>
</MkA>
<template v-for="item in menu">
<div v-if="item === '-'" class="divider"></div>
<component v-else-if="menuDef[item] && (menuDef[item].show !== false)" :is="menuDef[item].to ? 'MkA' : 'button'" class="item _button" :class="item" active-class="active" v-on="menuDef[item].action ? { click: menuDef[item].action } : {}" :to="menuDef[item].to">
<Fa :icon="menuDef[item].icon" fixed-width/><span class="text">{{ $ts[menuDef[item].title] }}</span>
<i v-if="menuDef[item].indicated"><Fa :icon="faCircle"/></i>
</component>
</template>
<div class="divider"></div>
<button class="item _button" :class="{ active: $route.path === '/instance' || $route.path.startsWith('/instance/') }" v-if="$i.isAdmin || $i.isModerator" @click="oepnInstanceMenu">
<Fa :icon="faServer" fixed-width/><span class="text">{{ $ts.instance }}</span>
</button>
<button class="item _button" @click="more">
<Fa :icon="faEllipsisH" fixed-width/><span class="text">{{ $ts.more }}</span>
<i v-if="otherNavItemIndicated"><Fa :icon="faCircle"/></i>
</button>
<MkA class="item" active-class="active" to="/settings">
<Fa :icon="faCog" fixed-width/><span class="text">{{ $ts.settings }}</span>
</MkA>
</div>
</template>
<script lang="ts">
import { defineComponent } from 'vue';
import { faGripVertical, faChevronLeft, faHashtag, faBroadcastTower, faFireAlt, faEllipsisH, faPencilAlt, faBars, faTimes, faSearch, faUserCog, faCog, faUser, faHome, faStar, faCircle, faAt, faListUl, faPlus, faUserClock, faUsers, faTachometerAlt, faExchangeAlt, faGlobe, faChartBar, faCloud, faServer, faInfoCircle, faQuestionCircle, faProjectDiagram, faStream, faExclamationCircle } from '@fortawesome/free-solid-svg-icons';
import { faBell, faEnvelope, faLaugh, faComments } from '@fortawesome/free-regular-svg-icons';
import { host } from '@client/config';
import { search } from '@client/scripts/search';
import * as os from '@client/os';
import { sidebarDef } from '@client/sidebar';
import { getAccounts, addAccount, login } from '@client/account';
import MkButton from '@client/components/ui/button.vue';
import { StickySidebar } from '@client/scripts/sticky-sidebar';
export default defineComponent({
components: {
MkButton
},
data() {
return {
host: host,
accounts: [],
connection: null,
menuDef: sidebarDef,
iconOnly: false,
faGripVertical, faChevronLeft, faComments, faHashtag, faBroadcastTower, faFireAlt, faEllipsisH, faPencilAlt, faBars, faTimes, faBell, faSearch, faUserCog, faCog, faUser, faHome, faStar, faCircle, faAt, faEnvelope, faListUl, faPlus, faUserClock, faLaugh, faUsers, faTachometerAlt, faExchangeAlt, faGlobe, faChartBar, faCloud, faServer, faProjectDiagram
};
},
computed: {
menu(): string[] {
return this.$store.state.menu;
},
otherNavItemIndicated(): boolean {
for (const def in this.menuDef) {
if (this.menu.includes(def)) continue;
if (this.menuDef[def].indicated) return true;
}
return false;
},
},
watch: {
'$store.reactiveState.sidebarDisplay.value'() {
this.calcViewState();
},
iconOnly() {
this.$nextTick(() => {
this.$emit('change-view-mode');
});
},
},
created() {
window.addEventListener('resize', this.calcViewState);
this.calcViewState();
},
mounted() {
const sticky = new StickySidebar(this.$el.parentElement, 16);
window.addEventListener('scroll', () => {
sticky.calc(window.scrollY);
}, { passive: true });
},
methods: {
calcViewState() {
this.iconOnly = (window.innerWidth <= 1400) || (this.$store.state.sidebarDisplay === 'icon');
},
post() {
os.post();
},
search() {
search();
},
async openAccountMenu(ev) {
const storedAccounts = getAccounts().filter(x => x.id !== this.$i.id);
const accountsPromise = os.api('users/show', { userIds: storedAccounts.map(x => x.id) });
const accountItemPromises = storedAccounts.map(a => new Promise(res => {
accountsPromise.then(accounts => {
const account = accounts.find(x => x.id === a.id);
if (account == null) return res(null);
res({
type: 'user',
user: account,
action: () => { this.switchAccount(account); }
});
});
}));
os.modalMenu([...[{
type: 'link',
text: this.$ts.profile,
to: `/@${ this.$i.username }`,
avatar: this.$i,
}, null, ...accountItemPromises, {
icon: faPlus,
text: this.$ts.addAcount,
action: () => {
os.modalMenu([{
text: this.$ts.existingAcount,
action: () => { this.addAcount(); },
}, {
text: this.$ts.createAccount,
action: () => { this.createAccount(); },
}], ev.currentTarget || ev.target);
},
}]], ev.currentTarget || ev.target, {
align: 'left'
});
},
oepnInstanceMenu(ev) {
os.modalMenu([{
type: 'link',
text: this.$ts.dashboard,
to: '/instance',
icon: faTachometerAlt,
}, null, this.$i.isAdmin ? {
type: 'link',
text: this.$ts.settings,
to: '/instance/settings',
icon: faCog,
} : undefined, {
type: 'link',
text: this.$ts.customEmojis,
to: '/instance/emojis',
icon: faLaugh,
}, {
type: 'link',
text: this.$ts.users,
to: '/instance/users',
icon: faUsers,
}, {
type: 'link',
text: this.$ts.files,
to: '/instance/files',
icon: faCloud,
}, {
type: 'link',
text: this.$ts.jobQueue,
to: '/instance/queue',
icon: faExchangeAlt,
}, {
type: 'link',
text: this.$ts.federation,
to: '/instance/federation',
icon: faGlobe,
}, {
type: 'link',
text: this.$ts.relays,
to: '/instance/relays',
icon: faProjectDiagram,
}, {
type: 'link',
text: this.$ts.announcements,
to: '/instance/announcements',
icon: faBroadcastTower,
}, {
type: 'link',
text: this.$ts.abuseReports,
to: '/instance/abuses',
icon: faExclamationCircle,
}, {
type: 'link',
text: this.$ts.logs,
to: '/instance/logs',
icon: faStream,
}], ev.currentTarget || ev.target);
},
more(ev) {
os.popup(import('@client/components/launch-pad.vue'), {}, {
}, 'closed');
},
addAcount() {
os.popup(import('@client/components/signin-dialog.vue'), {}, {
done: res => {
addAccount(res.id, res.i);
os.success();
},
}, 'closed');
},
createAccount() {
os.popup(import('@client/components/signup-dialog.vue'), {}, {
done: res => {
addAccount(res.id, res.i);
this.switchAccountWithToken(res.i);
},
}, 'closed');
},
switchAccount(account: any) {
const storedAccounts = getAccounts();
const token = storedAccounts.find(x => x.id === account.id).token;
this.switchAccountWithToken(token);
},
switchAccountWithToken(token: string) {
login(token);
},
}
});
</script>
<style lang="scss" scoped>
.npcljfve {
$ui-font-size: 1em; // TODO:
$nav-icon-only-width: 78px; // TODO:
$avatar-size: 32px;
$avatar-margin: 8px;
padding: 0 16px;
box-sizing: border-box;
width: 260px;
&.iconOnly {
flex: 0 0 $nav-icon-only-width;
width: $nav-icon-only-width !important;
> .divider {
margin: 8px auto;
width: calc(100% - 32px);
}
> .post {
> .button {
width: 46px;
height: 46px;
padding: 0;
}
}
> .item {
padding-left: 0;
width: 100%;
text-align: center;
font-size: $ui-font-size * 1.1;
line-height: 3.7rem;
> [data-icon],
> .avatar {
margin-right: 0;
}
> i {
left: 10px;
}
> .text {
display: none;
}
}
}
> .divider {
margin: 10px 0;
border-top: solid 0.5px var(--divider);
}
> .post {
position: sticky;
top: 0;
z-index: 1;
padding: 16px 0;
background: var(--bg);
> .button {
min-width: 0;
}
}
> .item {
position: relative;
display: block;
font-size: $ui-font-size;
line-height: 2.6rem;
text-overflow: ellipsis;
overflow: hidden;
white-space: nowrap;
width: 100%;
text-align: left;
box-sizing: border-box;
> [data-icon] {
width: 32px;
}
> [data-icon],
> .avatar {
margin-right: $avatar-margin;
}
> .avatar {
width: $avatar-size;
height: $avatar-size;
vertical-align: middle;
}
> i {
position: absolute;
top: 0;
left: 20px;
color: var(--navIndicator);
font-size: 8px;
animation: blink 1s infinite;
}
&:hover {
text-decoration: none;
color: var(--navHoverFg);
}
&.active {
color: var(--navActive);
}
}
}
</style>

View file

@ -1,13 +1,15 @@
<template> <template>
<div class="mk-app" :class="{ wallpaper }"> <div class="mk-app" :class="{ wallpaper, isMobile }">
<XSidebar ref="nav" class="sidebar"/> <div class="columns">
<div class="sidebar" ref="sidebar" v-if="!isMobile">
<XSidebar/>
</div>
<div class="contents" ref="contents" :class="{ withHeader: $store.state.titlebar }" @contextmenu.stop="onContextmenu"> <main class="main _panel" @contextmenu.stop="onContextmenu">
<header v-if="$store.state.titlebar" class="header" ref="header" @click="onHeaderClick"> <header v-if="$store.state.titlebar" class="header" @click="onHeaderClick">
<XHeader :info="pageInfo"/> <XHeader :info="pageInfo"/>
</header> </header>
<main ref="main"> <div class="content _flat_">
<div class="content">
<router-view v-slot="{ Component }"> <router-view v-slot="{ Component }">
<transition :name="$store.state.animation ? 'page' : ''" mode="out-in" @enter="onTransition"> <transition :name="$store.state.animation ? 'page' : ''" mode="out-in" @enter="onTransition">
<keep-alive :include="['timeline']"> <keep-alive :include="['timeline']">
@ -16,26 +18,22 @@
</transition> </transition>
</router-view> </router-view>
</div> </div>
<div class="spacer"></div>
</main> </main>
<div v-if="isDesktop" class="widgets" ref="widgets">
<XWidgets @mounted="attachSticky"/>
</div>
</div> </div>
<XSide v-if="isDesktop" class="side" ref="side"/> <div class="buttons" v-if="isMobile">
<button class="button nav _button" @click="showDrawerNav" ref="navButton"><Fa :icon="faBars"/><i v-if="navIndicated"><Fa :icon="faCircle"/></i></button>
<div v-if="isDesktop" class="widgets">
<div ref="widgetsSpacer"></div>
<XWidgets @mounted="attachSticky"/>
</div>
<div class="buttons" :class="{ navHidden }">
<button class="button nav _button" @click="showNav" ref="navButton"><Fa :icon="faBars"/><i v-if="navIndicated"><Fa :icon="faCircle"/></i></button>
<button class="button home _button" @click="$route.name === 'index' ? top() : $router.push('/')"><Fa :icon="faHome"/></button> <button class="button home _button" @click="$route.name === 'index' ? top() : $router.push('/')"><Fa :icon="faHome"/></button>
<button class="button notifications _button" @click="$router.push('/my/notifications')"><Fa :icon="faBell"/><i v-if="$i.hasUnreadNotification"><Fa :icon="faCircle"/></i></button> <button class="button notifications _button" @click="$router.push('/my/notifications')"><Fa :icon="faBell"/><i v-if="$i.hasUnreadNotification"><Fa :icon="faCircle"/></i></button>
<button class="button widget _button" @click="widgetsShowing = true"><Fa :icon="faLayerGroup"/></button> <button class="button widget _button" @click="widgetsShowing = true"><Fa :icon="faLayerGroup"/></button>
<button class="button post _button" @click="post"><Fa :icon="faPencilAlt"/></button> <button class="button post _button" @click="post"><Fa :icon="faPencilAlt"/></button>
</div> </div>
<button class="widgetButton _button" :class="{ navHidden }" @click="widgetsShowing = true"><Fa :icon="faLayerGroup"/></button> <XDrawerSidebar ref="drawerNav" class="sidebar" v-if="isMobile"/>
<transition name="tray-back"> <transition name="tray-back">
<div class="tray-back _modalBg" <div class="tray-back _modalBg"
@ -59,38 +57,31 @@ import { faLayerGroup, faBars, faHome, faCircle, faWindowMaximize, faColumns, fa
import { faBell } from '@fortawesome/free-regular-svg-icons'; import { faBell } from '@fortawesome/free-regular-svg-icons';
import { instanceName } from '@client/config'; import { instanceName } from '@client/config';
import { StickySidebar } from '@client/scripts/sticky-sidebar'; import { StickySidebar } from '@client/scripts/sticky-sidebar';
import XSidebar from '@client/components/sidebar.vue'; import XSidebar from './default.sidebar.vue';
import XDrawerSidebar from '@client/ui/_common_/sidebar.vue';
import XCommon from './_common_/common.vue'; import XCommon from './_common_/common.vue';
import XHeader from './_common_/header.vue'; import XHeader from './_common_/header.vue';
import XSide from './default.side.vue';
import * as os from '@client/os'; import * as os from '@client/os';
import { sidebarDef } from '@client/sidebar'; import { sidebarDef } from '@client/sidebar';
const DESKTOP_THRESHOLD = 1100; const DESKTOP_THRESHOLD = 1100;
const MOBILE_THRESHOLD = 600;
export default defineComponent({ export default defineComponent({
components: { components: {
XCommon, XCommon,
XSidebar, XSidebar,
XDrawerSidebar,
XHeader, XHeader,
XWidgets: defineAsyncComponent(() => import('./default.widgets.vue')), XWidgets: defineAsyncComponent(() => import('./default.widgets.vue')),
XSide, // NOTE: dynamic importAsyncComponentWrapperref
},
provide() {
return {
sideViewHook: this.isDesktop ? (url) => {
this.$refs.side.navigate(url);
} : null
};
}, },
data() { data() {
return { return {
pageInfo: null, pageInfo: null,
isDesktop: window.innerWidth >= DESKTOP_THRESHOLD,
menuDef: sidebarDef, menuDef: sidebarDef,
navHidden: false, isMobile: window.innerWidth <= MOBILE_THRESHOLD,
isDesktop: window.innerWidth >= DESKTOP_THRESHOLD,
widgetsShowing: false, widgetsShowing: false,
wallpaper: localStorage.getItem('wallpaper') != null, wallpaper: localStorage.getItem('wallpaper') != null,
faLayerGroup, faBars, faBell, faHome, faCircle, faPencilAlt, faLayerGroup, faBars, faBell, faHome, faCircle, faPencilAlt,
@ -125,21 +116,10 @@ export default defineComponent({
}, },
mounted() { mounted() {
this.adjustUI(); window.addEventListener('resize', () => {
this.isMobile = (window.innerWidth <= MOBILE_THRESHOLD);
const ro = new ResizeObserver((entries, observer) => { this.isDesktop = (window.innerWidth >= DESKTOP_THRESHOLD);
this.adjustUI(); }, { passive: true });
});
ro.observe(this.$refs.contents);
window.addEventListener('resize', this.adjustUI, { passive: true });
if (!this.isDesktop) {
window.addEventListener('resize', () => {
if (window.innerWidth >= DESKTOP_THRESHOLD) this.isDesktop = true;
}, { passive: true });
}
}, },
methods: { methods: {
@ -151,20 +131,8 @@ export default defineComponent({
} }
}, },
adjustUI() { attachSticky() {
const navWidth = this.$refs.nav.$el.offsetWidth; const sticky = new StickySidebar(this.$refs.widgets, 16);
this.navHidden = navWidth === 0;
if (this.$refs.contents == null) return;
const width = this.$refs.contents.offsetWidth;
if (this.$refs.header) this.$refs.header.style.width = `${width}px`;
},
showNav() {
this.$refs.nav.show();
},
attachSticky(el) {
const sticky = new StickySidebar(el, this.$refs.widgetsSpacer);
window.addEventListener('scroll', () => { window.addEventListener('scroll', () => {
sticky.calc(window.scrollY); sticky.calc(window.scrollY);
}, { passive: true }); }, { passive: true });
@ -178,6 +146,10 @@ export default defineComponent({
window.scroll({ top: 0, behavior: 'smooth' }); window.scroll({ top: 0, behavior: 'smooth' });
}, },
showDrawerNav() {
this.$refs.drawerNav.show();
},
onTransition() { onTransition() {
if (window._scroll) window._scroll(); if (window._scroll) window._scroll();
}, },
@ -200,12 +172,6 @@ export default defineComponent({
os.contextMenu([{ os.contextMenu([{
type: 'label', type: 'label',
text: path, text: path,
}, {
icon: faColumns,
text: this.$ts.openInSideView,
action: () => {
this.$refs.side.navigate(path);
}
}, { }, {
icon: faWindowMaximize, icon: faWindowMaximize,
text: this.$ts.openInWindow, text: this.$ts.openInWindow,
@ -242,99 +208,98 @@ export default defineComponent({
} }
.mk-app { .mk-app {
$header-height: 58px; // TODO: $header-height: 50px;
$ui-font-size: 1em; // TODO: $ui-font-size: 1em;
$widgets-hide-threshold: 1090px; $widgets-hide-threshold: 1200px;
$nav-icon-only-width: 78px; // TODO:
// 100vh ... https://css-tricks.com/the-trick-to-viewport-units-on-mobile/ // 100vh ... https://css-tricks.com/the-trick-to-viewport-units-on-mobile/
min-height: calc(var(--vh, 1vh) * 100); min-height: calc(var(--vh, 1vh) * 100);
box-sizing: border-box; box-sizing: border-box;
display: flex;
&.wallpaper { &.wallpaper {
background: var(--wallpaperOverlay); background: var(--wallpaperOverlay);
//backdrop-filter: blur(4px); //backdrop-filter: blur(4px);
} }
> .contents { &.isMobile {
width: 100%; > .columns {
min-width: 0; display: block;
margin: 0;
&.withHeader { > .main {
padding-top: $header-height; margin: 0;
border: none;
width: 100%;
border-radius: 0;
> .header {
width: 100%;
}
}
} }
}
> .header { > .columns {
position: fixed; display: flex;
z-index: 1000; justify-content: center;
top: 0; max-width: 100%;
height: $header-height; margin: 32px 0;
width: 100%;
line-height: $header-height;
text-align: center;
font-weight: bold;
//background-color: var(--panel);
-webkit-backdrop-filter: blur(32px);
backdrop-filter: blur(32px);
background-color: var(--header);
//border-bottom: solid 1px var(--divider);
user-select: none;
}
> main { > .main {
min-width: 0; width: 750px;
margin: 0 16px 0 0;
background: var(--bg);
--margin: 12px;
> .header {
position: sticky;
z-index: 1000;
top: 0;
height: $header-height;
line-height: $header-height;
-webkit-backdrop-filter: blur(32px);
backdrop-filter: blur(32px);
background-color: var(--header);
border-bottom: solid 0.5px var(--divider);
}
> .content { > .content {
> * { background: var(--bg);
// calc(100vh - #{$header-height}) ... https://css-tricks.com/the-trick-to-viewport-units-on-mobile/ --stickyTop: #{$header-height};
min-height: calc((var(--vh, 1vh) * 100) - #{$header-height});
}
} }
> .spacer { @media (max-width: 850px) {
height: 82px; padding-top: $header-height;
@media (min-width: ($widgets-hide-threshold + 1px)) { > .header {
display: none; position: fixed;
width: calc(100% - #{$nav-icon-only-width});
} }
} }
} }
}
> .side { > .widgets {
min-width: 370px; //--panelShadow: none;
max-width: 370px;
border-left: solid 1px var(--divider);
}
> .widgets { @media (max-width: $widgets-hide-threshold) {
padding: 0 var(--margin); display: none;
border-left: solid 1px var(--divider); }
@media (max-width: $widgets-hide-threshold) {
display: none;
}
}
> .widgetButton {
display: block;
position: fixed;
z-index: 1000;
bottom: 32px;
right: 32px;
width: 64px;
height: 64px;
border-radius: 100%;
box-shadow: 0 3px 5px -1px rgba(0, 0, 0, 0.2), 0 6px 10px 0 rgba(0, 0, 0, 0.14), 0 1px 18px 0 rgba(0, 0, 0, 0.12);
font-size: 22px;
background: var(--panel);
&.navHidden {
display: none;
} }
@media (min-width: ($widgets-hide-threshold + 1px)) { @media (max-width: 850px) {
display: none; margin: 0;
> .sidebar {
border-right: solid 0.5px var(--divider);
}
> .main {
margin: 0;
border-radius: 0;
box-shadow: none;
width: 100%;
}
} }
} }
@ -349,10 +314,7 @@ export default defineComponent({
-webkit-backdrop-filter: blur(32px); -webkit-backdrop-filter: blur(32px);
backdrop-filter: blur(32px); backdrop-filter: blur(32px);
background-color: var(--header); background-color: var(--header);
border-top: solid 0.5px var(--divider);
&:not(.navHidden) {
display: none;
}
> .button { > .button {
position: relative; position: relative;
@ -429,6 +391,3 @@ export default defineComponent({
} }
} }
</style> </style>
<style lang="scss">
</style>

View file

@ -61,8 +61,6 @@ export default defineComponent({
.efzpzdvf { .efzpzdvf {
position: sticky; position: sticky;
height: min-content; height: min-content;
min-height: 100vh;
padding: var(--margin) 0;
box-sizing: border-box; box-sizing: border-box;
> * { > * {

View file

@ -12,7 +12,7 @@ import { host } from '@client/config';
import { search } from '@client/scripts/search'; import { search } from '@client/scripts/search';
import XCommon from './_common_/common.vue'; import XCommon from './_common_/common.vue';
import * as os from '@client/os'; import * as os from '@client/os';
import XSidebar from '@client/components/sidebar.vue'; import XSidebar from '@client/ui/_common_/sidebar.vue';
import { sidebarDef } from '@client/sidebar'; import { sidebarDef } from '@client/sidebar';
import { ColdDeviceStorage } from '@client/store'; import { ColdDeviceStorage } from '@client/store';

433
src/client/ui/universal.vue Normal file
View file

@ -0,0 +1,433 @@
<template>
<div class="mk-app" :class="{ wallpaper }">
<XSidebar ref="nav" class="sidebar"/>
<div class="contents" ref="contents" :class="{ withHeader: $store.state.titlebar }" @contextmenu.stop="onContextmenu">
<header v-if="$store.state.titlebar" class="header" ref="header" @click="onHeaderClick">
<XHeader :info="pageInfo"/>
</header>
<main ref="main">
<div class="content">
<router-view v-slot="{ Component }">
<transition :name="$store.state.animation ? 'page' : ''" mode="out-in" @enter="onTransition">
<keep-alive :include="['timeline']">
<component :is="Component" :ref="changePage"/>
</keep-alive>
</transition>
</router-view>
</div>
<div class="spacer"></div>
</main>
</div>
<XSide v-if="isDesktop" class="side" ref="side"/>
<div v-if="isDesktop" class="widgets" ref="widgets">
<XWidgets @mounted="attachSticky"/>
</div>
<div class="buttons" :class="{ navHidden }">
<button class="button nav _button" @click="showNav" ref="navButton"><Fa :icon="faBars"/><i v-if="navIndicated"><Fa :icon="faCircle"/></i></button>
<button class="button home _button" @click="$route.name === 'index' ? top() : $router.push('/')"><Fa :icon="faHome"/></button>
<button class="button notifications _button" @click="$router.push('/my/notifications')"><Fa :icon="faBell"/><i v-if="$i.hasUnreadNotification"><Fa :icon="faCircle"/></i></button>
<button class="button widget _button" @click="widgetsShowing = true"><Fa :icon="faLayerGroup"/></button>
<button class="button post _button" @click="post"><Fa :icon="faPencilAlt"/></button>
</div>
<button class="widgetButton _button" :class="{ navHidden }" @click="widgetsShowing = true"><Fa :icon="faLayerGroup"/></button>
<transition name="tray-back">
<div class="tray-back _modalBg"
v-if="widgetsShowing"
@click="widgetsShowing = false"
@touchstart.passive="widgetsShowing = false"
></div>
</transition>
<transition name="tray">
<XWidgets v-if="widgetsShowing" class="tray"/>
</transition>
<XCommon/>
</div>
</template>
<script lang="ts">
import { defineComponent, defineAsyncComponent } from 'vue';
import { faLayerGroup, faBars, faHome, faCircle, faWindowMaximize, faColumns, faPencilAlt } from '@fortawesome/free-solid-svg-icons';
import { faBell } from '@fortawesome/free-regular-svg-icons';
import { instanceName } from '@client/config';
import { StickySidebar } from '@client/scripts/sticky-sidebar';
import XSidebar from '@client/ui/_common_/sidebar.vue';
import XCommon from './_common_/common.vue';
import XHeader from './_common_/header.vue';
import XSide from './default.side.vue';
import * as os from '@client/os';
import { sidebarDef } from '@client/sidebar';
const DESKTOP_THRESHOLD = 1100;
export default defineComponent({
components: {
XCommon,
XSidebar,
XHeader,
XWidgets: defineAsyncComponent(() => import('./universal.widgets.vue')),
XSide, // NOTE: dynamic importAsyncComponentWrapperref
},
provide() {
return {
sideViewHook: this.isDesktop ? (url) => {
this.$refs.side.navigate(url);
} : null
};
},
data() {
return {
pageInfo: null,
isDesktop: window.innerWidth >= DESKTOP_THRESHOLD,
menuDef: sidebarDef,
navHidden: false,
widgetsShowing: false,
wallpaper: localStorage.getItem('wallpaper') != null,
faLayerGroup, faBars, faBell, faHome, faCircle, faPencilAlt,
};
},
computed: {
navIndicated(): boolean {
for (const def in this.menuDef) {
if (def === 'notifications') continue; //
if (this.menuDef[def].indicated) return true;
}
return false;
}
},
created() {
document.documentElement.style.overflowY = 'scroll';
if (this.$store.state.widgets.length === 0) {
this.$store.set('widgets', [{
name: 'calendar',
id: 'a', place: 'right', data: {}
}, {
name: 'notifications',
id: 'b', place: 'right', data: {}
}, {
name: 'trends',
id: 'c', place: 'right', data: {}
}]);
}
},
mounted() {
this.adjustUI();
const ro = new ResizeObserver((entries, observer) => {
this.adjustUI();
});
ro.observe(this.$refs.contents);
window.addEventListener('resize', this.adjustUI, { passive: true });
if (!this.isDesktop) {
window.addEventListener('resize', () => {
if (window.innerWidth >= DESKTOP_THRESHOLD) this.isDesktop = true;
}, { passive: true });
}
},
methods: {
changePage(page) {
if (page == null) return;
if (page.INFO) {
this.pageInfo = page.INFO;
document.title = `${this.pageInfo.title} | ${instanceName}`;
}
},
adjustUI() {
const navWidth = this.$refs.nav.$el.offsetWidth;
this.navHidden = navWidth === 0;
if (this.$refs.contents == null) return;
const width = this.$refs.contents.offsetWidth;
if (this.$refs.header) this.$refs.header.style.width = `${width}px`;
},
showNav() {
this.$refs.nav.show();
},
attachSticky(el) {
const sticky = new StickySidebar(this.$refs.widgets);
window.addEventListener('scroll', () => {
sticky.calc(window.scrollY);
}, { passive: true });
},
post() {
os.post();
},
top() {
window.scroll({ top: 0, behavior: 'smooth' });
},
onTransition() {
if (window._scroll) window._scroll();
},
onHeaderClick() {
window.scroll({ top: 0, behavior: 'smooth' });
},
onContextmenu(e) {
const isLink = (el: HTMLElement) => {
if (el.tagName === 'A') return true;
if (el.parentElement) {
return isLink(el.parentElement);
}
};
if (isLink(e.target)) return;
if (['INPUT', 'TEXTAREA'].includes(e.target.tagName) || e.target.attributes['contenteditable']) return;
if (window.getSelection().toString() !== '') return;
const path = this.$route.path;
os.contextMenu([{
type: 'label',
text: path,
}, {
icon: faColumns,
text: this.$ts.openInSideView,
action: () => {
this.$refs.side.navigate(path);
}
}, {
icon: faWindowMaximize,
text: this.$ts.openInWindow,
action: () => {
os.pageWindow(path);
}
}], e);
},
}
});
</script>
<style lang="scss" scoped>
.tray-enter-active,
.tray-leave-active {
opacity: 1;
transform: translateX(0);
transition: transform 300ms cubic-bezier(0.23, 1, 0.32, 1), opacity 300ms cubic-bezier(0.23, 1, 0.32, 1);
}
.tray-enter-from,
.tray-leave-active {
opacity: 0;
transform: translateX(240px);
}
.tray-back-enter-active,
.tray-back-leave-active {
opacity: 1;
transition: opacity 300ms cubic-bezier(0.23, 1, 0.32, 1);
}
.tray-back-enter-from,
.tray-back-leave-active {
opacity: 0;
}
.mk-app {
$header-height: 58px; // TODO:
$ui-font-size: 1em; // TODO:
$widgets-hide-threshold: 1090px;
// 100vh ... https://css-tricks.com/the-trick-to-viewport-units-on-mobile/
min-height: calc(var(--vh, 1vh) * 100);
box-sizing: border-box;
display: flex;
&.wallpaper {
background: var(--wallpaperOverlay);
//backdrop-filter: blur(4px);
}
> .contents {
width: 100%;
min-width: 0;
&.withHeader {
padding-top: $header-height;
}
> .header {
position: fixed;
z-index: 1000;
top: 0;
height: $header-height;
width: 100%;
line-height: $header-height;
text-align: center;
font-weight: bold;
//background-color: var(--panel);
-webkit-backdrop-filter: blur(32px);
backdrop-filter: blur(32px);
background-color: var(--header);
//border-bottom: solid 0.5px var(--divider);
user-select: none;
}
> main {
min-width: 0;
> .content {
> * {
// calc(100vh - #{$header-height}) ... https://css-tricks.com/the-trick-to-viewport-units-on-mobile/
min-height: calc((var(--vh, 1vh) * 100) - #{$header-height});
}
}
> .spacer {
height: 82px;
@media (min-width: ($widgets-hide-threshold + 1px)) {
display: none;
}
}
}
}
> .side {
min-width: 370px;
max-width: 370px;
border-left: solid 0.5px var(--divider);
}
> .widgets {
padding: 0 var(--margin);
border-left: solid 0.5px var(--divider);
@media (max-width: $widgets-hide-threshold) {
display: none;
}
}
> .widgetButton {
display: block;
position: fixed;
z-index: 1000;
bottom: 32px;
right: 32px;
width: 64px;
height: 64px;
border-radius: 100%;
box-shadow: 0 3px 5px -1px rgba(0, 0, 0, 0.2), 0 6px 10px 0 rgba(0, 0, 0, 0.14), 0 1px 18px 0 rgba(0, 0, 0, 0.12);
font-size: 22px;
background: var(--panel);
&.navHidden {
display: none;
}
@media (min-width: ($widgets-hide-threshold + 1px)) {
display: none;
}
}
> .buttons {
position: fixed;
z-index: 1000;
bottom: 0;
padding: 16px;
display: flex;
width: 100%;
box-sizing: border-box;
-webkit-backdrop-filter: blur(32px);
backdrop-filter: blur(32px);
background-color: var(--header);
&:not(.navHidden) {
display: none;
}
> .button {
position: relative;
flex: 1;
padding: 0;
margin: auto;
height: 64px;
border-radius: 8px;
background: var(--panel);
color: var(--fg);
&:not(:last-child) {
margin-right: 12px;
}
@media (max-width: 400px) {
height: 60px;
&:not(:last-child) {
margin-right: 8px;
}
}
&:hover {
background: var(--X2);
}
> i {
position: absolute;
top: 0;
left: 0;
color: var(--indicator);
font-size: 16px;
animation: blink 1s infinite;
}
&:first-child {
margin-left: 0;
}
&:last-child {
margin-right: 0;
}
> * {
font-size: 22px;
}
&:disabled {
cursor: default;
> * {
opacity: 0.5;
}
}
}
}
> .tray-back {
z-index: 1001;
}
> .tray {
position: fixed;
top: 0;
right: 0;
z-index: 1001;
// 100vh ... https://css-tricks.com/the-trick-to-viewport-units-on-mobile/
height: calc(var(--vh, 1vh) * 100);
padding: var(--margin);
box-sizing: border-box;
overflow: auto;
background: var(--bg);
}
}
</style>
<style lang="scss">
</style>

View file

@ -0,0 +1,81 @@
<template>
<div class="efzpzdvf">
<XWidgets :edit="editMode" :widgets="$store.reactiveState.widgets.value" @add-widget="addWidget" @remove-widget="removeWidget" @update-widget="updateWidget" @update-widgets="updateWidgets" @exit="editMode = false"/>
<button v-if="editMode" @click="editMode = false" class="_textButton" style="font-size: 0.9em;"><Fa :icon="faCheck"/> {{ $ts.editWidgetsExit }}</button>
<button v-else @click="editMode = true" class="_textButton" style="font-size: 0.9em;"><Fa :icon="faPencilAlt"/> {{ $ts.editWidgets }}</button>
</div>
</template>
<script lang="ts">
import { defineComponent, defineAsyncComponent } from 'vue';
import { faPencilAlt, faPlus, faBars, faTimes, faCheck } from '@fortawesome/free-solid-svg-icons';
import XWidgets from '@client/components/widgets.vue';
import * as os from '@client/os';
export default defineComponent({
components: {
XWidgets
},
emits: ['mounted'],
data() {
return {
editMode: false,
faPencilAlt, faPlus, faBars, faTimes, faCheck,
};
},
mounted() {
this.$emit('mounted', this.$el);
},
methods: {
addWidget(widget) {
this.$store.set('widgets', [{
...widget,
place: null,
}, ...this.$store.state.widgets]);
},
removeWidget(widget) {
this.$store.set('widgets', this.$store.state.widgets.filter(w => w.id != widget.id));
},
updateWidget({ id, data }) {
this.$store.set('widgets', this.$store.state.widgets.map(w => w.id === id ? {
...w,
data: data
} : w));
},
updateWidgets(widgets) {
this.$store.set('widgets', widgets);
}
}
});
</script>
<style lang="scss" scoped>
.efzpzdvf {
position: sticky;
height: min-content;
min-height: 100vh;
padding: var(--margin) 0;
box-sizing: border-box;
> * {
margin: var(--margin) 0;
width: 300px;
&:first-child {
margin-top: 0;
}
}
> .add {
margin: 0 auto;
}
}
</style>

View file

@ -94,7 +94,7 @@ export default defineComponent({
-webkit-backdrop-filter: blur(32px); -webkit-backdrop-filter: blur(32px);
backdrop-filter: blur(32px); backdrop-filter: blur(32px);
background-color: var(--header); background-color: var(--header);
border-bottom: solid 1px var(--divider); border-bottom: solid 0.5px var(--divider);
} }
> main { > main {

View file

@ -122,7 +122,7 @@ export default defineComponent({
color: var(--fg); color: var(--fg);
background: transparent; background: transparent;
border: none; border: none;
border-bottom: solid 1px var(--divider); border-bottom: solid 0.5px var(--divider);
border-radius: 0; border-radius: 0;
box-sizing: border-box; box-sizing: border-box;
font: inherit; font: inherit;
@ -147,7 +147,7 @@ export default defineComponent({
} }
> .logs { > .logs {
border-top: solid 1px var(--divider); border-top: solid 0.5px var(--divider);
text-align: left; text-align: left;
padding: 16px; padding: 16px;

View file

@ -100,7 +100,7 @@ export default defineComponent({
display: flex; display: flex;
align-items: center; align-items: center;
padding: 14px 16px; padding: 14px 16px;
border-bottom: solid 1px var(--divider); border-bottom: solid 0.5px var(--divider);
> img { > img {
display: block; display: block;

View file

@ -136,7 +136,7 @@ export default defineComponent({
padding: 16px; padding: 16px;
&:not(:first-child) { &:not(:first-child) {
border-top: solid 1px var(--divider); border-top: solid 0.5px var(--divider);
} }
> .label { > .label {

View file

@ -77,7 +77,7 @@ export default defineComponent({
color: var(--fg); color: var(--fg);
background: transparent; background: transparent;
border: none; border: none;
border-bottom: solid 1px var(--divider); border-bottom: solid 0.5px var(--divider);
border-radius: 0; border-radius: 0;
box-sizing: border-box; box-sizing: border-box;
font: inherit; font: inherit;

View file

@ -79,7 +79,7 @@ export default defineComponent({
display: flex; display: flex;
align-items: center; align-items: center;
padding: 14px 16px; padding: 14px 16px;
border-bottom: solid 1px var(--divider); border-bottom: solid 0.5px var(--divider);
> .tag { > .tag {
flex: 1; flex: 1;