Fix style of messaging form, use css module (#9602)

* Fix style of messaging form, use css module

* clean up
This commit is contained in:
tamaina 2023-01-16 02:37:45 +09:00 committed by GitHub
parent 91a3c3943d
commit 678c7d9502
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 123 additions and 123 deletions

View File

@ -1,10 +1,12 @@
<template>
<div
class="pemppnzi"
:class="$style['root']"
@dragover.stop="onDragover"
@drop.stop="onDrop"
>
<textarea
:class="$style['textarea']"
class="_acrylic"
ref="textEl"
v-model="text"
:placeholder="i18n.ts.inputMessageHere"
@ -12,17 +14,17 @@
@compositionupdate="onCompositionUpdate"
@paste="onPaste"
></textarea>
<footer>
<div v-if="file" class="file" @click="file = null">{{ file.name }}</div>
<div class="buttons">
<button class="_button" @click="chooseFile"><i class="ti ti-photo-plus"></i></button>
<button class="_button" @click="insertEmoji"><i class="ti ti-mood-happy"></i></button>
<button class="send _button" :disabled="!canSend || sending" :title="i18n.ts.send" @click="send">
<footer :class="$style['footer']">
<div v-if="file" :class="$style['file']" @click="file = null">{{ file.name }}</div>
<div :class="$style['buttons']">
<button class="_button" :class="$style['button']" @click="chooseFile"><i class="ti ti-photo-plus"></i></button>
<button class="_button" :class="$style['button']" @click="insertEmoji"><i class="ti ti-mood-happy"></i></button>
<button class="_button" :class="[$style['button'], $style['send']]" :disabled="!canSend || sending" :title="i18n.ts.send" @click="send">
<template v-if="!sending"><i class="ti ti-send"></i></template><template v-if="sending"><MkLoading :em="true"/></template>
</button>
</div>
</footer>
<input ref="fileEl" type="file" @change="onChangeFile"/>
<input :class="$style['file-input']" ref="fileEl" type="file" @change="onChangeFile"/>
</div>
</template>
@ -236,11 +238,12 @@ defineExpose({
});
</script>
<style lang="scss" scoped>
.pemppnzi {
<style lang="scss" module>
.root {
position: relative;
}
> textarea {
.textarea {
cursor: auto;
display: block;
width: 100%;
@ -258,23 +261,21 @@ defineExpose({
box-shadow: none;
box-sizing: border-box;
color: var(--fg);
background: rgba(12, 18, 16, 0.85);
backdrop-filter: var(--blur, blur(15px));
}
footer {
.footer {
position: sticky;
bottom: 0;
background: var(--panel);
}
> .file {
.file {
padding: 8px;
color: var(--fg);
background: transparent;
cursor: pointer;
}
}
/*
.files {
display: block;
margin: 0;
@ -305,8 +306,10 @@ defineExpose({
display: block;
}
}
}
}
> .remove {
.file-remove {
display: none;
position: absolute;
right: -6px;
@ -320,13 +323,13 @@ defineExpose({
box-shadow: none;
cursor: pointer;
}
}
}
*/
.buttons {
display: flex;
}
._button {
.button {
margin: 0;
padding: 16px;
font-size: 1em;
@ -343,8 +346,7 @@ defineExpose({
transition: color 0s ease;
}
}
> .send {
.send {
margin-left: auto;
color: var(--accent);
@ -357,10 +359,8 @@ defineExpose({
transition: color 0s ease;
}
}
}
input[type=file] {
.file-input {
display: none;
}
}
</style>