index.html 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  1. <!DOCTYPE html>
  2. <html lang="de">
  3. <head>
  4. <meta charset="UTF-8">
  5. <title>HR-Bot Webinterface</title>
  6. <style>
  7. body {
  8. margin: 0;
  9. padding: 0;
  10. font-family: 'Segoe UI', sans-serif;
  11. background: linear-gradient(135deg, #ce2d6d 0%, #143d83 100%);
  12. height: 100vh;
  13. display: flex;
  14. align-items: center;
  15. justify-content: center;
  16. }
  17. .glass-container {
  18. background: rgba(255, 255, 255, 0.2);
  19. border-radius: 20px;
  20. box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.37);
  21. backdrop-filter: blur(10px);
  22. -webkit-backdrop-filter: blur(10px);
  23. border: 1px solid rgba(255, 255, 255, 0.18);
  24. padding: 2em;
  25. width: 90%;
  26. max-width: 600px;
  27. color: #fff;
  28. text-align: center;
  29. animation: fadeIn 1s ease-out;
  30. }
  31. textarea {
  32. width: 100%;
  33. padding: 1em;
  34. border-radius: 10px;
  35. border: none;
  36. resize: none;
  37. font-size: 1em;
  38. }
  39. button {
  40. padding: 0.8em 2em;
  41. margin-top: 1em;
  42. border: none;
  43. border-radius: 8px;
  44. background-color: #ffffff33;
  45. color: white;
  46. font-size: 1em;
  47. cursor: pointer;
  48. transition: background 0.3s ease;
  49. }
  50. button:hover {
  51. background-color: #ffffff55;
  52. }
  53. #responseBox {
  54. margin-top: 1.5em;
  55. background: rgba(255, 255, 255, 0.1);
  56. border-radius: 10px;
  57. padding: 1em;
  58. min-height: 4em;
  59. white-space: pre-wrap;
  60. }
  61. @keyframes fadeIn {
  62. from { opacity: 0; transform: translateY(20px); }
  63. to { opacity: 1; transform: translateY(0); }
  64. }
  65. </style>
  66. </head>
  67. <body>
  68. <div class="glass-container">
  69. <h2>🤖 HR-Bot (DeepSeek lokal)</h2>
  70. <textarea id="question" rows="3" placeholder="Frage eingeben..." >
  71. Hallo wieviel Tage hab ich noch frei ich hatte 4 Urlaubstage
  72. </textarea><br>
  73. <button id="sendBtn">Frage stellen</button>
  74. <div id="responseBox">Antwort erscheint hier...</div>
  75. </div>
  76. <script>
  77. document.getElementById('sendBtn').addEventListener('click', async () => {
  78. const frage = document.getElementById('question').value.trim();
  79. if (!frage) return;
  80. const box = document.getElementById('responseBox');
  81. box.textContent = '⏳ Bitte warten...';
  82. try {
  83. const res = await fetch('/api/chatbot.php', {
  84. method: 'POST',
  85. headers: {'Content-Type': 'application/json'},
  86. body: JSON.stringify({ question: frage })
  87. });
  88. const json = await res.json();
  89. box.textContent = json.reply || json.answer || '❗️Keine Antwort';
  90. } catch (e) {
  91. box.textContent = 'Fehler: ' + e.message;
  92. }
  93. });
  94. </script>
  95. </body>
  96. </html>