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=6&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 2548 results for "image"(280ms)

stevensDemo.cursorrules2 matches

@lixP•Updated 1 day ago
187## Val Town Platform Specifics
188- **Redirects:** Use `return new Response(null, { status: 302, headers: { Location: "/place/to/redirect" }})` instead of `Response.redirect` which is broken
189- **Images:** Avoid external images or base64 images. Use emojis, unicode symbols, or icon fonts/libraries instead
190- For AI-generated images, use: `https://maxm-imggenurl.web.val.run/the-description-of-your-image`
191- **Storage:** DO NOT use the Deno KV module for storage
192- **Browser APIs:** DO NOT use the `alert()`, `prompt()`, or `confirm()` methods

stevensDemoassets.ts6 matches

@lixP•Updated 1 day ago
2 // Background
3 BACKGROUND:
4 "https://imagedelivery.net/iHX6Ovru0O7AjmyT5yZRoA/8b501664-722e-4be8-cf71-83aab7756e00/public",
5
6 // Stevens
7 STEVENS_FRONT:
8 "https://imagedelivery.net/iHX6Ovru0O7AjmyT5yZRoA/8b8432bb-add2-44ad-bb12-44b8ea215500/public",
9 STEVENS_BACK:
10 "https://imagedelivery.net/iHX6Ovru0O7AjmyT5yZRoA/e28da8ab-7710-4b82-8e32-8fdf65c2ed00/public",
11 STEVENS_WALKING:
12 "https://imagedelivery.net/iHX6Ovru0O7AjmyT5yZRoA/bd7b9997-09b2-4b35-6eb9-9975a85bb700/public",
13
14 // Mailman
15 MAILMAN_STANDING:
16 "https://imagedelivery.net/iHX6Ovru0O7AjmyT5yZRoA/20a6493d-cc31-475e-aa83-ac97d317e400/public",
17 MAILMAN_WALKING:
18 "https://imagedelivery.net/iHX6Ovru0O7AjmyT5yZRoA/61604576-8a83-4d85-d5e4-8e8e26641700/public",
19};
20

stevensDemoApp.tsx25 matches

@lixP•Updated 1 day ago
82 const [cookieAndTeaMode, setCookieAndTeaMode] = useState(false);
83
84 // Fetch images from backend instead of blob storage directly
85 useEffect(() => {
86 // Set default background color in case image doesn't load
87 if (document.body) {
88 document.body.style.backgroundColor = "#2D1700"; // Dark brown leather color
89 }
90
91 // Fetch avatar image
92 fetch("/api/images/stevens.jpg")
93 .then((response) => {
94 if (response.ok) return response.blob();
95 throw new Error("Failed to load avatar image");
96 })
97 .then((imageBlob) => {
98 const url = URL.createObjectURL(imageBlob);
99 setAvatarUrl(url);
100 })
104
105 // Fetch wood background
106 fetch("/api/images/wood.jpg")
107 .then((response) => {
108 if (response.ok) return response.blob();
109 throw new Error("Failed to load wood background");
110 })
111 .then((imageBlob) => {
112 const url = URL.createObjectURL(imageBlob);
113 setWoodUrl(url);
114
115 // Apply wood background to body
116 if (document.body) {
117 document.body.style.backgroundImage = `url(${url})`;
118 }
119 })
362 return {
363 position: SCENE_ELEMENTS.DESK_SITTING,
364 image: ASSETS.STEVENS_FRONT,
365 highlightElement: SCENE_ELEMENTS.DESK,
366 animationClass: "no-animation",
372 return {
373 position: SCENE_ELEMENTS.DESK_SITTING,
374 image: ASSETS.STEVENS_FRONT,
375 highlightElement: null,
376 animationClass: "no-animation",
387 y: SCENE_ELEMENTS.MAILBOX.y - 20,
388 },
389 image: ASSETS.STEVENS_BACK,
390 highlightElement: SCENE_ELEMENTS.MAILBOX,
391 animationClass: "walk-to-mailbox",
398 y: SCENE_ELEMENTS.CALENDAR.y + 30,
399 },
400 image: ASSETS.STEVENS_BACK,
401 highlightElement: SCENE_ELEMENTS.CALENDAR,
402 animationClass: "walk-to-calendar",
409 y: SCENE_ELEMENTS.TELEGRAM.y + 10,
410 },
411 image: ASSETS.STEVENS_BACK,
412 highlightElement: SCENE_ELEMENTS.TELEGRAM,
413 animationClass: "walk-to-telegram",
417 return {
418 position: SCENE_ELEMENTS.OUTSIDE,
419 image: ASSETS.STEVENS_FRONT,
420 highlightElement: null,
421 animationClass: "walk-to-outside",
425 return {
426 position: SCENE_ELEMENTS.DESK_SITTING,
427 image: ASSETS.STEVENS_FRONT,
428 highlightElement: SCENE_ELEMENTS.DESK,
429 animationClass: "walk-to-desk",
623 box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.4),
624 0 3px 8px rgba(0, 0, 0, 0.5);
625 image-rendering: pixelated;
626 cursor: pointer;
627 transition: transform 0.2s;
634 .notebook-pages {
635 background-color: #f8f1e0;
636 background-image: linear-gradient(#d6c6a5 1px, transparent 1px);
637 background-size: 100% 16px;
638 box-shadow: inset 0 0 8px rgba(0, 0, 0, 0.3);
639 image-rendering: pixelated;
640 }
641
652
653 .pixel-character {
654 image-rendering: pixelated;
655 position: absolute;
656 transition: left 0.7s ease-in-out, top 0.7s ease-in-out;
763 className="w-[512px] h-[512px] mx-auto relative"
764 style={{
765 backgroundImage: `url(${ASSETS.BACKGROUND})`,
766 backgroundSize: "cover",
767 backgroundPosition: "center",
768 imageRendering: "pixelated",
769 }}
770 >
799 {/* Stevens character */}
800 <img
801 src={stevensState.image}
802 alt="Stevens"
803 className={`pixel-character ${

blob_adminREADME.md1 match

@crisscrossed•Updated 1 day ago
3This is a lightweight Blob Admin interface to view and debug your Blob data.
4
5![Screenshot 2024-11-22 at 15.43.43@2x.png](https://imagedelivery.net/iHX6Ovru0O7AjmyT5yZRoA/d075a4ee-93ec-4cdd-4823-7c8aee593f00/public)
6
7To use this, fork it to your account.

blob_adminmain.tsx2 matches

@crisscrossed•Updated 1 day ago
61 const { ValTown } = await import("npm:@valtown/sdk");
62 const vt = new ValTown();
63 const { email: authorEmail, profileImageUrl, username } = await vt.me.profile.retrieve();
64 // const authorEmail = me.email;
65
129
130 c.set("email", email);
131 c.set("profile", { profileImageUrl, username });
132 await next();
133};

blob_adminapp.tsx3 matches

@crisscrossed•Updated 1 day ago
437 {profile && (
438 <div className="flex items-center space-x-4">
439 <img src={profile.profileImageUrl} alt="Profile" className="w-8 h-8 rounded-full" />
440 <span>{profile.username}</span>
441 <a href="/auth/logout" className="text-blue-400 hover:text-blue-300">Logout</a>
580 alt="Blob content"
581 className="max-w-full h-auto"
582 onError={() => console.error("Error loading image")}
583 />
584 </div>
630 <li>Create public shareable links for blobs</li>
631 <li>View and manage public folder</li>
632 <li>Preview images directly in the interface</li>
633 </ul>
634 </div>

spacexindex.tsx9 matches

@moe•Updated 1 day ago
5import { spacexCalendar } from "./spacexcalendar.ts";
6import { getChartUrl } from "./spacexchart.ts";
7import { homeImage, launchImage } from "./spaceximage.ts";
8
9const app = new Hono();
23 const v2fcframe = {
24 version: "next",
25 imageUrl: baseUrl + "/image",
26 button: {
27 title: "SpaceX Launches 🚀",
30 name: "SpaceX Launches 🚀",
31 url: baseUrl,
32 splashImageUrl: baseUrl + "/image",
33 splashBackgroundColor: "#111111",
34 },
127 "name": "SpaceX 🚀",
128 "version": "0.0.1",
129 "iconUrl": baseUrl + "/image",
130 "homeUrl": baseUrl,
131 "splashImageUrl": baseUrl + "/image",
132 "splashBackgroundColor": "#111111",
133 "webhookUrl": baseUrl + "/webhook",
172};
173
174app.get("/image", async (c) => {
175 const headers = { "Content-Type": "image/png", "cache-control": "public, max-age=86400" };
176
177 const url = new URL(c.req.url);
179
180 if (!isLaunch)
181 return c.body(await homeImage(), 200, headers);
182
183 const isPast = url.searchParams.has("past");
187 const l = launches[index];
188
189 return c.body(await launchImage(l), 200, headers);
190});
191

stevens-openaiREADME.md1 match

@yash_ing•Updated 2 days 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.

stevens-openaiREADME.md1 match

@yash_ing•Updated 2 days 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/`

stevens-openaiindex.ts15 matches

@yash_ing•Updated 2 days ago
73});
74
75// --- Blob Image Serving Routes ---
76
77// GET /api/images/:filename - Serve images from blob storage
78app.get("/api/images/:filename", async (c) => {
79 const filename = c.req.param("filename");
80
81 try {
82 // Get image data from blob storage
83 const imageData = await blob.get(filename);
84
85 if (!imageData) {
86 return c.json({ error: "Image not found" }, 404);
87 }
88
90 let contentType = "application/octet-stream"; // Default
91 if (filename.endsWith(".jpg") || filename.endsWith(".jpeg")) {
92 contentType = "image/jpeg";
93 } else if (filename.endsWith(".png")) {
94 contentType = "image/png";
95 } else if (filename.endsWith(".gif")) {
96 contentType = "image/gif";
97 } else if (filename.endsWith(".svg")) {
98 contentType = "image/svg+xml";
99 }
100
101 // Return the image with appropriate headers
102 return new Response(imageData, {
103 headers: {
104 "Content-Type": contentType,
107 });
108 } catch (error) {
109 console.error(`Error serving image ${filename}:`, error);
110 return c.json(
111 { error: "Failed to load image", details: error.message },
112 500,
113 );

bingImageOfDay4 file matches

@wolf•Updated 1 month ago

replicate_starter4 file matches

@replicate•Updated 1 month ago
Starter app for Replicate on Val Town to generate images