Skip to content

Commit

Permalink
Update index.html
Browse files Browse the repository at this point in the history
  • Loading branch information
WilliamRagstad committed Apr 7, 2024
1 parent b5d15bf commit 9758d25
Showing 1 changed file with 61 additions and 46 deletions.
107 changes: 61 additions & 46 deletions examples/todo/index.html
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>

0 comments on commit 9758d25

Please sign in to comment.