]> Repos - mime-chat/commitdiff
inputitem playground
authorAndrew Gundersen <gundersena@xavier.edu>
Tue, 16 Mar 2021 00:24:48 +0000 (19:24 -0500)
committerAndrew Gundersen <gundersena@xavier.edu>
Tue, 16 Mar 2021 00:24:48 +0000 (19:24 -0500)
src/components/inputItem/inputItem.vue
src/components/inputItem/textInput.vue

index 918d4e978e9d0dc101576121e7ae6d9d7d12d4ca..ff367dcc573ebe209dcac47e8cf5adf3afde39c5 100644 (file)
@@ -5,6 +5,7 @@
     :class="{ playing: isRecording }"
     :style="{ top: `${elementY}px`, left: `${elementX}px` }"
   >
+    AG
 
     <!-- animations for recording and on-standby -->
     <span v-if="isRecording" class="play"></span>
@@ -13,7 +14,7 @@
     </span>
 
     <!-- Show text input on key-down -->
-    <TextInput />
+    <TextInput :position="elementX"/>
 
     <!-- Show suggestions menu on click -->
     <!-- <SuggestionsMenu /> -->
@@ -53,38 +54,20 @@ export default defineComponent({
 
 <style lang="scss" scoped>
 
-.rec-icon {
-  width: 8px;
-  height: 8px;
-  border-radius: 50%;
-  background-color: red;
-  transform: translate(14px);
-
-  animation-name: rec;
-  animation-duration: 0.5s;
-}
-
-@keyframes rec {
-  from {
-    transform: translate(14px) scale(0.3);
-  }
-  to {
-    transform: translate(14px) scale(1.0);
-  }
-}
-
 .input-item {
   position: absolute;
 
   display: flex;
   align-items: center;
+  justify-content: center;
 
   padding: 0;
 
-  width: 36px;
-  height: 36px;
+  width: 40px;
+  height: 40px;
 
-  border-radius: 18px;
+  border: 4px solid #C6C6C6;
+  border-radius: 24px;
 
   z-index: 3;
 
@@ -92,6 +75,8 @@ export default defineComponent({
 
   cursor: pointer;
 
+  box-shadow: 0px 0px 10px 0px rgba(0,0,0,0.15);
+
   .play,
   .pause {
     z-index: 5;
@@ -138,6 +123,26 @@ export default defineComponent({
   }
 }
 
+.rec-icon {
+  width: 8px;
+  height: 8px;
+  border-radius: 50%;
+  background-color: red;
+  transform: translate(14px);
+
+  animation-name: rec;
+  animation-duration: 0.5s;
+}
+
+@keyframes rec {
+  from {
+    transform: translate(14px) scale(0.3);
+  }
+  to {
+    transform: translate(14px) scale(1.0);
+  }
+}
+
 @keyframes circle1 {
   0%,
   100% {
index f09e5aeec28b17ba05f9ebbb1c4bae2381ab1ddd..ba9dd3f6cd9bf44858167c4c4c5baae7023f8e58 100644 (file)
@@ -2,6 +2,7 @@
 
   <div
     class="text-input"
+    :class="`text-input-${updateSide}`"
   >
     <input id="textInput" type="text" />
   </div>
 </template>
 
 <script lang="ts">
-import { defineComponent } from "vue";
+import { defineComponent, ref, watch } from "vue";
 
 export default defineComponent({
   name: "TextInput",
 
-  props: {
+  data: {
 
     // Where is avatar?
-    left: Boolean
+    position: Number
 
   },
 
-  setup(props) {
+  setup(data) {
 
-    return {
+    const side = ref("")
+    side.value = "left"
+    
+    // Watch the position of parent.
+    // watch(data.position, (position, prevPosition) => {
+    //   console.log("position moved")
+    // })
 
+    return {
+      side
     }
   }
 })