-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
86 lines (72 loc) · 3.44 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Yoda Bot</title>
<!-- Bootstrap 4 -->
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@4.6.0/dist/css/bootstrap.min.css"
integrity="sha384-B0vP5xmATw1+K9KRQjQERJvTumQW0nPEzvF6L/Z6nronJ3oUOFUFpCjEUQouq2+l" crossorigin="anonymous">
<!-- Vue -->
<script src="https://cdn.jsdelivr.net/npm/vue@2.5.16/dist/vue.js"></script>
<!-- Axios -->
<script src="https://cdn.jsdelivr.net/npm/axios@0.21.1/dist/axios.min.js"></script>
</head>
<body>
<main>
<div id="app" class="container">
<div id="chat-container" class="bg-secondary rounded mt-5 border-dark position-relative p-3">
<div id="chat" class="d-flex flex-column">
<div id="chat-header" class="mb-5">
<h3 class="text-center">Yoda bot</h3>
</div>
<div id="chat-body">
<div v-for="message in chat">
<div v-if="message.reply" class="row mt-3 d-flex align-items-center">
<div class="col-2 col-md-1">
<img class="img-fluid rounded-circle" src="img/yoda.png"
alt="Yoda image">
</div>
<div class="col-10 col-md-11">
<div v-html=message.value class="bg-info p-2 rounded float-left"></div>
</div>
</div>
<div v-else class="row mt-3 d-flex align-items-center">
<div class="col-10 col-md-11">
<div v-html=message.value class="bg-light p-2 rounded float-right"></div>
</div>
<div class="col-2 col-md-1">
<img class="img-fluid mt-1 ml-1 rounded-circle" src="img/user.png"
alt="User image">
</div>
</div>
</div>
<div v-if="yodaReplying" class="row mt-3 d-flex align-items-center">
<div class="col-2 col-md-1">
<img class="img-fluid rounded-circle" src="img/yoda.png"
alt="Yoda image">
</div>
<div class="col-10 col-md-11">
<span class="font-italic bg-info p-2 rounded float-left">Yoda is writing..</span>
</div>
</div>
</div>
<div id="chat-form" class="mt-5 align-self-baseline w-100" style="bottom: 0">
<div class="row">
<div class="col-12">
<form v-on:submit.prevent="send">
<div class="input-group">
<input v-model="message"
type="text" name="message" class="form-control mr-3 rounded">
<button type="submit" class="btn btn-warning btn-flat">Send</button>
</div>
</form>
</div>
</div>
</div>
</div>
</div>
</div>
</main>
<script src="app.js"></script>
</body>
</html>