shop.tonybtw.com
shop.tonybtw.com
https://git.tonybtw.com/shop.tonybtw.com.git
git://git.tonybtw.com/shop.tonybtw.com.git
Add Stripe checkout integration, HTMX interactivity, and JetBrains Mono/Iosevka fonts
Diff
diff --git a/.envrc b/.envrc
index 3550a30..3b11770 100644
--- a/.envrc
+++ b/.envrc
@@ -1 +1,2 @@
use flake
+dotenv
diff --git a/internal/views/cart.templ b/internal/views/cart.templ
index 9311911..31a6a59 100644
--- a/internal/views/cart.templ
+++ b/internal/views/cart.templ
@@ -15,7 +15,6 @@ templ Cart(items []models.Cart_Item_Detail, total int, cart_count int) {
<a href="/checkout" class="btn-primary">Checkout</a>
</div>
}
- @Cart_Widget(cart_count)
}
}
diff --git a/internal/views/checkout.templ b/internal/views/checkout.templ
index 19adaf7..5bb3012 100644
--- a/internal/views/checkout.templ
+++ b/internal/views/checkout.templ
@@ -28,13 +28,10 @@ templ Checkout(items []models.Cart_Item_Detail, total int, csrf_token string, ca
</tfoot>
</table>
</div>
-
<p>You'll be redirected to Stripe to complete your purchase.</p>
-
<form action="/checkout/create" method="POST">
<input type="hidden" name="csrf_token" value={ csrf_token }/>
<button type="submit" class="btn-primary">Continue to Payment</button>
</form>
- @Cart_Widget(cart_count)
}
}
diff --git a/internal/views/home.templ b/internal/views/home.templ
index 322da76..fb42954 100644
--- a/internal/views/home.templ
+++ b/internal/views/home.templ
@@ -14,6 +14,5 @@ templ Home(products []models.Product, cart_count int) {
</a>
}
</div>
- @Cart_Widget(cart_count)
}
}
diff --git a/internal/views/layout.templ b/internal/views/layout.templ
index 7d842e7..29ad2ff 100644
--- a/internal/views/layout.templ
+++ b/internal/views/layout.templ
@@ -3,29 +3,29 @@ package views
templ Layout(title string) {
<!DOCTYPE html>
<html lang="en">
- <head>
- <meta charset="UTF-8"/>
- <meta name="viewport" content="width=device-width, initial-scale=1.0"/>
- <title>{ title }</title>
- <link rel="stylesheet" href="/static/style.css"/>
- <script src="https://unpkg.com/htmx.org@2.0.0"></script>
- <script defer src="https://cdn.jsdelivr.net/npm/alpinejs@3.x.x/dist/cdn.min.js"></script>
- </head>
- <body>
- <header>
- <nav>
- <a href="/" class="logo">shop.tonybtw.com</a>
- <div id="cart-widget" hx-swap-oob="true">
- @Cart_Widget(0)
- </div>
- </nav>
- </header>
- <main>
- { children... }
- </main>
- <footer>
- <p>© 2026 tonybtw. All rights reserved.</p>
- </footer>
- </body>
+ <head>
+ <meta charset="UTF-8"/>
+ <meta name="viewport" content="width=device-width, initial-scale=1.0"/>
+ <title>{ title }</title>
+ <link rel="stylesheet" href="/static/style.css"/>
+ <script src="https://unpkg.com/htmx.org@2.0.0"></script>
+ <script defer src="https://cdn.jsdelivr.net/npm/alpinejs@3.x.x/dist/cdn.min.js"></script>
+ </head>
+ <body>
+ <header>
+ <nav>
+ <a href="/" class="logo">shop.tonybtw.com</a>
+ <div id="cart-widget" hx-swap-oob="true">
+ @Cart_Widget(0)
+ </div>
+ </nav>
+ </header>
+ <main>
+ { children... }
+ </main>
+ <footer>
+ <p>tonybtw</p>
+ </footer>
+ </body>
</html>
}
diff --git a/internal/views/product.templ b/internal/views/product.templ
index 1100ddf..bdec511 100644
--- a/internal/views/product.templ
+++ b/internal/views/product.templ
@@ -13,10 +13,8 @@ templ Product(product models.Product, variants []models.Variant, cart_count int)
<h1>{ product.Name }</h1>
<p class="product-price">{ Format_Price(product.Price) }</p>
<p class="product-description">{ product.Description }</p>
-
<form hx-post="/cart/add" hx-target="#cart-widget" hx-swap="outerHTML">
<input type="hidden" name="product_id" value={ templ.EscapeString(fmt.Sprintf("%d", product.ID)) }/>
-
<label for="variant_id">Size:</label>
<select name="variant_id" id="variant_id" required>
for _, variant := range variants {
@@ -25,18 +23,15 @@ templ Product(product models.Product, variants []models.Variant, cart_count int)
</option>
}
</select>
-
<label for="quantity">Quantity:</label>
<select name="quantity" id="quantity">
for i := 1; i <= 10; i++ {
<option value={ templ.EscapeString(fmt.Sprintf("%d", i)) }>{ templ.EscapeString(fmt.Sprintf("%d", i)) }</option>
}
</select>
-
<button type="submit" class="btn-primary">Add to Cart</button>
</form>
</div>
</div>
- @Cart_Widget(cart_count)
}
}
diff --git a/public/static/fonts/IosevkaNerdFont-Bold.ttf b/public/static/fonts/IosevkaNerdFont-Bold.ttf
new file mode 100644
index 0000000..22f5cc5
Binary files /dev/null and b/public/static/fonts/IosevkaNerdFont-Bold.ttf differ
diff --git a/public/static/fonts/IosevkaNerdFontMono-Regular.ttf b/public/static/fonts/IosevkaNerdFontMono-Regular.ttf
new file mode 100644
index 0000000..a41104c
Binary files /dev/null and b/public/static/fonts/IosevkaNerdFontMono-Regular.ttf differ
diff --git a/public/static/fonts/JetBrainsMonoNerdFontMono-Bold.ttf b/public/static/fonts/JetBrainsMonoNerdFontMono-Bold.ttf
new file mode 100644
index 0000000..a03c26b
Binary files /dev/null and b/public/static/fonts/JetBrainsMonoNerdFontMono-Bold.ttf differ
diff --git a/public/static/fonts/JetBrainsMonoNerdFontMono-Regular.ttf b/public/static/fonts/JetBrainsMonoNerdFontMono-Regular.ttf
new file mode 100644
index 0000000..f693474
Binary files /dev/null and b/public/static/fonts/JetBrainsMonoNerdFontMono-Regular.ttf differ
diff --git a/public/static/style.css b/public/static/style.css
index 799becb..73cba66 100644
--- a/public/static/style.css
+++ b/public/static/style.css
@@ -1,3 +1,31 @@
+@font-face {
+ font-family: 'Iosevka Nerd';
+ src: url('/static/fonts/IosevkaNerdFontMono-Regular.ttf') format('truetype');
+ font-weight: 400;
+ font-style: normal;
+}
+
+@font-face {
+ font-family: 'Iosevka Nerd';
+ src: url('/static/fonts/IosevkaNerdFont-Bold.ttf') format('truetype');
+ font-weight: 700;
+ font-style: normal;
+}
+
+@font-face {
+ font-family: 'JetBrains Mono Nerd';
+ src: url('/static/fonts/JetBrainsMonoNerdFontMono-Regular.ttf') format('truetype');
+ font-weight: 400;
+ font-style: normal;
+}
+
+@font-face {
+ font-family: 'JetBrains Mono Nerd';
+ src: url('/static/fonts/JetBrainsMonoNerdFontMono-Bold.ttf') format('truetype');
+ font-weight: 700;
+ font-style: normal;
+}
+
:root {
--bg: #0a0a0a;
--bg-secondary: #111111;
@@ -18,7 +46,7 @@
}
body {
- font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Helvetica Neue", Arial, sans-serif;
+ font-family: 'JetBrains Mono Nerd', 'Iosevka Nerd', monospace;
background: var(--bg);
color: var(--text);
line-height: 1.6;