index.html 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="UTF-8">
  5. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  6. <title>Checklist</title>
  7. <style>
  8. body {
  9. background-color: #1F2933;
  10. color: #CBD2D9;
  11. }
  12. a {
  13. color: #E4E7EB;
  14. }
  15. .button {
  16. padding: 8px 12px;
  17. margin: 3px;
  18. border: none;
  19. border-radius: 5px;
  20. background-color: #52606D;
  21. color: white;
  22. cursor: pointer;
  23. text-decoration: none;
  24. display: inline-block;
  25. border-radius: 12px;
  26. box-shadow: 0 9px #999;
  27. }
  28. .button:hover {
  29. background-color: #616E7C;
  30. }
  31. .button:active {
  32. background-color: #9AA5B1;
  33. box-shadow: 0 5px #666;
  34. transform: translateY(4px);
  35. }
  36. </style>
  37. <script>
  38. // Function to focus on the input field
  39. function focusInput() {
  40. document.getElementById('itemInput').focus();
  41. }
  42. </script>
  43. </head>
  44. <body onload="focusInput()">
  45. <h1>Checklist</h1>
  46. <form method="POST" onsubmit="focusInput()">
  47. <input type="text" id="itemInput" name="item" placeholder="Add a new item" required>
  48. <button type="submit" class="button">Add</button>
  49. </form>
  50. <ul>
  51. {% for item in items %}
  52. <li style="text-decoration: {{ 'line-through' if item.checked else 'none' }};">
  53. {{ item.name }}
  54. <a href="{{ url_for('check', item_id=loop.index0) }}">[Check]</a>
  55. </li>
  56. {% endfor %}
  57. </ul>
  58. <form action="{{ url_for('list') }}" method="get" style="display: inline;">
  59. <button type="submit" class="button">View List</button>
  60. </form>
  61. <form action="{{ url_for('clear') }}" method="get" style="display: inline;">
  62. <button type="submit" class="button">Clear List</button>
  63. </form>
  64. </body>
  65. </html>