File size: 3,728 Bytes
963fdb9
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
<!DOCTYPE html>
<html lang="ru">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Чат-виджет</title>
    <script src="https://cdn.tailwindcss.com"></script>
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
</head>
<body class="bg-gray-100 h-screen flex flex-col">
    <!-- Шапка виджета -->
    <div class="bg-gradient-to-r from-blue-500 to-indigo-600 text-white p-4 flex items-center justify-between">
        <div class="flex items-center space-x-3">
            <div class="bg-white p-1 rounded-full">
                <img src="http://static.photos/people/200x200/42" alt="Агент" class="rounded-full w-8 h-8 object-cover">
            </div>
            <div>
                <h2 class="font-bold">Поддержка</h2>
                <p class="text-xs text-blue-100">Обычно отвечает за несколько минут</p>
            </div>
        </div>
        <button onclick="window.close()" class="text-white hover:text-gray-200">
            <i class="fas fa-times"></i>
        </button>
    </div>

    <!-- Основная область чата -->
    <div class="flex-1 overflow-y-auto p-4 space-y-4">
        <!-- Сообщение от агента -->
        <div class="flex items-start space-x-2">
            <img src="http://static.photos/people/200x200/42" alt="Агент" class="rounded-full w-8 h-8 object-cover">
            <div class="bg-white p-3 rounded-lg rounded-tl-none max-w-xs md:max-w-md">
                <p class="text-gray-800">Здравствуйте! Как я могу вам помочь?</p>
                <span class="text-xs text-gray-500 block mt-1">10:00</span>
            </div>
        </div>

        <!-- Сообщение от пользователя -->
        <div class="flex justify-end">
            <div class="bg-blue-500 text-white p-3 rounded-lg rounded-tr-none max-w-xs md:max-w-md">
                <p>Привет! У меня вопрос по вашему сервису.</p>
                <span class="text-xs text-blue-100 block mt-1 text-right">10:02</span>
            </div>
        </div>

        <!-- Сообщение от агента -->
        <div class="flex items-start space-x-2">
            <img src="http://static.photos/people/200x200/42" alt="Агент" class="rounded-full w-8 h-8 object-cover">
            <div class="bg-white p-3 rounded-lg rounded-tl-none max-w-xs md:max-w-md">
                <p class="text-gray-800">Конечно, задавайте ваш вопрос и я постараюсь помочь!</p>
                <span class="text-xs text-gray-500 block mt-1">10:03</span>
            </div>
        </div>
    </div>

    <!-- Поле ввода -->
    <div class="bg-white p-3 border-t border-gray-200">
        <div class="flex items-center">
            <input 
                type="text" 
                placeholder="Введите сообщение..." 
                class="flex-1 border border-gray-300 rounded-l-lg py-2 px-4 focus:outline-none focus:ring-2 focus:ring-blue-300 focus:border-transparent"
            >
            <button class="bg-gradient-to-r from-blue-500 to-indigo-600 text-white py-2 px-4 rounded-r-lg hover:from-blue-600 hover:to-indigo-700 transition-colors">
                <i class="fas fa-paper-plane"></i>
            </button>
        </div>
        <div class="flex justify-between mt-2 text-xs text-gray-500">
            <span>Нажмите Enter для отправки</span>
            <span>Защита данных</span>
        </div>
    </div>
</body>
</html>