summaryrefslogtreecommitdiff
path: root/web/templates/shopping-mode.html
diff options
context:
space:
mode:
authorPeter Stone <thepeterstone@gmail.com>2026-01-26 19:00:36 -1000
committerPeter Stone <thepeterstone@gmail.com>2026-01-26 19:00:36 -1000
commit70e6e51b6781a3986c51e3496b81c88665286872 (patch)
tree091d0eb9daa08f4e892486451a154a67fb8a3cfe /web/templates/shopping-mode.html
parentbbf12fc441ca36c423e865107d34df178e3d26de (diff)
Add shopping mode for focused single-store shopping (#34)
- Full-screen view for one store at a time - Tap items to toggle completion - Completed items greyed and sorted to bottom - Quick-add form at bottom of screen - Store switcher pills for easy navigation - "Shop" button on each store in shopping tab Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Diffstat (limited to 'web/templates/shopping-mode.html')
-rw-r--r--web/templates/shopping-mode.html93
1 files changed, 93 insertions, 0 deletions
diff --git a/web/templates/shopping-mode.html b/web/templates/shopping-mode.html
new file mode 100644
index 0000000..9e21ac6
--- /dev/null
+++ b/web/templates/shopping-mode.html
@@ -0,0 +1,93 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+ <meta charset="UTF-8">
+ <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no">
+ <title>{{.StoreName}} - Shopping</title>
+ <link rel="icon" type="image/svg+xml" href="/static/favicon.svg">
+ <link rel="stylesheet" href="/static/css/output.css">
+ <script src="/static/js/htmx.min.js"></script>
+ <style>
+ body {
+ background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
+ min-height: 100vh;
+ margin: 0;
+ padding: 0;
+ }
+ .item-row {
+ transition: all 0.2s ease;
+ }
+ .item-row:active {
+ transform: scale(0.98);
+ background: rgba(255,255,255,0.15);
+ }
+ .item-checked {
+ opacity: 0.5;
+ }
+ .item-checked .item-name {
+ text-decoration: line-through;
+ color: rgba(255,255,255,0.4);
+ }
+ .store-switcher {
+ scrollbar-width: none;
+ -ms-overflow-style: none;
+ }
+ .store-switcher::-webkit-scrollbar {
+ display: none;
+ }
+ </style>
+</head>
+<body class="text-white">
+ <!-- Header -->
+ <header class="sticky top-0 z-50 bg-black/40 backdrop-blur-lg border-b border-white/10">
+ <div class="flex items-center justify-between px-4 py-3">
+ <a href="/?tab=shopping" class="text-white/70 hover:text-white p-2 -ml-2">
+ <svg class="w-6 h-6" fill="none" stroke="currentColor" viewBox="0 0 24 24">
+ <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M15 19l-7-7 7-7"></path>
+ </svg>
+ </a>
+ <h1 class="text-lg font-semibold">{{.StoreName}}</h1>
+ <div class="w-10"></div>
+ </div>
+
+ <!-- Store Switcher -->
+ {{if gt (len .StoreNames) 1}}
+ <div class="store-switcher flex gap-2 px-4 pb-3 overflow-x-auto">
+ {{range .StoreNames}}
+ <a href="/shopping/mode/{{.}}"
+ class="px-3 py-1.5 rounded-full text-sm whitespace-nowrap transition-colors
+ {{if eq . $.StoreName}}bg-white/20 text-white{{else}}bg-white/5 text-white/60 hover:bg-white/10{{end}}">
+ {{.}}
+ </a>
+ {{end}}
+ </div>
+ {{end}}
+ </header>
+
+ <!-- Items List -->
+ <main class="p-4" id="shopping-items">
+ {{template "shopping-mode-items" .}}
+ </main>
+
+ <!-- Quick Add Form (Fixed at Bottom) -->
+ <div class="fixed bottom-0 left-0 right-0 bg-black/60 backdrop-blur-lg border-t border-white/10 p-4">
+ <form hx-post="/shopping/add"
+ hx-target="#shopping-items"
+ hx-swap="innerHTML"
+ hx-on::after-request="this.reset()"
+ class="flex gap-2">
+ <input type="hidden" name="store" value="{{.StoreName}}">
+ <input type="hidden" name="mode" value="shopping-mode">
+ <input type="text" name="name" placeholder="Add item..."
+ class="flex-1 bg-white/10 border border-white/20 rounded-lg px-4 py-3 text-white placeholder-white/40 focus:outline-none focus:ring-2 focus:ring-white/30"
+ required autocomplete="off">
+ <button type="submit" class="bg-white/20 hover:bg-white/30 text-white px-5 py-3 rounded-lg font-medium transition-colors">
+ Add
+ </button>
+ </form>
+ </div>
+
+ <!-- Spacer for fixed bottom form -->
+ <div class="h-24"></div>
+</body>
+</html>