42document.getElementById('productForm').addEventListener('submit', saveProduct);
43
44// Auto-generate AI image URL
45const imageUrlInput = document.querySelector('input[name="imageUrl"]');
46const nameInput = document.querySelector('input[name="name"]');
47const colorsInput = document.querySelector('input[name="colors"]');
48const beadStyleSelect = document.querySelector('select[name="beadStyle"]');
49
50function generateAIImageUrl() {
51const name = nameInput.value.toLowerCase().replace(/\s+/g, '-');
52const colors = colorsInput.value.toLowerCase().replace(/\s+/g, '-').replace(/,/g, '-');
53const style = beadStyleSelect.value;
54
55if (name && !imageUrlInput.value.startsWith('http')) {
56const description = `${name}-${colors}-${style}-beaded-bag`.replace(/--+/g, '-');
57imageUrlInput.value = `https://maxm-imggenurl.web.val.run/${description}`;
58}
59}
60
61nameInput.addEventListener('blur', generateAIImageUrl);
62colorsInput.addEventListener('blur', generateAIImageUrl);
63beadStyleSelect.addEventListener('change', generateAIImageUrl);
64}
6588<td class="py-3 px-4">
89<div class="flex items-center space-x-3">
90<img src="${product.image_url}" alt="${product.name}"
91class="w-12 h-12 object-cover rounded"
92onerror="this.src='https://maxm-imggenurl.web.val.run/beaded-bag-placeholder'">
176form.colors.value = product.colors || '';
177form.beadStyle.value = product.bead_style || 'glass';
178form.imageUrl.value = product.image_url || '';
179form.category.value = product.category || 'bags';
180form.inStock.checked = product.in_stock;
205colors: formData.get('colors'),
206beadStyle: formData.get('beadStyle'),
207imageUrl: formData.get('imageUrl'),
208category: formData.get('category'),
209inStock: formData.get('inStock') === 'on'
Beadebagproducts.ts3 matches
72try {
73const body = await c.req.json();
74const { name, description, price, image_url, category, in_stock = true } = body;
75
76if (!name || !description || !price || !image_url || !category) {
77const response: ApiResponse<number> = {
78success: false,
86description,
87price: parseFloat(price),
88image_url,
89category,
90in_stock
beadedbagadmin.html3 matches
232
233<div class="md:col-span-2">
234<label class="block text-sm font-medium text-gray-700 mb-1">Image URL</label>
235<input type="url" name="imageUrl" placeholder="https://example.com/image.jpg or use AI: description-of-your-bag" class="w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-purple-500">
236<p class="text-xs text-gray-500 mt-1">For AI-generated images, just describe your bag (e.g., "elegant-silver-beaded-clutch")</p>
237</div>
238
Beadebagqueries.ts5 matches
11description: row.description,
12price: row.price,
13image_url: row.image_url,
14category: row.category,
15in_stock: Boolean(row.in_stock),
28description: row.description,
29price: row.price,
30image_url: row.image_url,
31category: row.category,
32in_stock: Boolean(row.in_stock),
42description: row.description,
43price: row.price,
44image_url: row.image_url,
45category: row.category,
46in_stock: Boolean(row.in_stock),
51export async function createProduct(product: Omit<Product, 'id' | 'created_at'>): Promise<number> {
52const result = await sqlite.execute(
53`INSERT INTO ${PRODUCTS_TABLE} (name, description, price, image_url, category, in_stock) VALUES (?, ?, ?, ?, ?, ?)`,
54[product.name, product.description, product.price, product.image_url, product.category, product.in_stock ? 1 : 0]
55);
56return result.lastInsertRowid;
62<div class="product-card">
63<div class="aspect-w-1 aspect-h-1 w-full">
64<img src="${product.image_url}" alt="${product.name}"
65class="w-full h-64 object-cover"
66onerror="this.src='https://maxm-imggenurl.web.val.run/elegant-beaded-bag-placeholder'">
115name: product.name,
116price: product.price,
117image_url: product.image_url,
118quantity: 1
119});
169cartItems.innerHTML = cart.map(item => `
170<div class="flex items-center space-x-4 mb-4 pb-4 border-b">
171<img src="${item.image_url}" alt="${item.name}" class="w-16 h-16 object-cover rounded">
172<div class="flex-1">
173<h4 class="font-medium text-sm">${item.name}</h4>
6description: string;
7price: number;
8image_url: string;
9category: string;
10in_stock: boolean;
5## Features
67- **Product Catalog**: Browse beautiful beaded bags with detailed descriptions and images
8- **Shopping Cart**: Add/remove items, adjust quantities, view totals
9- **Customer Orders**: Place orders with contact information
67- description (TEXT)
68- price (REAL)
69- image_url (TEXT)
70- category (TEXT)
71- in_stock (BOOLEAN)
3Feel free to mess around with this val and make it your own :). Just click on "Fork" in the top right.
45You can change the phrases that show up as you click no, you can change the firstImg and secondImg, maybe even add more images. And you can also change the colors and any of the text on the screen!
67Have fun with it and hopefully your crush says yes hehe.
MidigoSportCentreindex.html1 match
8
9<!-- Favicon -->
10<link rel="icon" type="image/svg+xml" href="/frontend/logo.svg">
11
12<!-- TailwindCSS -->
F_managerindex.html1 match
7<script src="https://cdn.twind.style" crossorigin></script>
8<script src="https://esm.town/v/std/catch"></script>
9<link rel="icon" href="data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'><text y='.9em' font-size='90'>💰</text></svg>">
10<style>
11.chart-container {