index.html 3.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. <!DOCTYPE html>
  2. <html lang="el">
  3. <head>
  4. <meta charset="UTF-8">
  5. <title>WiSearch</title>
  6. <style>
  7. body { background: #202124; color: #bdc1c6; font-family: Arial, sans-serif; display: flex; flex-direction: column; align-items: center; justify-content: center; height: 100vh; margin: 0; }
  8. /* Το μενού επάνω δεξιά */
  9. .top-nav { position: absolute; top: 20px; right: 30px; font-size: 14px; }
  10. .top-nav a { color: #e8eaed; text-decoration: none; margin-left: 15px; font-weight: bold; }
  11. .top-nav a:hover { color: #8ab4f8; text-decoration: underline; }
  12. .btn-register { background: #8ab4f8; color: #202124 !important; padding: 8px 16px; border-radius: 4px; text-decoration: none !important; }
  13. .btn-register:hover { background: #aecbfa; }
  14. .logo { font-size: 80px; font-weight: bold; color: #8ab4f8; margin-bottom: 30px; letter-spacing: -2px; }
  15. .search-container { position: relative; width: 600px; }
  16. input[type="text"] { width: 100%; padding: 15px 20px; font-size: 16px; border: 1px solid #5f6368; border-radius: 24px; background: #202124; color: white; outline: none; box-sizing: border-box; }
  17. input[type="text"]:hover, input[type="text"]:focus { background: #303134; box-shadow: 0 1px 6px rgba(32,33,36,.28); border-color: rgba(223,225,229,0); }
  18. .buttons { margin-top: 30px; text-align: center; }
  19. input[type="submit"] { background: #303134; border: 1px solid #303134; color: #e8eaed; padding: 10px 20px; border-radius: 4px; font-size: 14px; cursor: pointer; }
  20. input[type="submit"]:hover { border: 1px solid #5f6368; }
  21. </style>
  22. </head>
  23. <body>
  24. <div class="top-nav">
  25. {% if session.get('logged_in') %}
  26. <span style="color: #9aa0a6; margin-right: 10px;">Γεια σου, {{ session['username'] }}!</span>
  27. <a href="/admin">Dashboard</a>
  28. <a href="/logout" style="color: #f28b82;">Έξοδος</a>
  29. {% else %}
  30. <a href="/login">Σύνδεση</a>
  31. <a href="/register" class="btn-register">Εγγραφή</a>
  32. {% endif %}
  33. </div>
  34. <div class="logo">WiSearch</div>
  35. <div class="search-container">
  36. <form action="/search" method="get">
  37. <input type="text" name="q" placeholder="Αναζήτηση στο AWMN..." autofocus autocomplete="off">
  38. <div class="buttons"><input type="submit" value="Αναζήτηση"></div>
  39. </form>
  40. </div>
  41. <div style="margin-top: 25px; font-size: 12px; color: #9aa0a6;">
  42. Τελεστές: <b>"φράση"</b> για ακριβές κείμενο &nbsp;|&nbsp; <b>-λέξη</b> για εξαίρεση
  43. </div>
  44. <div style="position: absolute; bottom: 20px; width: 100%; text-align: center; font-size: 12px; color: #5f6368;">
  45. <a href="/admin" style="color:#5f6368; text-decoration: none; margin-right: 15px;">Admin Panel</a>
  46. |
  47. <span style="margin-left: 15px;">⚡ Powered by <b style="color: #9aa0a6;">#6610 Maiden</b></span>
  48. </div>
  49. <script>
  50. document.querySelector('input[name="q"]').addEventListener('input', function(e) {
  51. let val = e.target.value;
  52. if(val.length > 1) {
  53. fetch('/api/autocomplete?q=' + val)
  54. .then(r => r.json())
  55. .then(data => {
  56. // Εδώ μπορείς να εμφανίσεις τα δεδομένα κάτω από το search box σου (π.χ. σε ένα div)
  57. console.log(data);
  58. });
  59. }
  60. });
  61. </script>
  62. </body>
  63. </html>