12 const progress = calculateProgress(campaign.current_amount, campaign.target_amount);
13
14 // Default image if none provided
15 const imageUrl = campaign.image_url || "https://maxm-imggenurl.web.val.run/medical-hospital-patient-treatment-illustration";
16
17 return (
19 <div className="relative">
20 <img
21 src={imageUrl}
22 alt={campaign.title}
23 className="w-full h-48 object-cover"
14
15 <!-- Favicon -->
16 <link rel="icon" href="data:image/svg+xml,<svg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 100 100%22><text y=%22.9em%22 font-size=%2290%22>🏥</text></svg>">
17
18 <!-- Custom styles -->
28 target_amount: number;
29 current_amount: number;
30 image_url?: string;
31 is_verified: boolean;
32 is_active: boolean;
48 hospital_name?: string;
49 target_amount: number;
50 image_url?: string;
51}
52
47 const result = await sqlite.execute(
48 `INSERT INTO ${CAMPAIGNS_TABLE}
49 (title, description, patient_name, medical_condition, hospital_name, target_amount, image_url, creator_id)
50 VALUES (?, ?, ?, ?, ?, ?, ?, ?)
51 RETURNING id`,
57 campaign.hospital_name,
58 campaign.target_amount,
59 campaign.image_url,
60 campaign.creator_id
61 ]
32 target_amount INTEGER NOT NULL,
33 current_amount INTEGER NOT NULL DEFAULT 0,
34 image_url TEXT,
35 is_verified BOOLEAN NOT NULL DEFAULT 0,
36 is_active BOOLEAN NOT NULL DEFAULT 1,
59const unitSelect = document.getElementById('unit');
60const saveButton = document.getElementById('save-plan');
61const exportButton = document.getElementById('export-image');
62const clearAllButton = document.getElementById('clear-all');
63const planNameInput = document.getElementById('plan-name');
176 saveButton.addEventListener('click', savePlan);
177
178 // Export as image
179 exportButton.addEventListener('click', exportAsImage);
180
181 // Clear all
893 try {
894 // Generate thumbnail
895 const thumbnail = canvas.toDataURL('image/png');
896
897 // Prepare data to save
1037}
1038
1039// Export the current plan as an image
1040function exportAsImage() {
1041 // Create a temporary canvas with white background
1042 const tempCanvas = document.createElement('canvas');
1068
1069 // Copy the current canvas content
1070 tempCtx.drawImage(canvas, 0, 0);
1071
1072 // Create download link
1073 const link = document.createElement('a');
1074 link.download = 'house-plan.png';
1075 link.href = tempCanvas.toDataURL('image/png');
1076 link.click();
1077}
4 position: relative;
5 background-color: #f8f8f8;
6 background-image:
7 linear-gradient(rgba(200, 200, 200, 0.5) 1px, transparent 1px),
8 linear-gradient(90deg, rgba(200, 200, 200, 0.5) 1px, transparent 1px);
90 <input type="text" id="plan-name" placeholder="Plan Name" class="border p-2 rounded">
91 <button id="save-plan" class="bg-blue-500 hover:bg-blue-600 text-white p-2 rounded">Save Plan</button>
92 <button id="export-image" class="bg-green-500 hover:bg-green-600 text-white p-2 rounded mt-2">Export as Image</button>
93 </div>
94 </div>
8- Add furniture and fixtures
9- Save and load your designs
10- Export designs as images
11
12## Project Structure
18 SUM(cache_write_tokens) as total_cache_write_tokens,
19 SUM(price) as total_price,
20 SUM(num_images) as total_images
21 FROM ${USAGE_TABLE}
22 WHERE our_api_token = 1
101 total_cache_write_tokens: userData.cache_write_tokens,
102 total_price: userData.price,
103 total_images: 0,
104 used_inference_data: true
105 });