]> Repos - mime-chat/commitdiff
add text render to input item
authorriqo <hernandeze2@xavier.edu>
Sat, 6 Mar 2021 21:59:06 +0000 (15:59 -0600)
committerriqo <hernandeze2@xavier.edu>
Sat, 6 Mar 2021 21:59:06 +0000 (15:59 -0600)
src/components/inputItem.vue
src/components/taInput/index.vue
src/components/taInput/textDetails/text.vue
src/modules/keyDownHandler/useKeyDownHandler.ts

index 6a303c269d08101f9614847d206848f09894b0e1..5e32f98bece1c62e264d4e038cfd45c03fcbaf42 100644 (file)
@@ -5,24 +5,35 @@
     :style="{ top: `${elementY}px`, left: `${elementX}px` }">
     <span class="play"></span>
     <span class="pause"></span>
+    <TextInput :input="input"/>
   </div>
 </template>
 
 <script lang="ts">
 
-import { defineComponent, onMounted, onUnmounted, ref } from "vue";
+import { defineComponent, onMounted, onUnmounted, ref, watch } from "vue";
 import draggify from '@/modules/draggify';
 import useMitt from "@/modules/mitt";
+import TextInput from '@/components/taInput/textDetails/text.vue';
+import useInputController from "@/components/taInput/inputController";
 
 export default defineComponent({
   name: "InputItem",
+  components: { TextInput },
   setup() {
 
     const isRecording = ref(false);
-    
+
     const { emitter } = useMitt();
     const { elementX, elementY } = draggify({ elementId: 'inputItem'});
 
+    const {
+      input,
+      visualizeStream,
+      audioBubbleWidth,
+      paths,
+    } = useInputController();
+
     onMounted(() => {
       emitter.on('input-audio-record', (record) => isRecording.value = record);
     })
@@ -34,7 +45,8 @@ export default defineComponent({
     return {
       elementX,
       elementY,
-      isRecording
+      isRecording,
+      input
     }
   }
 
@@ -62,6 +74,8 @@ export default defineComponent({
     background-color: white;
     border: 4px solid #C3C3C3;
 
+    cursor: pointer;
+
    .play, .pause {
       z-index: 5;  
       &::before, &::after {
@@ -104,11 +118,6 @@ export default defineComponent({
          }
       }
    }
-   &:hover {
-      .play::before {
-         box-shadow: 0 0 12px rgba(195, 195, 195, 0.8);
-      }
-   }
 }
 
 .animate-audio1 {
index f7218696f6fcf4e895ba083c7f4eb4c10f935221..68b5c65db4320bd2e48141c74e6311c331be3491 100644 (file)
@@ -7,11 +7,11 @@
     :paths="paths" 
   />
 
-  <TextInput 
+<!--   <TextInput 
     v-else 
     :input="input"
   />
-
+ -->
 </template>
 
 <script lang="ts">
index c32c6fff06ef60e5ac60c7b6100adcfe3a1ee0cb..fa215fec4cc29eff03dfa11e583301d4e81b0141 100644 (file)
@@ -25,17 +25,15 @@ export default defineComponent({
 <style lang="scss" scoped>
 
 .inputBox {
-  position: fixed;
-
-  width: 100vw;
+  position: absolute;
 
   display: flex;
   justify-content: center;
   align-items: center;
 
-  bottom: 0;
+  // bottom: 0;
 
-  z-index: 1;
+  // z-index: 1;
 }
 
 .inputBubble {
index f8336e0f8b95aebefb2cbeb209d64d3dd6ec2b36..21dd591c7920f004714367c7196a76354a54c4c3 100644 (file)
@@ -9,7 +9,7 @@ interface KeyDownEvent {
 
 // This catches keys from a physical keyboard, a soft keyboard on a tablet, or a
 // scanner attached via USB
-export default function useKeyDownHandler(enterCallback: (input: string) => void | null) {
+export default function useKeyDownHandler(enterCallback?: (input: string) => void) {
 
   const input = ref("");
 
@@ -31,7 +31,7 @@ export default function useKeyDownHandler(enterCallback: (input: string) => void
     const cmd = keyboardNameMap[e.keyCode];
     switch (cmd) {
       case "ENTER":
-        enterCallback(input.value);
+        if (enterCallback) enterCallback(input.value);
         break;
       case "BACK_SPACE":
         input.value = input.value.slice(0, -1);