-
Notifications
You must be signed in to change notification settings - Fork 1
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
1 parent
b5d15bf
commit 9758d25
Showing
1 changed file
with
61 additions
and
46 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,55 +1,70 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
|
||
<head> | ||
<title>Document</title> | ||
<script src="https://unpkg.com/htmx.org@1.9.4"></script> | ||
<link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon.png"> | ||
<link rel="icon" type="image/png" sizes="32x32" href="/favicon-32x32.png"> | ||
<link rel="icon" type="image/png" sizes="16x16" href="/favicon-16x16.png"> | ||
<link rel="manifest" href="/site.webmanifest"> | ||
<link rel="mask-icon" href="/safari-pinned-tab.svg" color="#5bbad5"> | ||
<meta name="msapplication-TileColor" content="#ffffff"> | ||
<meta name="theme-color" content="#ffffff"> | ||
<title>Document</title> | ||
<script src="https://unpkg.com/htmx.org@1.9.4"></script> | ||
</head> | ||
|
||
<body> | ||
<div class="container"> | ||
<h1>A Web<font color="#2262dc">X</font> todo list</h1> | ||
<p>Welcome! Here is a list of things to do:</p> | ||
<ul id="todo-list" hx-get="/todos/list" hx-trigger="load" hx-swap="outerHTML">Loading...</ul> | ||
|
||
<form hx-post="/todos/add" hx-target="#todo-list" hx-swap="afterend"> | ||
<input name="title" placeholder="Add a new item" type="text" required> | ||
<button>Add</button> | ||
</form> | ||
</div> | ||
<div class="container"> | ||
<h1>A Web<font color="#2262dc">X</font> todo list</h1> | ||
<p>Welcome! Here is a list of things to do:</p> | ||
<ul id="todo-list" hx-get="/todos/list" hx-trigger="load" hx-swap="outerHTML">Loading...</ul> | ||
|
||
<form hx-post="/todos/add" hx-target="#todo-list" hx-swap="afterend"> | ||
<input name="title" placeholder="Add a new item" type="text" required> | ||
<button>Add</button> | ||
</form> | ||
</div> | ||
</body> | ||
<style> | ||
body { | ||
font-family: Roboto, sans-serif; | ||
margin: 0; | ||
height: 100vh; | ||
background: #f9f9f9; | ||
} | ||
.container { | ||
padding: 1em 4em; | ||
max-width: 30em; | ||
margin: 0 auto; | ||
height: 100%; | ||
box-sizing: border-box; | ||
border: 1px solid #ccc; | ||
background: white; | ||
} | ||
ul { | ||
list-style: none; | ||
padding: 0; | ||
} | ||
li { | ||
padding: 0.5em; | ||
border-bottom: 1px solid #ccc; | ||
} | ||
input { | ||
padding: 0.5em; | ||
border: 1px solid #ccc; | ||
border-radius: 0.25em; | ||
} | ||
button { | ||
padding: 0.5em; | ||
border: 1px solid #ccc; | ||
border-radius: 0.25em; | ||
background: #eee; | ||
} | ||
body { | ||
font-family: Roboto, sans-serif; | ||
margin: 0; | ||
height: 100vh; | ||
background: #f9f9f9; | ||
} | ||
|
||
.container { | ||
padding: 1em 4em; | ||
max-width: 30em; | ||
margin: 0 auto; | ||
height: 100%; | ||
box-sizing: border-box; | ||
border: 1px solid #ccc; | ||
background: white; | ||
} | ||
|
||
ul { | ||
list-style: none; | ||
padding: 0; | ||
} | ||
|
||
li { | ||
padding: 0.5em; | ||
border-bottom: 1px solid #ccc; | ||
} | ||
|
||
input { | ||
padding: 0.5em; | ||
border: 1px solid #ccc; | ||
border-radius: 0.25em; | ||
} | ||
|
||
button { | ||
padding: 0.5em; | ||
border: 1px solid #ccc; | ||
border-radius: 0.25em; | ||
background: #eee; | ||
} | ||
</style> | ||
|
||
</html> |