123456789101112131415161718192021222324252627282930313233343536373839 |
- <!DOCTYPE html>
- <html lang="en">
- <head>
- <meta charset="UTF-8">
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
- <title>Checklist</title>
- <style>
- body {
- background-color: #1F2933;
- color: #CBD2D9;
- }
- a {
- color: #E4E7EB;
- }
- </style>
- <script>
- // Function to focus on the input field
- function focusInput() {
- document.getElementById('itemInput').focus();
- }
- </script>
- </head>
- <body onload="focusInput()">
- <h1>Checklist</h1>
- <form method="POST" onsubmit="focusInput()">
- <input type="text" id="itemInput" name="item" placeholder="Add a new item" required>
- <button type="submit">Add</button>
- </form>
- <ul>
- {% for item in items %}
- <li style="text-decoration: {{ 'line-through' if item.checked else 'none' }};">
- {{ item.name }}
- <a href="{{ url_for('check', item_id=loop.index0) }}">[Check]</a>
- </li>
- {% endfor %}
- </ul>
- <a href="{{ url_for('list') }}">View List</a>
- </body>
- </html>
|