input
This commit is contained in:
parent
e593bc343e
commit
725753b7b3
8 changed files with 79 additions and 35 deletions
|
|
@ -53,12 +53,17 @@
|
||||||
border: none;
|
border: none;
|
||||||
outline: none;
|
outline: none;
|
||||||
|
|
||||||
|
z-index: 1;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.menu {
|
.menu {
|
||||||
position: fixed;
|
position: fixed;
|
||||||
margin-left: 20px;
|
margin-left: 20px;
|
||||||
margin-top: 20px;
|
margin-top: 20px;
|
||||||
|
|
||||||
|
z-index: 2;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.menuButton {
|
.menuButton {
|
||||||
|
|
|
||||||
14
src/assets/crimata.svg
Normal file
14
src/assets/crimata.svg
Normal file
|
|
@ -0,0 +1,14 @@
|
||||||
|
<svg xmlns="http://www.w3.org/2000/svg" width="13.795" height="12.759" viewBox="0 0 13.795 12.759">
|
||||||
|
<g id="Group_544" data-name="Group 544" transform="translate(-4127 -507)">
|
||||||
|
<g id="Group_33" data-name="Group 33" transform="translate(4127 507)">
|
||||||
|
<g id="Group_32" data-name="Group 32" transform="translate(0 0)">
|
||||||
|
<g id="Group_31" data-name="Group 31" transform="translate(0 6.627)">
|
||||||
|
<circle id="Ellipse_50" data-name="Ellipse 50" cx="3.066" cy="3.066" r="3.066" transform="translate(0 0)" fill="#383838"/>
|
||||||
|
<circle id="Ellipse_51" data-name="Ellipse 51" cx="3.066" cy="3.066" r="3.066" transform="translate(7.664 0)" fill="#383838"/>
|
||||||
|
</g>
|
||||||
|
<circle id="Ellipse_52" data-name="Ellipse 52" cx="3.066" cy="3.066" r="3.066" transform="translate(3.826 0)" fill="#383838"/>
|
||||||
|
<path id="Path_150" data-name="Path 150" d="M36.27,83.67" transform="translate(-33.199 -73.977)" fill="#ff0"/>
|
||||||
|
</g>
|
||||||
|
</g>
|
||||||
|
</g>
|
||||||
|
</svg>
|
||||||
|
After Width: | Height: | Size: 973 B |
|
|
@ -6,6 +6,7 @@ import { ipcMain } from "electron";
|
||||||
|
|
||||||
interface RenderMessage {
|
interface RenderMessage {
|
||||||
content: string;
|
content: string;
|
||||||
|
avatar: string;
|
||||||
context: string;
|
context: string;
|
||||||
subContext: string;
|
subContext: string;
|
||||||
modifier: string;
|
modifier: string;
|
||||||
|
|
|
||||||
|
|
@ -9,9 +9,7 @@
|
||||||
|
|
||||||
<TextInput
|
<TextInput
|
||||||
v-else
|
v-else
|
||||||
:input="input"
|
:input="input"
|
||||||
:textXoffset="textInputXoffset"
|
|
||||||
:textYoffset="textInputYoffset"
|
|
||||||
/>
|
/>
|
||||||
|
|
||||||
</template>
|
</template>
|
||||||
|
|
@ -40,19 +38,12 @@ export default defineComponent({
|
||||||
const {
|
const {
|
||||||
input,
|
input,
|
||||||
visualizeStream,
|
visualizeStream,
|
||||||
|
|
||||||
textInputXoffset,
|
|
||||||
textInputYoffset,
|
|
||||||
|
|
||||||
audioBubbleWidth,
|
audioBubbleWidth,
|
||||||
paths,
|
paths,
|
||||||
} = useInputController();
|
} = useInputController();
|
||||||
|
|
||||||
return {
|
return {
|
||||||
input,
|
input,
|
||||||
|
|
||||||
textInputXoffset,
|
|
||||||
textInputYoffset,
|
|
||||||
|
|
||||||
visualizeStream,
|
visualizeStream,
|
||||||
audioBubbleWidth,
|
audioBubbleWidth,
|
||||||
|
|
|
||||||
|
|
@ -96,8 +96,6 @@ export default function useInputController() {
|
||||||
return {
|
return {
|
||||||
input,
|
input,
|
||||||
visualizeStream,
|
visualizeStream,
|
||||||
textInputXoffset,
|
|
||||||
textInputYoffset,
|
|
||||||
audioBubbleWidth,
|
audioBubbleWidth,
|
||||||
paths
|
paths
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,20 +1,11 @@
|
||||||
<template>
|
<template>
|
||||||
|
|
||||||
<foreignObject
|
<div class="inputBox">
|
||||||
class="inputContainer"
|
|
||||||
:x="textXoffset"
|
|
||||||
:y="textYoffset"
|
|
||||||
width="55%"
|
|
||||||
height="50%"
|
|
||||||
>
|
|
||||||
<div xmlns="http://www.w3.org/1999/xhtml">
|
|
||||||
<div class="inputBubble" v-show="input.length > 0">
|
<div class="inputBubble" v-show="input.length > 0">
|
||||||
<p>{{ input }}</p>
|
<p>{{ input }}</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</foreignObject>
|
|
||||||
|
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
|
|
@ -26,17 +17,28 @@ export default defineComponent({
|
||||||
name: "TextInput",
|
name: "TextInput",
|
||||||
props: {
|
props: {
|
||||||
input: String,
|
input: String,
|
||||||
textXoffset: String,
|
|
||||||
textYoffset: String,
|
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
.inputBubble {
|
|
||||||
|
.inputBox {
|
||||||
position: fixed;
|
position: fixed;
|
||||||
|
|
||||||
|
width: 100vw;
|
||||||
|
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
|
||||||
|
bottom: 0;
|
||||||
|
|
||||||
|
z-index: 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
.inputBubble {
|
||||||
max-width: 180px;
|
max-width: 180px;
|
||||||
min-height: 32px;
|
min-height: 32px;
|
||||||
|
|
||||||
|
|
@ -48,14 +50,15 @@ export default defineComponent({
|
||||||
|
|
||||||
font-size: 14px;
|
font-size: 14px;
|
||||||
|
|
||||||
bottom: 20px;
|
|
||||||
margin-left: 50%;
|
|
||||||
|
|
||||||
p {
|
p {
|
||||||
max-width: 150px;
|
max-width: 150px;
|
||||||
overflow-wrap: break-word;
|
overflow-wrap: break-word;
|
||||||
padding: 7px 10px 5px 10px;
|
padding: 7px 10px 5px 10px;
|
||||||
margin: 0;
|
margin: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
margin-bottom: 20px;
|
||||||
|
|
||||||
|
z-index: 1;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
export interface Message {
|
export interface Message {
|
||||||
content: string;
|
content: string;
|
||||||
|
avatar: string;
|
||||||
context: string;
|
context: string;
|
||||||
subContext: string;
|
subContext: string;
|
||||||
modifier: string;
|
modifier: string;
|
||||||
|
|
@ -14,5 +15,4 @@ interface MessageTransform {
|
||||||
|
|
||||||
export interface MessageAnimeFunc {
|
export interface MessageAnimeFunc {
|
||||||
(message: SVGElement, transform: MessageTransform, scrollHeight?: number | undefined, targetList?: NodeList | undefined): void;
|
(message: SVGElement, transform: MessageTransform, scrollHeight?: number | undefined, targetList?: NodeList | undefined): void;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -24,9 +24,20 @@
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- message context -->
|
<!-- message context -->
|
||||||
<div class="context">
|
<span class="context">
|
||||||
|
|
||||||
|
<!-- Render Crimata icon or initials. -->
|
||||||
|
<div v-if="message.avatar == 'crimata'" class="photo">
|
||||||
|
<img src="@/assets/crimata.svg"/>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div v-else class="photo">
|
||||||
|
{{ message.avatar }}
|
||||||
|
</div>
|
||||||
|
|
||||||
{{ message.context }}
|
{{ message.context }}
|
||||||
</div>
|
|
||||||
|
</span>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
@ -59,7 +70,7 @@ export default defineComponent({
|
||||||
// Render a message.
|
// Render a message.
|
||||||
const render = (message: Message) => {
|
const render = (message: Message) => {
|
||||||
messages.push(message)
|
messages.push(message)
|
||||||
console.log(`Pushing: ${message.modifier}: ${message.content}`)
|
console.log(`Pushing: ${message.modifier}: ${message.avatar}, ${message.content}`)
|
||||||
}
|
}
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
|
|
@ -93,10 +104,12 @@ export default defineComponent({
|
||||||
|
|
||||||
background-color: #EBEBEB;
|
background-color: #EBEBEB;
|
||||||
|
|
||||||
top: 0;
|
|
||||||
bottom: 0;
|
bottom: 0;
|
||||||
|
|
||||||
z-index: -1px;
|
}
|
||||||
|
|
||||||
|
#messenger::-webkit-scrollbar {
|
||||||
|
display: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
.message {
|
.message {
|
||||||
|
|
@ -158,6 +171,9 @@ export default defineComponent({
|
||||||
}
|
}
|
||||||
|
|
||||||
.context {
|
.context {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
|
||||||
font-family: "SF Compact Display";
|
font-family: "SF Compact Display";
|
||||||
font-size: 12px;
|
font-size: 12px;
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
|
|
@ -165,6 +181,22 @@ export default defineComponent({
|
||||||
margin-top: 5px;
|
margin-top: 5px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.photo {
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
|
||||||
|
margin-right: 5px;
|
||||||
|
|
||||||
|
width: 30px;
|
||||||
|
height: 30px;
|
||||||
|
|
||||||
|
font-size: 14px;
|
||||||
|
|
||||||
|
background-color: white;
|
||||||
|
border-radius: 15px;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</style>
|
</style>
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue