index.html 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839
  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. </style>
  16. <script>
  17. // Function to focus on the input field
  18. function focusInput() {
  19. document.getElementById('itemInput').focus();
  20. }
  21. </script>
  22. </head>
  23. <body onload="focusInput()">
  24. <h1>Checklist</h1>
  25. <form method="POST" onsubmit="focusInput()">
  26. <input type="text" id="itemInput" name="item" placeholder="Add a new item" required>
  27. <button type="submit">Add</button>
  28. </form>
  29. <ul>
  30. {% for item in items %}
  31. <li style="text-decoration: {{ 'line-through' if item.checked else 'none' }};">
  32. {{ item.name }}
  33. <a href="{{ url_for('check', item_id=loop.index0) }}">[Check]</a>
  34. </li>
  35. {% endfor %}
  36. </ul>
  37. <a href="{{ url_for('list') }}">View List</a>
  38. </body>
  39. </html>