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/...?q=image&page=8&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 9911 results for "image"(2633ms)

65 type: itemCategory, // Verwende hier die Kategorie, die Teachable Machine liefert
66 wardrobe_item_id: wardrobeItem ? wardrobeItem.id : null,
67 // Optional: imageUrl: wardrobeItem ? wardrobeItem.imageUrl : null,
68 // Wenn du Bilder der vorgeschlagenen Items im Frontend anzeigen willst,
69 // müsste diese Information hier mitgegeben und im Frontend verarbeitet werden.

fashionWardrobefashionWardrobe.tsx7 matches

@kaltesommer•Updated 1 day ago
11 * Fügt ein Kleidungsstück zum Kleiderschrank des Benutzers hinzu.
12 * Wird vom Frontend aufgerufen, wenn ein Benutzer ein Bild hochlädt.
13 * @param {string} imageUrl - Die Base64-kodierte Data URL des Bildes.
14 * @param {string} description - Eine kurze, vom Benutzer eingegebene Beschreibung des Kleidungsstücks (z.B. "Blaues T-Shirt").
15 * @returns {Promise<any>} Das gespeicherte Kleidungsstück-Objekt.
16 */
17export async function addWardrobeItem(imageUrl: string, description: string) {
18 if (!imageUrl || !description || description.trim() === "") {
19 throw new Error("imageUrl und description sind erforderlich.");
20 }
21 const item = {
22 id: crypto.randomUUID(), // Generiert eine eindeutige ID für jedes Kleidungsstück.
23 userId: USER_ID, // Weist das Item dem aktuellen Benutzer zu.
24 imageUrl: imageUrl, // Speichert die Bild-URL.
25 description: description.trim(), // Speichert die bereinigte Beschreibung.
26 timestamp: new Date().toISOString(), // Speichert den Zeitpunkt des Uploads.
65 if (req.method === "POST") {
66 try {
67 const { imageUrl, description } = await req.json();
68 const newItem = await addWardrobeItem(imageUrl, description);
69 // Erfolgreiche Antwort mit dem neuen Item.
70 return new Response(JSON.stringify(newItem), { status: 201, headers: { "Content-Type": "application/json" } });

tanstackReactHonoExampleindex.html1 match

@laurynas•Updated 1 day ago
6 <title>React Hono Val Town Starter</title>
7 <script src="https://cdn.tailwindcss.com"></script>
8 <link rel="icon" href="/public/favicon.svg" sizes="any" type="image/svg+xml">
9 </head>
10 <body class="bg-gray-100 font-sans">

tanstackReactHonoExampleREADME.md1 match

@laurynas•Updated 1 day ago
3It's common to have code and types that are needed on both the frontend and the backend. It's important that you write this code in a particularly defensive way because it's limited by what both environments support:
4
5![shapes at 25-02-25 11.57.13.png](https://imagedelivery.net/iHX6Ovru0O7AjmyT5yZRoA/75db1d51-d9b3-45e0-d178-25d886c10700/public)
6
7For example, you *cannot* use the `Deno` keyword. For imports, you can't use `npm:` specifiers, so we reccomend `https://esm.sh` because it works on the server & client. You *can* use TypeScript because that is transpiled in `/backend/index.ts` for the frontend. Most code that works on the frontend tends to work in Deno, because Deno is designed to support "web-standards", but there are definitely edge cases to look out for.

tanstackReactHonoExampleREADME.md1 match

@laurynas•Updated 1 day ago
21## `favicon.svg`
22
23As of this writing Val Town only supports text files, which is why the favicon is an SVG and not an .ico or any other binary image format. If you need binary file storage, check out [Blob Storage](https://docs.val.town/std/blob/).
24
25## `components/`

SethGodinNewBlogPostNotifierREADME.md1 match

@lanly•Updated 1 day ago
1# New Blog Post - Email Notifier
2Want to follow a blog but don't use RSS feeds? Try this val, originally [created by saltcod](https://www.val.town/x/saltcod/SethGodinBlogEmail)!
3![Screenshot 2025-06-06 at 11.52.15 AM.png](https://imagedelivery.net/iHX6Ovru0O7AjmyT5yZRoA/90bf066e-695e-40ea-6fbc-43fe53c31000/public)
4
5## Usage instructions

log-media-request-headersimage.tsx0 matches

@eeeps•Updated 1 day ago

thehost-mapboxscript.js21 matches

@ncf•Updated 1 day ago
20 map.on("load", function() {
21 // Ajout de l'icône custom PNG blanc (hébergée sur Webflow, doit être blanc pur sur fond transparent)
22 map.loadImage(
23 "https://cdn.prod.website-files.com/680b45cea1d474e42a333f71/6849450d1f21ddfdce96b8bd_Vector.png",
24 (error, image) => {
25 if (error) throw error;
26 if (!map.hasImage("custom-marker")) {
27 map.addImage("custom-marker", image, { sdf: true });
28 }
29
80 mapLocations.features = [];
81 locationItems.forEach((item, idx) => {
82 // Récupère l'URL de l'image principale de la card
83 let image = item.getAttribute("data-image");
84 if (!image) {
85 const imgEl = item.querySelector(".image-card-results");
86 if (imgEl) {
87 image = imgEl.getAttribute("src");
88 }
89 }
90 if (!image) {
91 image = "https://uploads-ssl.webflow.com/placeholder.jpg";
92 }
93 const lat = parseFloat(item.getAttribute("data-lat"));
110 name: name,
111 city: city,
112 image: image,
113 description: description,
114 url: url,
158 <div id="popup-close-btn-${feature.id}" class="popup-close-btn"></div>
159 <div class="popup-content-inner">
160 <div class="popup-image">
161 <img src="${feature.properties.image}" loading="lazy" alt="${feature.properties.name}" class="popup-image">
162 </div>
163 <div class="popup-title">${feature.properties.name}</div>
277 const newFeatures = [];
278 visibleItems.forEach((item, idx) => {
279 let image = item.getAttribute("data-image");
280 if (!image) {
281 const imgEl = item.querySelector(".image-card-results");
282 if (imgEl) {
283 image = imgEl.getAttribute("src");
284 }
285 }
286 if (!image) {
287 image = "https://uploads-ssl.webflow.com/placeholder.jpg"; // Mets ici l'URL de ton image par défaut
288 }
289 const lat = parseFloat(item.getAttribute("data-lat"));
310 name: name,
311 city: city,
312 image: image,
313 description: description,
314 url: url,

html2svgmain.tsx13 matches

@g•Updated 1 day ago
3 * It uses a textarea for HTML input and a button to trigger the conversion.
4 * To calculate the required SVG dimensions, it renders the input HTML into an off-screen div and measures its bounding box.
5 * The resulting SVG, containing the HTML in a <foreignObject>, is then displayed in four formats: raw SVG code, an SVG data URL, an HTML <img> tag, and a Markdown image link.
6 */
7import { serve } from "https://esm.town/v/g/serveUtils";
39
40 <div class="output-group">
41 <label>3. HTML Image Preview</label>
42 <div id="outputImageContainer"></div>
43 <label for="outputImageCode">HTML <code><img></code> Code</label>
44 <textarea id="outputImageCode" readonly rows="3"></textarea>
45 </div>
46
127 margin-bottom: 8px;
128 }
129 #outputImageContainer {
130 padding: 15px;
131 border: 1px dashed #ccc;
148 const outputSvgCode = document.getElementById("outputSvgCode");
149 const outputDataUrl = document.getElementById("outputDataUrl");
150 const outputImageContainer = document.getElementById("outputImageContainer");
151 const outputImageCode = document.getElementById("outputImageCode");
152 const outputMarkdown = document.getElementById("outputMarkdown");
153
190
191 // 3. Create the various output formats
192 const svgDataUrl = `data:image/svg+xml;base64,${btoa(unescape(encodeURIComponent(svgString)))}`;
193 const htmlImgTag = `<img src="${svgDataUrl}" alt="Generated from HTML" width="${width}" height="${height}">`;
194 const markdown = `![Generated Image](${svgDataUrl})`;
195
196 // 4. Display the outputs
200 outputDataUrl.value = svgDataUrl;
201
202 outputImageContainer.innerHTML = htmlImgTag;
203 outputImageCode.value = htmlImgTag;
204
205 outputMarkdown.value = markdown;
206 });
207
208 [outputSvgCode, outputDataUrl, outputImageCode, outputMarkdown].forEach(textarea => {
209 textarea.addEventListener('click', () => {
210 textarea.select();

basic-html-starterindex.html1 match

@ianyang•Updated 1 day ago
11
12 <!-- reference the webpage's favicon. note: currently only svg is supported in val town files -->
13 <link rel="icon" href="/favicon.svg" sizes="any" type="image/svg+xml">
14
15 <!-- import the webpage's javascript file -->
compare-images

compare-images2 file matches

@eeeps•Updated 2 days ago
Compare two images and show some metadata about ’em

pdf-image1 file match

@stevekrouse•Updated 2 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