Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
syuilo committed Aug 9, 2021
2 parents c52e30e + fa49427 commit df530bb
Show file tree
Hide file tree
Showing 16 changed files with 82 additions and 162 deletions.
157 changes: 16 additions & 141 deletions src/client/components/emoji-picker-dialog.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<template>
<MkPopup ref="popup" :manual-showing="manualShowing" :src="src" :front="true" @click="$refs.popup.close()" @opening="opening" @close="$emit('close')" @closed="$emit('closed')">
<MkEmojiPicker class="_shadow" :show-pinned="showPinned" :as-reaction-picker="asReactionPicker" @chosen="chosen" ref="picker"/>
<MkPopup ref="popup" :manual-showing="manualShowing" :src="src" :front="true" @click="$refs.popup.close()" @opening="opening" @close="$emit('close')" @closed="$emit('closed')" #default="{point}">
<MkEmojiPicker class="ryghynhb _popup _shadow" :class="{ pointer: point === 'top' }" :show-pinned="showPinned" :as-reaction-picker="asReactionPicker" @chosen="chosen" ref="picker"/>
</MkPopup>
</template>

Expand Down Expand Up @@ -56,145 +56,20 @@ export default defineComponent({
</script>

<style lang="scss" scoped>
.omfetrab {
$pad: 8px;
--eachSize: 40px;
display: flex;
flex-direction: column;
contain: content;
&.big {
--eachSize: 44px;
}
&.w1 {
width: calc((var(--eachSize) * 5) + (#{$pad} * 2));
}
&.w2 {
width: calc((var(--eachSize) * 6) + (#{$pad} * 2));
}
&.w3 {
width: calc((var(--eachSize) * 7) + (#{$pad} * 2));
}
&.h1 {
--height: calc((var(--eachSize) * 4) + (#{$pad} * 2));
}
&.h2 {
--height: calc((var(--eachSize) * 6) + (#{$pad} * 2));
}
&.h3 {
--height: calc((var(--eachSize) * 8) + (#{$pad} * 2));
}
> .search {
width: 100%;
padding: 12px;
box-sizing: border-box;
font-size: 1em;
outline: none;
border: none;
background: transparent;
color: var(--fg);
&:not(.filled) {
order: 1;
z-index: 2;
box-shadow: 0px -1px 0 0px var(--divider);
}
}
> .emojis {
height: var(--height);
overflow-y: auto;
overflow-x: hidden;
scrollbar-width: none;
&::-webkit-scrollbar {
display: none;
}
> .index {
min-height: var(--height);
position: relative;
border-bottom: solid 0.5px var(--divider);
> .arrow {
position: absolute;
bottom: 0;
left: 0;
width: 100%;
padding: 16px 0;
text-align: center;
opacity: 0.5;
pointer-events: none;
}
}
section {
> header {
position: sticky;
top: 0;
left: 0;
z-index: 1;
padding: 8px;
font-size: 12px;
}
> div {
padding: $pad;
> button {
position: relative;
padding: 0;
width: var(--eachSize);
height: var(--eachSize);
border-radius: 4px;
&:focus {
outline: solid 2px var(--focus);
z-index: 1;
}
&:hover {
background: rgba(0, 0, 0, 0.05);
}
&:active {
background: var(--accent);
box-shadow: inset 0 0.15em 0.3em rgba(27, 31, 35, 0.15);
}
> * {
font-size: 24px;
height: 1.25em;
vertical-align: -.25em;
pointer-events: none;
}
}
}
&.result {
border-bottom: solid 0.5px var(--divider);
&:empty {
display: none;
}
}
&.unicode {
min-height: 384px;
}
&.custom {
min-height: 64px;
}
.ryghynhb {
&.pointer {
&:before {
--size: 8px;
content: '';
display: block;
position: absolute;
top: calc(0px - (var(--size) * 2));
left: 0;
right: 0;
width: 0;
margin: auto;
border: solid var(--size) transparent;
border-bottom-color: var(--popup);
}
}
}
Expand Down
3 changes: 1 addition & 2 deletions src/client/components/emoji-picker.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<template>
<div class="omfetrab _popup" :class="['w' + width, 'h' + height, { big }]">
<div class="omfetrab" :class="['w' + width, 'h' + height, { big }]">
<input ref="search" class="search" data-prevent-emoji-insert :class="{ filled: q != null && q != '' }" v-model.trim="q" :placeholder="$ts.search" @paste.stop="paste" @keyup.enter="done()">
<div class="emojis" ref="emojis">
<section class="result">
Expand Down Expand Up @@ -346,7 +346,6 @@ export default defineComponent({
display: flex;
flex-direction: column;
contain: content;
&.big {
--eachSize: 44px;
Expand Down
2 changes: 1 addition & 1 deletion src/client/components/modal-page-window.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<template>
<MkModal ref="modal" @click="$emit('click')" @closed="$emit('closed')">
<div class="hrmcaedk _popup _narrow_" :style="{ width: `${width}px`, height: (height ? `min(${height}px, 100%)` : '100%') }">
<div class="hrmcaedk _window _narrow_" :style="{ width: `${width}px`, height: (height ? `min(${height}px, 100%)` : '100%') }">
<div class="header" @contextmenu="onContextmenu">
<span class="title">
<XHeader :info="pageInfo" :back-button="history.length > 0" @back="back()" :close-button="true" @close="$refs.modal.close()"/>
Expand Down
3 changes: 1 addition & 2 deletions src/client/components/poll-editor.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@
</p>
<ul ref="choices">
<li v-for="(choice, i) in choices" :key="i">
<MkInput class="input" :model-value="choice" @update:modelValue="onInput(i, $event)">
<template #label>{{ $t('_poll.choiceN', { n: i + 1 }) }}</template>
<MkInput class="input" :model-value="choice" @update:modelValue="onInput(i, $event)" :placeholder="$t('_poll.choiceN', { n: i + 1 })">
</MkInput>
<button @click="remove(i)" class="_button">
<i class="fas fa-times"></i>
Expand Down
2 changes: 1 addition & 1 deletion src/client/components/reactions-viewer.reaction.vue
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ export default defineComponent({
}
> span {
color: #fff;
color: var(--fgOnAccent);
}
}
Expand Down
1 change: 1 addition & 0 deletions src/client/components/ui/button.vue
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@ export default defineComponent({
border-radius: 999px;
overflow: hidden;
box-sizing: border-box;
transition: background 0.1s ease;
&:not(:disabled):hover {
background: var(--buttonHoverBg);
Expand Down
24 changes: 22 additions & 2 deletions src/client/components/ui/menu.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<template>
<div class="rrevdjwt" :class="{ left: align === 'left' }"
<div class="rrevdjwt" :class="{ left: align === 'left', pointer: point === 'top' }"
ref="items"
@contextmenu.self="e => e.preventDefault()"
v-hotkey="keymap"
Expand Down Expand Up @@ -58,7 +58,11 @@ export default defineComponent({
align: {
type: String,
requried: false
}
},
point: {
type: String,
requried: false
},
},
emits: ['close'],
data() {
Expand Down Expand Up @@ -137,6 +141,22 @@ export default defineComponent({
.rrevdjwt {
padding: 8px 0;
&.pointer {
&:before {
--size: 8px;
content: '';
display: block;
position: absolute;
top: calc(0px - (var(--size) * 2));
left: 0;
right: 0;
width: 0;
margin: auto;
border: solid var(--size) transparent;
border-bottom-color: var(--popup);
}
}
&.left {
> .item {
text-align: left;
Expand Down
2 changes: 1 addition & 1 deletion src/client/components/ui/modal-window.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<template>
<MkModal ref="modal" @click="$emit('click')" @closed="$emit('closed')">
<div class="ebkgoccj _popup _narrow_" @keydown="onKeydown" :style="{ width: `${width}px`, height: scroll ? (height ? `${height}px` : null) : (height ? `min(${height}px, 100%)` : '100%') }">
<div class="ebkgoccj _window _narrow_" @keydown="onKeydown" :style="{ width: `${width}px`, height: scroll ? (height ? `${height}px` : null) : (height ? `min(${height}px, 100%)` : '100%') }">
<div class="header">
<button class="_button" v-if="withOkButton" @click="$emit('close')"><i class="fas fa-times"></i></button>
<span class="title">
Expand Down
4 changes: 2 additions & 2 deletions src/client/components/ui/popup-menu.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<template>
<MkPopup ref="popup" :src="src" @closed="$emit('closed')">
<MkMenu :items="items" :align="align" @close="$refs.popup.close()" class="_popup _shadow"/>
<MkPopup ref="popup" :src="src" @closed="$emit('closed')" #default="{point}">
<MkMenu :items="items" :align="align" :point="point" @close="$refs.popup.close()" class="_popup _shadow"/>
</MkPopup>
</template>

Expand Down
5 changes: 4 additions & 1 deletion src/client/components/ui/popup.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<template>
<transition :name="$store.state.animation ? 'popup-menu' : ''" :duration="$store.state.animation ? 300 : 0" appear @after-leave="onClosed" @enter="$emit('opening')" @after-enter="childRendered">
<div v-show="manualShowing != null ? manualShowing : showing" class="ccczpooj" :class="{ front, fixed, top: position === 'top' }" ref="content" :style="{ pointerEvents: (manualShowing != null ? manualShowing : showing) ? 'auto' : 'none', '--transformOrigin': transformOrigin }">
<slot></slot>
<slot :point="point"></slot>
</div>
</transition>
</template>
Expand Down Expand Up @@ -52,6 +52,7 @@ export default defineComponent({
fixed: false,
transformOrigin: 'center',
contentClicking: false,
point: null,
};
},
Expand Down Expand Up @@ -135,8 +136,10 @@ export default defineComponent({
}
if (top > rect.top + (this.fixed ? 0 : window.pageYOffset)) {
this.point = 'top';
this.transformOrigin = 'center top';
} else {
this.point = null;
this.transformOrigin = 'center';
}
Expand Down
3 changes: 2 additions & 1 deletion src/client/components/ui/window.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<template>
<transition :name="$store.state.animation ? 'window' : ''" appear @after-leave="$emit('closed')">
<div class="ebkgocck" :class="{ front }" v-if="showing">
<div class="body _popup _shadow _narrow_" @mousedown="onBodyMousedown" @keydown="onKeydown">
<div class="body _window _shadow _narrow_" @mousedown="onBodyMousedown" @keydown="onKeydown">
<div class="header" :class="{ mini }" @contextmenu.prevent.stop="onContextmenu">
<button v-if="closeButton" class="_button" @click="close()"><i class="fas fa-times"></i></button>

Expand Down Expand Up @@ -416,6 +416,7 @@ export default defineComponent({
flex-shrink: 0;
user-select: none;
height: var(--height);
border-bottom: solid 1px var(--divider);
> ::v-deep(button) {
height: var(--height);
Expand Down
2 changes: 1 addition & 1 deletion src/client/pages/doc.vue
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ export default defineComponent({
line-height: 1.5;
&.max-width_500px {
padding: 16px;
padding: 24px;
}
> .main {
Expand Down
2 changes: 1 addition & 1 deletion src/client/pages/federation.vue
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,7 @@ export default defineComponent({
> .footer {
display: flex;
align-items: center;
font-size: 0.9em;
> .status {
&.suspended {
Expand All @@ -249,7 +250,6 @@ export default defineComponent({
> .right {
margin-left: auto;
font-size: 0.9em;
> .latestStatus {
border: solid 1px var(--divider);
Expand Down
9 changes: 9 additions & 0 deletions src/client/pages/instance-info.vue
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
</FormKeyValueView>
</FormGroup>

<FormButton v-if="$i.isAdmin || $i.isModerator" @click="info" primary>{{ $ts.settings }}</FormButton>

<FormTextarea readonly :value="instance.description">
<span>{{ $ts.description }}</span>
</FormTextarea>
Expand Down Expand Up @@ -147,6 +149,7 @@ import * as os from '@client/os';
import number from '@client/filters/number';
import bytes from '@client/filters/bytes';
import * as symbols from '@client/symbols';
import MkInstanceInfo from '@client/pages/instance/instance.vue';
const chartLimit = 90;
const sum = (...arr) => arr.reduce((r, a) => r.map((b, i) => a[i] + b));
Expand Down Expand Up @@ -440,6 +443,12 @@ export default defineComponent({
}]
};
},
info() {
os.popup(MkInstanceInfo, {
instance: this.instance
}, {}, 'closed');
}
}
});
</script>
Expand Down
Loading

0 comments on commit df530bb

Please sign in to comment.