Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
61 changes: 35 additions & 26 deletions public/index.html
Original file line number Diff line number Diff line change
@@ -1,35 +1,44 @@
<!DOCTYPE html>
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Open Source To-Do App</title>
<link rel="stylesheet" href="style.css">
</head>
<body>
<link rel="stylesheet" href="style.css" />
</head>
<body>
<div id="app">
<!-- Components will be injected here by other members -->
<header id="main-header"></header>

<main id="main-content">
<!-- Search Bar will go here (Issue #19) -->
<div id="search-container"></div>
<!-- Components will be injected here by other members -->
<header id="main-header"></header>

<!-- Input Section (Issue #5 & #11) -->
<div id="input-section"></div>
<main id="main-content">
<!-- Search Bar will go here (Issue #19) -->
<div id="search-container"></div>

<!-- Task List (Issue #10) -->
<ul id="task-list"></ul>

<!-- Empty State (Issue #17) -->
<div id="empty-state"></div>

<!-- Filter Controls (Issue #13) -->
<div id="filter-controls"></div>
</main>
<!-- Input Section (Issue #5 & #11) -->
<div id="input-section">
<div class="input-group">
<input
type="text"
id="task-input"
placeholder="What needs to be done?"
/>
<button id="add-btn">Add Task</button>
</div>
</div>

<footer id="main-footer"></footer>
<!-- Task List (Issue #10) -->
<ul id="task-list"></ul>

<!-- Empty State (Issue #17) -->
<div id="empty-state"></div>

<!-- Filter Controls (Issue #13) -->
<div id="filter-controls"></div>
</main>

<footer id="main-footer"></footer>
</div>
<script src="script.js"></script>
</body>
</body>
</html>
30 changes: 25 additions & 5 deletions public/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,31 @@
let tasks = [];

// DOM Elements (Will be populated as elements are added)
const taskList = document.getElementById('task-list');
const taskList = document.getElementById("task-list");

// Initial Render
document.addEventListener('DOMContentLoaded', () => {
console.log("App Initialized");
// Load tasks will be called here later (Issue #9)
});
document.addEventListener("DOMContentLoaded", () => {
console.log("App Initialized");
// Load tasks will be called here later (Issue #9)
const taskInput = document.getElementById("task-input");
const addBtn = document.getElementById("add-btn");

function addTask(text) {
const task = {
id: Date.now(),
text: text,
completed: false,
};
tasks.push(task);
renderTasks();
}

addBtn.addEventListener("click", () => {
const text = taskInput.value;
// Validation is handled by Issue #11, so basic add for now:
if (text) {
addTask(text);
taskInput.value = "";
}
});
});
46 changes: 34 additions & 12 deletions public/style.css
Original file line number Diff line number Diff line change
@@ -1,22 +1,44 @@
/* Basic Reset */
* {
margin: 0;
padding: 0;
box-sizing: border-box;
margin: 0;
padding: 0;
box-sizing: border-box;
}

body {
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
background-color: #f4f4f4;
color: #333;
line-height: 1.6;
font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
background-color: #f4f4f4;
color: #333;
line-height: 1.6;
}

#app {
max-width: 600px;
margin: 0 auto;
min-height: 100vh;
display: flex;
flex-direction: column;
max-width: 600px;
margin: 0 auto;
min-height: 100vh;
display: flex;
flex-direction: column;
}

/* Mobile Responsiveness */
@media (max-width: 600px) {
#main-content {
padding: 1rem;
}

nav {
padding: 1rem;
}

.task-item {
flex-direction: column;
align-items: flex-start;
gap: 0.5rem;
}

.task-actions {
width: 100%;
display: flex;
justify-content: flex-end;
}
}