File size: 1,809 Bytes
65224b2
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Chatbot</title>
    <style>

        body {

            font-family: Arial, sans-serif;

            text-align: center;

        }



        .container {

            width: 50%;

            margin: 0 auto;

        }



        .chat-container {

            display: flex;

            flex-direction: column;

            align-items: center;

            padding: 20px;

            border: 1px solid #ddd;

            border-radius: 10px;

            margin-bottom: 20px;

        }



        .chat-message {

            margin-bottom: 10px;

        }



        .chat-message:first-child {

            margin-top: 0;

        }



        .chat-message:last-child {

            margin-bottom: 0;

        }



        .chat-user {

            font-weight: bold;

        }



        .chat-bot {

            color: #666;

        }

    </style>
</head>
<body>
    <div class="container">
        <h1>Chatbot</h1>
        <form action="/chat" method="POST">
            <input type="text" name="message" placeholder="Type a message..." />
            <button type="submit">Send</button>
        </form>

        <div class="chat-container">
            {% if message %}
                <div class="chat-message">
                    <span class="chat-user">You:</span>
                    {{ message }}
                </div>
            {% endif %}

            {% if response %}
                <div class="chat-message">
                    <span class="chat-bot">Bot:</span>
                    {{ response }}
                </div>
            {% endif %}
        </div>
    </div>
</body>
</html>