Val Town Code SearchReturn to Val Town

API Access

You can access search results via JSON API by adding format=json to your query:

https://codesearch.val.run/image-url.jpg%20%22Image%20title%22?q=image&page=10&format=json

For typeahead suggestions, use the /typeahead endpoint:

https://codesearch.val.run/typeahead?q=image

Returns an array of strings in format "username" or "username/projectName"

Found 7469 results for "image"(644ms)

Property_Listingindex.html19 matches

@oolufolabii•Updated 10 hours ago
64 }
65
66 .property-image {
67 height: 200px;
68 background-size: cover;
120
121 /* Property detail page */
122 .property-detail-image {
123 height: 400px;
124 background-size: cover;
308 ${properties.length > 0 ? properties.map(property => `
309 <div class="property-card">
310 <div class="property-image" style="background-image: url('${property.images && property.images.length > 0 ? property.images[0].image_url : 'https://via.placeholder.com/400x300?text=No+Image'}')"></div>
311 <div class="p-4">
312 <div class="flex justify-between items-start mb-2">
372 const propertiesGrid = document.getElementById('properties-grid');
373
374 // Fetch all properties with images
375 const response = await fetch(`${API_BASE_URL}/properties/with-images`);
376 const result = await response.json();
377
385 propertiesGrid.innerHTML = properties.length > 0 ? properties.map(property => `
386 <div class="property-card">
387 <div class="property-image" style="background-image: url('${property.images && property.images.length > 0 ? property.images[0].image_url : 'https://via.placeholder.com/400x300?text=No+Image'}')"></div>
388 <div class="p-4">
389 <div class="flex justify-between items-start mb-2">
457 propertiesGrid.innerHTML = properties.length > 0 ? properties.map(property => `
458 <div class="property-card">
459 <div class="property-image" style="background-image: url('${property.images && property.images.length > 0 ? property.images[0].image_url : 'https://via.placeholder.com/400x300?text=No+Image'}')"></div>
460 <div class="p-4">
461 <div class="flex justify-between items-start mb-2">
494 try {
495 // Fetch property details
496 const response = await fetch(`${API_BASE_URL}/properties/${propertyId}/with-images`);
497 const result = await response.json();
498
507 }
508
509 // Get primary image or first image
510 const primaryImage = property.images.find(img => img.is_primary) ||
511 (property.images.length > 0 ? property.images[0] : null);
512
513 // Render property detail page
520
521 <div class="bg-white rounded-lg shadow-md overflow-hidden mb-8">
522 <div class="property-detail-image" id="main-image" style="background-image: url('${primaryImage ? primaryImage.image_url : 'https://via.placeholder.com/800x600?text=No+Image'}')"></div>
523
524 ${property.images.length > 1 ? `
525 <div class="p-4 bg-gray-100 flex space-x-2 overflow-x-auto">
526 ${property.images.map((image, index) => `
527 <div class="thumbnail ${primaryImage && primaryImage.id === image.id ? 'active' : ''}"
528 style="background-image: url('${image.image_url}')"
529 data-image="${image.image_url}"
530 onclick="document.getElementById('main-image').style.backgroundImage = 'url(${image.image_url})';
531 document.querySelectorAll('.thumbnail').forEach(t => t.classList.remove('active'));
532 this.classList.add('active')"></div>
626 similarPropertiesContainer.innerHTML = similarProperties.length > 0 ? similarProperties.map(property => `
627 <div class="property-card">
628 <div class="property-image" style="background-image: url('${property.images && property.images.length > 0 ? property.images[0].image_url : 'https://via.placeholder.com/400x300?text=No+Image'}')"></div>
629 <div class="p-4">
630 <h3 class="text-lg font-bold mb-2">${property.title}</h3>

Property_Listingadmin.ts18 matches

@oolufolabii•Updated 10 hours ago
4 updateProperty,
5 deleteProperty,
6 addPropertyImage,
7 deletePropertyImage,
8 verifyAdminCredentials
9} from "../database/queries.ts";
193});
194
195// Add property image
196app.post("/properties/:id/images", async (c) => {
197 try {
198 const id = parseInt(c.req.param("id"));
205 }
206
207 const { imageUrl, isPrimary } = await c.req.json();
208
209 if (!imageUrl) {
210 return c.json<ApiResponse<any>>({
211 success: false,
212 error: "Image URL is required"
213 }, 400);
214 }
215
216 const imageId = await addPropertyImage(id, imageUrl, isPrimary);
217
218 return c.json<ApiResponse<{ id: number }>>({
219 success: true,
220 data: { id: imageId }
221 }, 201);
222 } catch (error) {
223 console.error("Error adding property image:", error);
224 return c.json<ApiResponse<any>>({
225 success: false,
226 error: "Failed to add property image"
227 }, 500);
228 }
229});
230
231// Delete property image
232app.delete("/images/:id", async (c) => {
233 try {
234 const id = parseInt(c.req.param("id"));
237 return c.json<ApiResponse<any>>({
238 success: false,
239 error: "Invalid image ID"
240 }, 400);
241 }
242
243 const deleted = await deletePropertyImage(id);
244
245 if (!deleted) {
246 return c.json<ApiResponse<any>>({
247 success: false,
248 error: "Image not found"
249 }, 404);
250 }
255 });
256 } catch (error) {
257 console.error("Error deleting property image:", error);
258 return c.json<ApiResponse<any>>({
259 success: false,
260 error: "Failed to delete property image"
261 }, 500);
262 }

Property_Listingproperties.ts15 matches

@oolufolabii•Updated 10 hours ago
5 getPropertiesByCategory,
6 searchProperties,
7 getPropertiesWithImages,
8 getPropertyWithImages
9} from "../database/queries.ts";
10import { ApiResponse, Property, PropertyWithImages } from "../../shared/types.ts";
11
12const app = new Hono();
29});
30
31// Get all properties with images
32app.get("/with-images", async (c) => {
33 try {
34 const properties = await getPropertiesWithImages();
35 return c.json<ApiResponse<PropertyWithImages[]>>({
36 success: true,
37 data: properties
38 });
39 } catch (error) {
40 console.error("Error fetching properties with images:", error);
41 return c.json<ApiResponse<any>>({
42 success: false,
43 error: "Failed to fetch properties with images"
44 }, 500);
45 }
80});
81
82// Get property by ID with images
83app.get("/:id/with-images", async (c) => {
84 try {
85 const id = parseInt(c.req.param("id"));
92 }
93
94 const property = await getPropertyWithImages(id);
95
96 if (!property) {
101 }
102
103 return c.json<ApiResponse<PropertyWithImages>>({
104 success: true,
105 data: property
106 });
107 } catch (error) {
108 console.error("Error fetching property with images:", error);
109 return c.json<ApiResponse<any>>({
110 success: false,
111 error: "Failed to fetch property with images"
112 }, 500);
113 }

Property_Listingtypes.ts4 matches

@oolufolabii•Updated 10 hours ago
15}
16
17export interface PropertyImage {
18 id: number;
19 property_id: number;
20 image_url: string;
21 is_primary: boolean;
22 created_at: string;
23}
24
25export interface PropertyWithImages extends Property {
26 images: PropertyImage[];
27}
28

Property_Listingqueries.ts23 matches

@oolufolabii•Updated 10 hours ago
1import { sqlite } from "https://esm.town/v/stevekrouse/sqlite";
2import { PROPERTIES_TABLE, PROPERTY_IMAGES_TABLE, ADMIN_USERS_TABLE } from "./migrations.ts";
3import { Property, PropertyImage, PropertyWithImages } from "../../shared/types.ts";
4
5// Property queries
131}
132
133// Property images queries
134export async function getPropertyImages(propertyId: number): Promise<PropertyImage[]> {
135 const result = await sqlite.execute(
136 `SELECT * FROM ${PROPERTY_IMAGES_TABLE} WHERE property_id = ? ORDER BY is_primary DESC`,
137 [propertyId]
138 );
139
140 return result.rows as PropertyImage[];
141}
142
143export async function addPropertyImage(
144 propertyId: number,
145 imageUrl: string,
146 isPrimary: boolean = false
147): Promise<number> {
148 // If this is a primary image, reset other primary images
149 if (isPrimary) {
150 await sqlite.execute(
151 `UPDATE ${PROPERTY_IMAGES_TABLE} SET is_primary = 0 WHERE property_id = ?`,
152 [propertyId]
153 );
155
156 const result = await sqlite.execute(
157 `INSERT INTO ${PROPERTY_IMAGES_TABLE} (property_id, image_url, is_primary)
158 VALUES (?, ?, ?)
159 RETURNING id`,
160 [propertyId, imageUrl, isPrimary ? 1 : 0]
161 );
162
164}
165
166export async function deletePropertyImage(id: number): Promise<boolean> {
167 const result = await sqlite.execute(
168 `DELETE FROM ${PROPERTY_IMAGES_TABLE} WHERE id = ?`,
169 [id]
170 );
173}
174
175export async function getPropertiesWithImages(): Promise<PropertyWithImages[]> {
176 const properties = await getAllProperties();
177 const propertiesWithImages: PropertyWithImages[] = [];
178
179 for (const property of properties) {
180 const images = await getPropertyImages(property.id);
181 propertiesWithImages.push({
182 ...property,
183 images
184 });
185 }
186
187 return propertiesWithImages;
188}
189
190export async function getPropertyWithImages(id: number): Promise<PropertyWithImages | null> {
191 const property = await getPropertyById(id);
192
195 }
196
197 const images = await getPropertyImages(property.id);
198
199 return {
200 ...property,
201 images
202 };
203}

Property_Listingmigrations.ts4 matches

@oolufolabii•Updated 10 hours ago
3// Table names - use these constants throughout the app
4export const PROPERTIES_TABLE = "properties_v1";
5export const PROPERTY_IMAGES_TABLE = "property_images_v1";
6export const ADMIN_USERS_TABLE = "admin_users_v1";
7
26 `);
27
28 // Property images table
29 await sqlite.execute(`
30 CREATE TABLE IF NOT EXISTS ${PROPERTY_IMAGES_TABLE} (
31 id INTEGER PRIMARY KEY AUTOINCREMENT,
32 property_id INTEGER NOT NULL,
33 image_url TEXT NOT NULL,
34 is_primary BOOLEAN DEFAULT 0,
35 created_at TEXT DEFAULT (datetime('now')),

Property_ListingREADME.md1 match

@oolufolabii•Updated 10 hours ago
6
7- Property listings with filtering by category, price, and location
8- Detailed property pages with images, descriptions, and contact options
9- WhatsApp integration for inquiries
10- Admin panel for managing property listings

testeindex.html1 match

@danielsantoseby•Updated 11 hours ago
5 <meta name="viewport" content="width=device-width, initial-scale=1.0">
6 <title>Val Town To-Do App</title>
7 <link rel="icon" href="/frontend/favicon.svg" type="image/svg+xml">
8 <!-- TailwindCSS -->
9 <script src="https://cdn.twind.style" crossorigin></script>

EEPPortalApp.tsx2 matches

@solomonferede•Updated 13 hours ago
301 >
302 <img
303 src="https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcSIGEJA8-xL8Aa9oC7Y7gFqBoICxvhebGig6ADUJYSFVEzWRD0Y5GmuhnjW6B6e11C07iE&usqp=CAU"
304 alt="EEP Portal Logo"
305 style={{
1841 <meta charset="UTF-8">
1842 <style>${css}</style>
1843 <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>">
1844 </head>
1845 <body>

ExperimentalMain.tsx2 matches

@join•Updated 13 hours ago
610{
611 "content": "The generated content as a string. For 'Blog Ideas', this should be a list of titles/concepts separated by newlines.",
612 "suggestions": "Optional brief suggestions for improving or using the content (e.g., 'Consider adding an image/video.', 'Research relevant keywords for blog posts.') as a string."
613}
614Do not include any explanatory text before or after the JSON object.`,
956 .fCA .fc:focus{color:#495057;background:#fff;border-color:#80bdff;outline:0;box-shadow:0 0 0 .2rem rgba(0,123,255,.25)}
957 .fCA textarea.fc{min-height:80px}
958 .fCA select.fc{height:38px;appearance:none;background-image:url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23343a40' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M2 5l6 6 6-6'/%3e%3c/svg%3e");background-repeat:no-repeat;background-position:right .75rem center;background-size:16px 12px;padding-right:2.25rem}
959 .fCA .aB{display:inline-block;font-weight:500;text-align:center;white-space:nowrap;vertical-align:middle;user-select:none;border:1px solid transparent;padding:.5rem 1rem;font-size:.9rem;line-height:1.5;border-radius:.25rem;transition:all .15s ease-in-out;cursor:pointer;font-family:inherit;background:#00aa65;color:#fff;border-color:#00aa65;margin-top:1rem} /* Abbreviated action-button */
960 .fCA .aB:hover{background:#008751;border-color:#007a49}

ImageExplorer10 file matches

@carmi•Updated 1 day ago

Imagetourl2 file matches

@dcm31•Updated 3 days ago
Chrimage
Atiq
"Focal Lens with Atig Wazir" "Welcome to my photography journey! I'm Atiq Wazir, a passionate photographer capturing life's beauty one frame at a time. Explore my gallery for stunning images, behind-the-scenes stories, and tips & tricks to enhance your own