feat: init
This commit is contained in:
commit
7e1cecc167
9 changed files with 1854 additions and 0 deletions
templates
3
templates/counter.html
Normal file
3
templates/counter.html
Normal file
|
@ -0,0 +1,3 @@
|
|||
<h1 id="counter" class="text-6xl font-bold text-gray-800 dark:text-gray-200">
|
||||
{{ counter }}
|
||||
</h1>
|
29
templates/index.html
Normal file
29
templates/index.html
Normal file
|
@ -0,0 +1,29 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<title></title>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<script src="https://cdn.tailwindcss.com"></script>
|
||||
<script src="https://unpkg.com/htmx.org@1.9.10" integrity="sha384-D1Kt99CQMDuVetoL1lrYwg5t+9QdHe7NLX/SoJYkXDFfX37iInKRy5xLSi8nO7UC" crossorigin="anonymous"></script>
|
||||
</head>
|
||||
<body>
|
||||
<div class="flex flex-col items-center justify-center h-screen bg-gray-100 dark:bg-gray-900">
|
||||
<div class="text-center">
|
||||
{{ counter }}
|
||||
<p class="text-xl text-gray-600 dark:text-gray-400">
|
||||
Click the buttons to increase or decrease the counter
|
||||
</p>
|
||||
</div>
|
||||
<div class="mt-8 flex gap-4">
|
||||
<button hx-post="/api/increment" hx-target="#counter" class="px-4 py-2 bg-blue-500 text-white rounded hover:bg-blue-600 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-opacity-50">
|
||||
Increment
|
||||
</button>
|
||||
<button hx-post="/api/decrement" hx-target="#counter" class="px-4 py-2 bg-red-500 text-white rounded hover:bg-red-600 focus:outline-none focus:ring-2 focus:ring-red-500 focus:ring-opacity-50">
|
||||
Decrement
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue