-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
511 additions
and
78 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import { derived, get, writable } from 'svelte/store'; | ||
import type { Todo, User } from './types'; | ||
|
||
const users = writable<User[]>([]); | ||
|
||
const todos = writable<Todo[]>([]); | ||
|
||
const inProgress = derived(todos, ($todos) => { | ||
return $todos.filter((todo) => todo.status === 'in-progress'); | ||
}); | ||
|
||
const todosDone = derived(todos, ($todos) => { | ||
return $todos.filter((todo) => todo.status === 'in-progress'); | ||
}); | ||
|
||
const getTodos = () => { | ||
return get(todos); | ||
}; | ||
|
||
const clearTodos = () => { | ||
todos.update(() => []); | ||
}; | ||
|
||
const createTodo = (user: User, todo: Todo) => {}; | ||
const updateTodo = (user: User, todo: Todo) => {}; | ||
const removeTodo = (user: User, todo: Todo) => {}; | ||
|
||
const createUser = (user: User) => {}; | ||
const removeUser = (user: User) => {}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
export type User = { | ||
id: string; | ||
firstName: string; | ||
lastName: string; | ||
todos?: Todo[]; | ||
}; | ||
|
||
export type Todo = { | ||
id: string; | ||
user: User; | ||
text: string; | ||
status: 'pending' | 'in-progress' | 'done'; | ||
createdAt: Date; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
<nav> | ||
<a href="/">Home</a> | ||
<a href="/users">Users</a> | ||
<a href="/todos">Todos</a> | ||
</nav> | ||
|
||
<slot /> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
<h1>Welcome to SvelteKit</h1> | ||
<h1>FWDP Collaboration Project</h1> | ||
|
||
<p>Visit <a href="https://kit.svelte.dev">kit.svelte.dev</a> to read the documentation</p> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
<h1>Todos Manager here</h1> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
<h1>Users Manager Here</h1> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,118 +1,117 @@ | ||
body { | ||
background: #fff; | ||
color: #333; | ||
font-family: Lato, sans-serif; | ||
background: #fff; | ||
color: #333; | ||
font-family: Lato, sans-serif; | ||
} | ||
.container { | ||
display: block; | ||
width: 400px; | ||
margin: 100px auto 0; | ||
display: block; | ||
width: 400px; | ||
margin: 100px auto 0; | ||
} | ||
ul { | ||
margin: 0; | ||
padding: 0; | ||
margin: 0; | ||
padding: 0; | ||
} | ||
li { | ||
float: left; | ||
float: left; | ||
} | ||
li, | ||
h3 { | ||
clear: both; | ||
list-style: none; | ||
li, h3 { | ||
clear:both; | ||
list-style:none; | ||
} | ||
input, | ||
button { | ||
outline: none; | ||
input, button { | ||
outline: none; | ||
} | ||
button { | ||
background: none; | ||
border: 0px; | ||
color: #888; | ||
font-size: 15px; | ||
width: 60px; | ||
margin: 10px 0 0; | ||
font-family: Lato, sans-serif; | ||
cursor: pointer; | ||
background: none; | ||
border: 0px; | ||
color: #888; | ||
font-size: 15px; | ||
width: 60px; | ||
margin: 10px 0 0; | ||
font-family: Lato, sans-serif; | ||
cursor: pointer; | ||
} | ||
button:hover { | ||
color: #333; | ||
color: #333; | ||
} | ||
/* Heading */ | ||
|
||
h3, | ||
label[for="new-task"] { | ||
color: #333; | ||
font-weight: 700; | ||
font-size: 15px; | ||
border-bottom: 2px solid #333; | ||
padding: 30px 0 10px; | ||
margin: 0; | ||
text-transform: uppercase; | ||
label[for='new-task'] { | ||
color: #333; | ||
font-weight: 700; | ||
font-size: 15px; | ||
border-bottom: 2px solid #333; | ||
padding: 30px 0 10px; | ||
margin: 0; | ||
text-transform: uppercase; | ||
} | ||
input[type="text"] { | ||
margin: 0; | ||
font-size: 18px; | ||
line-height: 18px; | ||
height: 18px; | ||
padding: 10px; | ||
border: 1px solid #ddd; | ||
background: #fff; | ||
border-radius: 6px; | ||
font-family: Lato, sans-serif; | ||
color: #888; | ||
margin: 0; | ||
font-size: 18px; | ||
line-height: 18px; | ||
height: 18px; | ||
padding: 10px; | ||
border: 1px solid #ddd; | ||
background: #fff; | ||
border-radius: 6px; | ||
font-family: Lato, sans-serif; | ||
color: #888; | ||
} | ||
input[type="text"]:focus { | ||
color: #333; | ||
color: #333; | ||
} | ||
|
||
label[for="new-task"] { | ||
display: block; | ||
margin: 0 0 20px; | ||
label[for='new-task'] { | ||
display: block; | ||
margin: 0 0 20px; | ||
} | ||
input#new-task { | ||
float: left; | ||
width: 318px; | ||
float: left; | ||
width: 318px; | ||
} | ||
p > button:hover { | ||
color: #0fc57c; | ||
color: #0FC57C; | ||
} | ||
|
||
/* Task list */ | ||
li { | ||
overflow: hidden; | ||
padding: 20px 0; | ||
border-bottom: 1px solid #eee; | ||
overflow: hidden; | ||
padding: 20px 0; | ||
border-bottom: 1px solid #eee; | ||
} | ||
li > input[type="checkbox"] { | ||
margin: 0 10px; | ||
position: relative; | ||
top: 15px; | ||
margin: 0 10px; | ||
position: relative; | ||
top: 15px; | ||
} | ||
li > label { | ||
font-size: 18px; | ||
line-height: 40px; | ||
width: 237px; | ||
padding: 0 0 0 11px; | ||
font-size: 18px; | ||
line-height: 40px; | ||
width: 237px; | ||
padding: 0 0 0 11px; | ||
} | ||
li > input[type="text"] { | ||
width: 226px; | ||
li > input[type="text"] { | ||
width: 226px; | ||
} | ||
li > .delete:hover { | ||
color: #cf2323; | ||
color: #CF2323; | ||
} | ||
|
||
|
||
#completed-tasks label { | ||
text-decoration: line-through; | ||
color: #888; | ||
text-decoration: line-through; | ||
color: #888; | ||
} | ||
|
||
ul li input[type="text"] { | ||
display: none; | ||
display: none; | ||
} | ||
|
||
ul li.editMode input[type="text"] { | ||
display: block; | ||
display: block; | ||
} | ||
|
||
ul li.editMode label { | ||
display: none; | ||
} | ||
display: none; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,57 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<html> | ||
<head> | ||
<meta charset="UTF-8" /> | ||
<link rel="icon" type="image/svg+xml" href="/vite.svg" /> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> | ||
<title>Vite App</title> | ||
<title>Todo App</title> | ||
<link | ||
href="https://fonts.googleapis.com/css?family=Lato:300,400,700" | ||
rel="stylesheet" | ||
type="text/css" | ||
/> | ||
<link | ||
rel="stylesheet" | ||
href="css/style.css" | ||
type="text/css" | ||
media="screen" | ||
charset="utf-8" | ||
/> | ||
</head> | ||
<body> | ||
<div id="app"></div> | ||
<div class="container"> | ||
<p> | ||
<label for="new-task">Add Item</label> | ||
<input id="new-task" type="text" /> | ||
<button>Add</button> | ||
</p> | ||
|
||
<h3>Todo</h3> | ||
<ul id="incomplete-tasks"> | ||
<li> | ||
<input type="checkbox" /> | ||
<label>Pay Bills</label> | ||
<input type="text" /> | ||
<button class="edit">Edit</button> | ||
<button class="delete">Delete</button> | ||
</li> | ||
<li class="editMode"> | ||
<input type="checkbox" /> | ||
<label>Go Shopping</label> | ||
<input type="text" value="Go Shopping" /> | ||
<button class="edit">Edit</button> | ||
<button class="delete">Delete</button> | ||
</li> | ||
</ul> | ||
|
||
<h3>Completed</h3> | ||
<ul id="completed-tasks"> | ||
<li> | ||
<input type="checkbox" checked="" /> | ||
<label>See the Doctor</label> | ||
<input type="text" /> | ||
<button class="edit">Edit</button> | ||
<button class="delete">Delete</button> | ||
</li> | ||
</ul> | ||
</div> | ||
<script type="module" src="/main.js"></script> | ||
</body> | ||
</html> | ||
</html> |
Oops, something went wrong.