diff --git a/core/flaskui/__pycache__/flask.cpython-310.pyc b/core/flaskui/__pycache__/flask.cpython-310.pyc index 1372f47..2437825 100644 Binary files a/core/flaskui/__pycache__/flask.cpython-310.pyc and b/core/flaskui/__pycache__/flask.cpython-310.pyc differ diff --git a/core/flaskui/static/css/style.css b/core/flaskui/static/css/style.css new file mode 100644 index 0000000..7f6242e --- /dev/null +++ b/core/flaskui/static/css/style.css @@ -0,0 +1,23 @@ +body { + background: #111; + color: white; + font-family: Arial; +} + +#chat-container { + width: 800px; + margin: auto; + margin-top: 40px; +} + +#messages { + height: 500px; + border: 1px solid #333; + overflow-y: scroll; + padding: 10px; +} + +#input-area { + display: flex; + margin-top: 10px; +} \ No newline at end of file diff --git a/core/flaskui/static/js/chat.js b/core/flaskui/static/js/chat.js new file mode 100644 index 0000000..244b762 --- /dev/null +++ b/core/flaskui/static/js/chat.js @@ -0,0 +1,27 @@ +const sendBtn = document.getElementById("send-btn"); + +sendBtn.addEventListener("click", async () => { + + const input = document.getElementById("user-input"); + const text = input.value; + + const messages = document.getElementById("messages"); + + messages.innerHTML += `

You: ${text}

`; + + const response = await fetch("/chat", { + method: "POST", + headers: { + "Content-Type": "application/json" + }, + body: JSON.stringify({ + message: text + }) + }); + + const data = await response.json(); + + messages.innerHTML += `

AI: ${data.response}

`; + + input.value = ""; +}); \ No newline at end of file diff --git a/core/flaskui/templates/index.html b/core/flaskui/templates/index.html index 6d93ea5..d62b2f0 100644 --- a/core/flaskui/templates/index.html +++ b/core/flaskui/templates/index.html @@ -1,22 +1,25 @@ - - - - - - - - - Главная страница - - - - - - - - - + + + + LAIC + + + + + +
+ +
+ +
+ + +
+ +
+ + + + \ No newline at end of file