index.html 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  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. border-radius: 10px;
  33. border: none;
  34. resize: none;
  35. font-size: 1em;
  36. width: 100%;
  37. }
  38. button {
  39. padding: 0.8em 2em;
  40. margin-top: 1em;
  41. border: none;
  42. border-radius: 8px;
  43. background-color: #ffffff33;
  44. color: white;
  45. font-size: 1em;
  46. cursor: pointer;
  47. transition: background 0.3s ease;
  48. }
  49. button:hover {
  50. background-color: #ffffff55;
  51. }
  52. #responseBox {
  53. margin-top: 1.5em;
  54. background: rgba(255, 255, 255, 0.1);
  55. border-radius: 10px;
  56. padding: 1em;
  57. min-height: 4em;
  58. white-space: pre-wrap;
  59. }
  60. @keyframes fadeIn {
  61. from { opacity: 0; transform: translateY(20px); }
  62. to { opacity: 1; transform: translateY(0); }
  63. }
  64. </style>
  65. </head>
  66. <body>
  67. <div class="glass-container">
  68. <h2>🤖 HR-Bot (DeepSeek lokal)</h2>
  69. <textarea id="question" rows="3" placeholder="Frage eingeben..." >
  70. Hallo wieviel Tage hab ich noch frei ich hatte 4 Urlaubstage
  71. </textarea><br>
  72. <button id="sendBtn">Frage stellen</button>
  73. <div id="responseBox">Antwort erscheint hier...</div>
  74. </div>
  75. <script>
  76. document.getElementById('sendBtn').addEventListener('click', async () => {
  77. const frage = document.getElementById('question').value.trim();
  78. if (!frage) return;
  79. const box = document.getElementById('responseBox');
  80. box.textContent = '⏳ Bitte warten...';
  81. try {
  82. const res = await fetch('/api/chatbot.php', {
  83. method: 'POST',
  84. headers: {'Content-Type': 'application/json'},
  85. body: JSON.stringify({ question: frage })
  86. });
  87. const json = await res.json();
  88. box.textContent = json.reply || json.answer || '❗️Keine Antwort';
  89. } catch (e) {
  90. box.textContent = 'Fehler: ' + e.message;
  91. }
  92. });
  93. </script>
  94. </body>
  95. </html>