]> Repos - mime-chat/commitdiff
input css_messages
authorAndrew Gundersen <gundersena@xavier.edu>
Fri, 26 Feb 2021 21:37:02 +0000 (15:37 -0600)
committerAndrew Gundersen <gundersena@xavier.edu>
Fri, 26 Feb 2021 21:37:02 +0000 (15:37 -0600)
src/App.vue
src/assets/crimata.svg [new file with mode: 0644]
src/background/session.ts
src/components/taInput/index.vue
src/components/taInput/inputController.ts
src/components/taInput/textDetails/text.vue
src/types/message/index.ts
src/views/messenger.vue

index 99315a23e9d1aceb14c4bc4914386e5ff1fc1c76..222f4dbd8212377e45ec11aec0f963abcbf6f0c0 100644 (file)
     border: none;
     outline: none;
 
+    z-index: 1;
+
   }
 
   .menu {
     position: fixed;
     margin-left: 20px;
     margin-top: 20px;
+
+    z-index: 2;
+
   }
 
   .menuButton {
diff --git a/src/assets/crimata.svg b/src/assets/crimata.svg
new file mode 100644 (file)
index 0000000..8bb28dc
--- /dev/null
@@ -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>
index d2efc0befa1316336c28b9eea522ae96213ebcf4..71e91ee30389232201108d3da8eb069ab3be0853 100644 (file)
@@ -6,6 +6,7 @@ import { ipcMain } from "electron";
 
 interface RenderMessage {
     content: string;
+    avatar: string;
     context: string;
     subContext: string;
     modifier: string;
index b0f3a2877ac00c51609a6ebd8fdacf131133803b..f7218696f6fcf4e895ba083c7f4eb4c10f935221 100644 (file)
@@ -9,9 +9,7 @@
 
   <TextInput 
     v-else 
-    :input="input" 
-    :textXoffset="textInputXoffset"
-    :textYoffset="textInputYoffset"
+    :input="input"
   />
 
 </template>
@@ -40,19 +38,12 @@ export default defineComponent({
     const {
       input,
       visualizeStream,
-
-      textInputXoffset,
-      textInputYoffset,
-
       audioBubbleWidth,
       paths,
     } = useInputController();
 
     return {
       input,
-      
-      textInputXoffset,
-      textInputYoffset,
 
       visualizeStream,
       audioBubbleWidth,
index 1f79bb21ddf5d325e5f5924f2b5aa771969ed4a6..facbe1f1c421f68cea8f188a4e0316c4a8c941bf 100644 (file)
@@ -96,8 +96,6 @@ export default function useInputController() {
     return {
         input,
         visualizeStream,
-        textInputXoffset,
-        textInputYoffset,
         audioBubbleWidth,
         paths
     }
index dbede01c8a7f5b72f6d1341c2831fb7f6f0d824b..c32c6fff06ef60e5ac60c7b6100adcfe3a1ee0cb 100644 (file)
@@ -1,20 +1,11 @@
 <template>
 
-  <foreignObject 
-    class="inputContainer" 
-    :x="textXoffset" 
-    :y="textYoffset" 
-    width="55%" 
-    height="50%"
-  >
-    <div xmlns="http://www.w3.org/1999/xhtml">
+    <div class="inputBox">
       <div class="inputBubble" v-show="input.length > 0">
         <p>{{ input }}</p>
       </div>
     </div>
 
-  </foreignObject>
-
 </template>
 
 <script lang="ts">
@@ -26,17 +17,28 @@ export default defineComponent({
   name: "TextInput",
   props: {
     input: String,
-    textXoffset: String,
-    textYoffset: String,
   },
 });
 
 </script>
 
 <style lang="scss" scoped>
-.inputBubble {
+
+.inputBox {
   position: fixed;
 
+  width: 100vw;
+
+  display: flex;
+  justify-content: center;
+  align-items: center;
+
+  bottom: 0;
+
+  z-index: 1;
+}
+
+.inputBubble {
   max-width: 180px;
   min-height: 32px;
 
@@ -48,14 +50,15 @@ export default defineComponent({
 
   font-size: 14px;
 
-  bottom: 20px;
-  margin-left: 50%;
-
   p {
     max-width: 150px;
     overflow-wrap: break-word;
     padding: 7px 10px 5px 10px;
     margin: 0;
   }
+
+  margin-bottom: 20px;
+
+  z-index: 1;
 }
 </style>
index ec210aecb868de50a0823032c8798ce11dc272e6..1997303b238023f48444dc8290a700851773ffe2 100644 (file)
@@ -1,5 +1,6 @@
 export interface Message {
     content: string;
+    avatar: string;
     context: string;
     subContext: string;
     modifier: string;
@@ -14,5 +15,4 @@ interface MessageTransform {
 
 export interface MessageAnimeFunc {
     (message: SVGElement, transform: MessageTransform, scrollHeight?: number | undefined, targetList?: NodeList | undefined): void;
-}
-
+}
\ No newline at end of file
index fa1b03aafb295fb8d1ad8ab8634f89f3afb4633b..58f0094d17531d2e67927b1ff3078188c8d8d789 100644 (file)
           </div>
 
           <!-- 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 }}
-          </div>
+
+          </span>
 
         </div>
 
@@ -59,7 +70,7 @@ export default defineComponent({
     // Render a message.
     const render = (message: Message) => {
       messages.push(message)
-      console.log(`Pushing: ${message.modifier}: ${message.content}`)
+      console.log(`Pushing: ${message.modifier}: ${message.avatar}, ${message.content}`)
     }
 
     onMounted(() => {
@@ -93,10 +104,12 @@ export default defineComponent({
 
     background-color: #EBEBEB;
 
-    top: 0;
     bottom: 0;
 
-    z-index: -1px;
+  }
+
+  #messenger::-webkit-scrollbar {
+    display: none;
   }
 
   .message {
@@ -158,6 +171,9 @@ export default defineComponent({
   }
 
   .context {
+    display: flex;
+    align-items: center;
+
     font-family: "SF Compact Display";
     font-size: 12px;
     font-weight: bold;
@@ -165,6 +181,22 @@ export default defineComponent({
     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>