Pārlūkot izejas kodu

zbytest003-2025-02-19 06:33:30

genlitex 2 mēneši atpakaļ
vecāks
revīzija
adacda7392

+ 1 - 0
dist/assets/NewChatPage-CYkOfUsa.css

@@ -0,0 +1 @@
+.ant-layout-sider[data-v-28e4b03e]{height:100%}.ant-layout-content[data-v-28e4b03e]{height:calc(100% - 64px);overflow-y:auto}.ant-list-item[data-v-28e4b03e]{cursor:pointer}.ant-card[data-v-28e4b03e]{word-wrap:break-word}

Failā izmaiņas netiks attēlotas, jo tās ir par lielu
+ 0 - 0
dist/assets/NewChatPage-DtvgPjGY.js


Failā izmaiņas netiks attēlotas, jo tās ir par lielu
+ 5 - 0
dist/assets/index-B1kCNetV.js


Failā izmaiņas netiks attēlotas, jo tās ir par lielu
+ 0 - 0
dist/assets/index-BtM_Gz6j.css


Failā izmaiņas netiks attēlotas, jo tās ir par lielu
+ 0 - 4
dist/assets/index-malWbV8K.js


+ 2 - 2
dist/index.html

@@ -4,8 +4,8 @@
     <meta charset="UTF-8" />
     <meta name="viewport" content="width=device-width, initial-scale=1.0" />
     <title>Prototype Design</title>
-    <script type="module" crossorigin src="/prototype/3000/assets/index-malWbV8K.js"></script>
-    <link rel="stylesheet" crossorigin href="/prototype/3000/assets/index-Btspm7_H.css">
+    <script type="module" crossorigin src="/ide/proxy/6001/assets/index-B1kCNetV.js"></script>
+    <link rel="stylesheet" crossorigin href="/ide/proxy/6001/assets/index-BtM_Gz6j.css">
   </head>
   <body>
     <div id="app"></div>

+ 6 - 1
src/router/index.js

@@ -4,8 +4,13 @@ import HomeView from '../views/HomeView.vue'
 const routes = [
   {
     path: '/',
-    name: 'home',
+    name: 'Home',
     component: HomeView
+  },
+  {
+    path: '/chat',
+    name: 'Chat',
+    component: () => import('../views/NewChatPage.vue')
   }
 ]
 

+ 103 - 0
src/views/NewChatPage.vue

@@ -0,0 +1,103 @@
+<template>
+  <a-layout style="height: 100vh;">
+    <a-layout-sider width="250" style="background: #08002E;">
+      <a-layout-header style="background: #5A008F; color: white; font-size: 18px; font-weight: bold; text-align: center;">
+        Chat Application
+      </a-layout-header>
+      <a-list :data-source="contacts" :bordered="false">
+        <a-list-item v-for="contact in contacts" :key="contact.id" @click="selectContact(contact)" :style="{ cursor: 'pointer', padding: '10px' }">
+          {{ contact.name }}
+        </a-list-item>
+      </a-list>
+    </a-layout-sider>
+    <a-layout>
+      <a-layout-content style="background: #f0f0f0; padding: 16px;">
+        <a-list :data-source="messages" :bordered="false">
+          <a-list-item v-for="message in messages" :key="message.id" :style="{ textAlign: message.sender === 'user' ? 'right' : 'left' }">
+            <a-card :style="{ backgroundColor: message.sender === 'user' ? '#5A008F' : '#e0e0e0', color: message.sender === 'user' ? 'white' : 'black', borderRadius: '15px', maxWidth: '70%', margin: '10px' }">
+              {{ message.text }}
+            </a-card>
+          </a-list-item>
+        </a-list>
+      </a-layout-content>
+      <a-layout-footer style="padding: 16px;">
+        <a-row :gutter="16">
+          <a-col :span="18">
+            <a-input v-model:value="inputMessage" placeholder="Type a message...">
+              <template #suffix>
+                <a-upload :before-upload="handleUpload">
+                  <template #icon>
+                    <UploadOutlined />
+                  </template>
+                  <a-button shape="circle" style="background: #5A008F; color: white;"></a-button>
+                </a-upload>
+                {{ uploadedFileName }}
+              </template>
+            </a-input>
+          </a-col>
+          <a-col :span="6">
+            <a-button type="primary" @click="sendMessage" style="background: #5A008F; color: white; font-weight: bold;">Send</a-button>
+          </a-col>
+        </a-row>
+      </a-layout-footer>
+    </a-layout>
+  </a-layout>
+</template>
+
+<script>
+import { UploadOutlined } from '@ant-design/icons-vue';
+
+export default {
+  components: {
+    UploadOutlined
+  },
+  data() {
+    return {
+      contacts: [
+        { id: 1, name: 'Alice' },
+        { id: 2, name: 'Bob' },
+        { id: 3, name: 'Charlie' }
+      ],
+      messages: [],
+      selectedContact: null,
+      inputMessage: '',
+      uploadedFileName: ''
+    };
+  },
+  methods: {
+    selectContact(contact) {
+      this.selectedContact = contact;
+      this.messages = [];
+    },
+    sendMessage() {
+      if (this.inputMessage.trim()) {
+        this.messages.push({ id: Date.now(), sender: 'user', text: this.inputMessage });
+        this.inputMessage = '';
+      }
+    },
+    handleUpload(file) {
+      this.uploadedFileName = file.name;
+      return false; // Prevent file upload
+    }
+  }
+};
+</script>
+
+<style scoped>
+.ant-layout-sider {
+  height: 100%;
+}
+
+.ant-layout-content {
+  height: calc(100% - 64px); /* Subtract header and footer height */
+  overflow-y: auto;
+}
+
+.ant-list-item {
+  cursor: pointer;
+}
+
+.ant-card {
+  word-wrap: break-word;
+}
+</style>

Daži faili netika attēloti, jo izmaiņu fails ir pārāk liels