wip
This commit is contained in:
parent
280e74749f
commit
02701d852d
|
@ -1,5 +1,5 @@
|
||||||
<template>
|
<template>
|
||||||
<x-modal ref="modal" @closed="$emit('closed')" @click="onBgClick" :showing="showing">
|
<x-modal @closed="$emit('closed')" @click="onBgClick" :showing="showing">
|
||||||
<div class="mk-dialog" :class="{ iconOnly }">
|
<div class="mk-dialog" :class="{ iconOnly }">
|
||||||
<template v-if="type == 'signin'">
|
<template v-if="type == 'signin'">
|
||||||
<mk-signin/>
|
<mk-signin/>
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
<template>
|
<template>
|
||||||
<x-modal :source="source" :no-center="noCenter" ref="popup" @click="close()" @closed="$emit('closed')" :showing="showing">
|
<x-modal :source="source" :no-center="noCenter" @click="close()" @closed="$emit('closed')" :showing="showing">
|
||||||
<div class="rrevdjwt" :class="{ left: align === 'left' }" ref="items" :style="{ width: width + 'px' }">
|
<div class="rrevdjwt" :class="{ left: align === 'left' }" ref="items" :style="{ width: width + 'px' }">
|
||||||
<template v-for="(item, i) in items.filter(item => item !== undefined)">
|
<template v-for="(item, i) in items.filter(item => item !== undefined)">
|
||||||
<div v-if="item === null" class="divider" :key="i"></div>
|
<div v-if="item === null" class="divider" :key="i"></div>
|
||||||
|
|
|
@ -1,14 +1,6 @@
|
||||||
<template>
|
<template>
|
||||||
<div class="ulveipgl" :style="{ pointerEvents: closing ? 'none' : 'auto' }">
|
<x-modal @closed="$emit('closed')" @click="onBgClick" :showing="showing">
|
||||||
<transition :name="$store.state.device.animation ? 'form-fade' : ''" appear @after-leave="destroy">
|
<x-post-form ref="form" class="ulveipgl"
|
||||||
<div class="bg _modalBg" ref="bg" v-if="!closing" @click="close()"></div>
|
|
||||||
</transition>
|
|
||||||
<div class="main" ref="main" @click.self="close()" @keydown="onKeydown">
|
|
||||||
<transition :name="$store.state.device.animation ? 'form' : ''" appear
|
|
||||||
@after-leave="destroyDom"
|
|
||||||
>
|
|
||||||
<x-post-form ref="form"
|
|
||||||
v-if="!closing"
|
|
||||||
:reply="reply"
|
:reply="reply"
|
||||||
:renote="renote"
|
:renote="renote"
|
||||||
:mention="mention"
|
:mention="mention"
|
||||||
|
@ -18,28 +10,24 @@
|
||||||
:instant="instant"
|
:instant="instant"
|
||||||
@posted="onPosted"
|
@posted="onPosted"
|
||||||
@cancel="onCanceled"
|
@cancel="onCanceled"
|
||||||
style="border-radius: var(--radius);"
|
|
||||||
/>
|
/>
|
||||||
</transition>
|
</x-modal>
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { defineComponent } from 'vue';
|
import { defineComponent } from 'vue';
|
||||||
|
import XModal from './modal.vue';
|
||||||
import XPostForm from './post-form.vue';
|
import XPostForm from './post-form.vue';
|
||||||
import * as os from '@/os';
|
import * as os from '@/os';
|
||||||
|
|
||||||
export default defineComponent({
|
export default defineComponent({
|
||||||
components: {
|
components: {
|
||||||
XPostForm
|
XModal,
|
||||||
|
XPostForm,
|
||||||
},
|
},
|
||||||
|
|
||||||
props: {
|
props: {
|
||||||
destroy: {
|
showing: {
|
||||||
required: true
|
|
||||||
},
|
|
||||||
emit: {
|
|
||||||
required: true
|
required: true
|
||||||
},
|
},
|
||||||
reply: {
|
reply: {
|
||||||
|
@ -73,36 +61,24 @@ export default defineComponent({
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
closing: false
|
|
||||||
};
|
|
||||||
},
|
|
||||||
|
|
||||||
methods: {
|
methods: {
|
||||||
focus() {
|
focus() {
|
||||||
this.$refs.form.focus();
|
this.$refs.form.focus();
|
||||||
},
|
},
|
||||||
|
|
||||||
close() {
|
|
||||||
this.closing = true;
|
|
||||||
},
|
|
||||||
|
|
||||||
onPosted() {
|
onPosted() {
|
||||||
this.$emit('posted');
|
this.$emit('done', 'posted');
|
||||||
this.close();
|
|
||||||
},
|
},
|
||||||
|
|
||||||
onCanceled() {
|
onCanceled() {
|
||||||
this.$emit('cancel');
|
this.$emit('done', 'canceled');
|
||||||
this.close();
|
|
||||||
},
|
},
|
||||||
|
|
||||||
onKeydown(e) {
|
onKeydown(e) {
|
||||||
if (e.which === 27) { // Esc
|
if (e.which === 27) { // Esc
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
e.stopPropagation();
|
e.stopPropagation();
|
||||||
this.close();
|
this.$emit('done', 'canceled');
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
@ -110,48 +86,9 @@ export default defineComponent({
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
.form-enter-active, .form-leave-active {
|
|
||||||
transition: opacity 0.3s, transform 0.3s !important;
|
|
||||||
}
|
|
||||||
.form-enter-from, .form-leave-to {
|
|
||||||
opacity: 0;
|
|
||||||
transform: scale(0.9);
|
|
||||||
}
|
|
||||||
|
|
||||||
.form-fade-enter-active, .form-fade-leave-active {
|
|
||||||
transition: opacity 0.3s !important;
|
|
||||||
}
|
|
||||||
.form-fade-enter-from, .form-fade-leave-to {
|
|
||||||
opacity: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.ulveipgl {
|
.ulveipgl {
|
||||||
> .bg {
|
width: 100%;
|
||||||
z-index: 10000;
|
max-width: 500px;
|
||||||
}
|
border-radius: var(--radius);
|
||||||
|
|
||||||
> .main {
|
|
||||||
display: block;
|
|
||||||
position: fixed;
|
|
||||||
z-index: 10000;
|
|
||||||
top: 32px;
|
|
||||||
left: 0;
|
|
||||||
right: 0;
|
|
||||||
height: calc(100% - 64px);
|
|
||||||
width: 500px;
|
|
||||||
max-width: calc(100% - 16px);
|
|
||||||
overflow: auto;
|
|
||||||
margin: 0 auto 0 auto;
|
|
||||||
|
|
||||||
@media (max-width: 550px) {
|
|
||||||
top: 16px;
|
|
||||||
height: calc(100% - 32px);
|
|
||||||
}
|
|
||||||
|
|
||||||
@media (max-width: 520px) {
|
|
||||||
top: 8px;
|
|
||||||
height: calc(100% - 16px);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
|
@ -633,6 +633,7 @@ export default defineComponent({
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
.gafaadew {
|
.gafaadew {
|
||||||
|
position: relative;
|
||||||
background: var(--panel);
|
background: var(--panel);
|
||||||
|
|
||||||
> header {
|
> header {
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
<template>
|
<template>
|
||||||
<XModal :source="source" ref="popup" @closed="destroy" v-hotkey.global="keymap">
|
<XModal :source="source" @closed="$emit('closed')" :showing="showing" @click="close" v-hotkey.global="keymap">
|
||||||
<div class="rdfaahpb">
|
<div class="rdfaahpb">
|
||||||
<div class="buttons" ref="buttons" :class="{ showFocus }">
|
<div class="buttons" ref="buttons" :class="{ showFocus }">
|
||||||
<button class="_button" v-for="(reaction, i) in rs" :key="reaction" @click="react(reaction)" :tabindex="i + 1" :title="reaction" v-particle><x-reaction-icon :reaction="reaction"/></button>
|
<button class="_button" v-for="(reaction, i) in rs" :key="reaction" @click="react(reaction)" :tabindex="i + 1" :title="reaction" v-particle><x-reaction-icon :reaction="reaction"/></button>
|
||||||
|
@ -23,10 +23,7 @@ export default defineComponent({
|
||||||
},
|
},
|
||||||
|
|
||||||
props: {
|
props: {
|
||||||
destroy: {
|
showing: {
|
||||||
required: true
|
|
||||||
},
|
|
||||||
emit: {
|
|
||||||
required: true
|
required: true
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -88,11 +85,11 @@ export default defineComponent({
|
||||||
|
|
||||||
methods: {
|
methods: {
|
||||||
close() {
|
close() {
|
||||||
this.$refs.popup.close();
|
this.$emit('done');
|
||||||
},
|
},
|
||||||
|
|
||||||
react(reaction) {
|
react(reaction) {
|
||||||
this.$emit('chosen', reaction);
|
this.$emit('done', reaction);
|
||||||
},
|
},
|
||||||
|
|
||||||
reactText() {
|
reactText() {
|
||||||
|
@ -131,6 +128,10 @@ export default defineComponent({
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
.rdfaahpb {
|
.rdfaahpb {
|
||||||
|
background: var(--panel);
|
||||||
|
border-radius: 8px;
|
||||||
|
box-shadow: 0 3px 12px rgba(27, 31, 35, 0.15);
|
||||||
|
|
||||||
> .buttons {
|
> .buttons {
|
||||||
padding: 6px 6px 0 6px;
|
padding: 6px 6px 0 6px;
|
||||||
width: 212px;
|
width: 212px;
|
||||||
|
|
Loading…
Reference in New Issue