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=552&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 12680 results for "image"(3007ms)

TownieuseChatLogic.ts4 matches

@dinavinter•Updated 4 months ago
7 branchId: string | undefined;
8 selectedFiles: string[];
9 images: (string | null)[];
10 soundEnabled: boolean;
11}
17 // bearerToken,
18 selectedFiles,
19 images,
20 soundEnabled,
21}: UseChatLogicProps) {
40 branchId,
41 selectedFiles,
42 images: images
43 .filter((img): img is string => {
44 const isValid = typeof img === "string" && img.startsWith("data:");
45 if (!isValid && img !== null) {
46 console.warn(
47 "Invalid image format:",
48 img?.substring(0, 50) + "..."
49 );

TownieTODOs.md2 matches

@dinavinter•Updated 4 months ago
29 - [x] File write as a code embed
30 - [x] str_replace as a diff view
31- [x] make image drop area invisible and bigger
32- [x] Give it all the code (except maybe .txt files) as initial context (like cursor sonnet max)
33- [x] I seem to have lost the delete file tool and instructions, try to find them back in history or re-create?
55- [x] Create branch
56- [x] URL input + pathname
57- [x] Image upload controls
58- [x] Preview refresh button
59- [x] Audio controls

Towniesystem_prompt.txt2 matches

@dinavinter•Updated 4 months ago
172
173- **Redirects:** Use `return new Response(null, { status: 302, headers: { Location: "/place/to/redirect" }})` instead of `Response.redirect` which is broken
174- **Images:** Avoid external images or base64 images. Use emojis, unicode symbols, or icon fonts/libraries instead
175- **AI Image:** To inline generate an AI image use: `<img src="https://maxm-imggenurl.web.val.run/the-description-of-your-image" />`
176- **Storage:** DO NOT use the Deno KV module for storage
177- **Browser APIs:** DO NOT use the `alert()`, `prompt()`, or `confirm()` methods

Towniestyles.css11 matches

@dinavinter•Updated 4 months ago
747 background-color: var(--highlight);
748}
749.card-image {
750 display: flex;
751 align-items: center;
774}
775
776.image-placeholder,
777.image-thumbnail {
778 flex-shrink: 0;
779 width: 40px;
782 object-fit: cover;
783}
784.image-placeholder {
785 background-color: var(--muted);
786}
793}
794
795.image-row {
796 display: flex;
797 gap: var(--space-1);
798}
799.input-image {
800 position: relative;
801 border: 1px solid var(--muted);
802 border-radius: 6px;
803}
804.remove-image-button {
805 position: absolute;
806 top: 0;
815 opacity: 0;
816}
817.input-image:hover .remove-image-button {
818 opacity: 1;
819}
820
821.image-drop-overlay {
822 position: fixed;
823 top: 0;
832 justify-content: center;
833}
834.image-drop-inner {
835 padding: var(--space-2);
836 background-color: var(--background);
837}
838
839.transition, .input-box, .icon-button, .button, .remove-image-button {
840 transition-property: color, background-color, border-color, opacity;
841 transition-duration: 200ms;

Towniesend-message.ts11 matches

@dinavinter•Updated 4 months ago
26 }
27
28 const { messages, project, branchId, anthropicApiKey, selectedFiles, images } = await c.req.json();
29
30 // do we want to allow user-provided tokens still
48 branch_id: branchId,
49 val_id: project.id,
50 num_images: images?.length || 0,
51 model: "claude-3-7-sonnet-20250219",
52 });
58 let coreMessages = convertToCoreMessages(messages);
59
60 // If there are images, we need to add them to the last user message
61 if (images && Array.isArray(images) && images.length > 0) {
62 // Find the last user message
63 const lastUserMessageIndex = coreMessages.findIndex(
81 };
82
83 // Add each image to the content array using the correct ImagePart format
84 for (const image of images) {
85 if (image && image.url) {
86 // Extract mime type from data URL if available
87 let mimeType = undefined;
88 if (image.url.startsWith("data:")) {
89 const matches = image.url.match(/^data:([^;]+);/);
90 if (matches && matches.length > 1) {
91 mimeType = matches[1];
94
95 newUserMessage.content.push({
96 type: "image",
97 image: image.url,
98 mimeType,
99 });

Townieschema.tsx2 matches

@dinavinter•Updated 4 months ago
18 price?: number;
19 finish_reason?: string;
20 num_images?: number;
21 our_api_token: boolean;
22}
43 price REAL,
44 finish_reason TEXT,
45 num_images INTEGER,
46 our_api_token INTEGER NOT NULL,
47 finish_timestamp INTEGER

Townierequests.ts3 matches

@dinavinter•Updated 4 months ago
16 price: number | null;
17 finish_reason: string | null;
18 num_images: number | null;
19 our_api_token: number;
20}
191 <th>Price</th>
192 <th>Finish</th>
193 <th>Images</th>
194 <th>Our API</th>
195 </tr>
215 <td class="price">${formatPrice(row.price)}</td>
216 <td>${row.finish_reason || '-'}</td>
217 <td>${formatNumber(row.num_images)}</td>
218 <td>${formatBoolean(row.our_api_token)}</td>
219 </tr>

Towniequeries.tsx4 matches

@dinavinter•Updated 4 months ago
109 model,
110 our_api_token,
111 num_images,
112}: {
113 bearerToken: string;
116 model: string;
117 our_api_token: boolean;
118 num_images: number;
119}) {
120 const user = await getUser(bearerToken);
128 model,
129 our_api_token,
130 num_images
131 ) VALUES (?, ?, ?, ?, ?, ?, ?, ?)
132 `,
139 model,
140 our_api_token ? 1 : 0,
141 num_images,
142 ],
143 );

TownieProjectsRoute.tsx7 matches

@dinavinter•Updated 4 months ago
42 user: {
43 username: string;
44 profileImageUrl: string | null;
45 };
46 project: any;
48 return (
49 <div className="card">
50 {project.imageUrl ? (
51 <img src={project.imageUrl} className="card-image" />
52 ) : user.profileImageUrl ? (
53 <div className="card-image">
54 <img
55 src={user.profileImageUrl}
56 width="48"
57 height="48"
60 </div>
61 ) : (
62 <div className="card-image placeholder" />
63 )}
64 <div className="card-body">

TownieInputBox.tsx46 matches

@dinavinter•Updated 4 months ago
2import { useRef, useState, useEffect } from "react";
3import { PlusIcon, ArrowUpIcon, Square, XIcon } from "./icons.tsx";
4import { processFiles } from "../utils/images.ts";
5
6export function InputBox ({
11 running,
12 error,
13 images,
14 setImages,
15} : {
16 value: string;
20 running: boolean;
21 error: any;
22 images: (string|null)[];
23 setImages: (images: (string|null)[]) => void;
24}) {
25 const form = useRef(null);
57 autoFocus={true}
58 />
59 <ImageRow images={images} setImages={setImages} />
60 <div className="toolbar">
61 <UploadButton
62 disabled={running}
63 images={images}
64 setImages={setImages}
65 />
66 <div className="spacer" />
88}
89
90export function ImageDropContainer ({
91 images,
92 setImages,
93 running,
94 children,
95}: {
96 images: (string|null)[];
97 setImages: (images: (string|null)[]) => void;
98 running: boolean;
99 children: React.ReactNode;
100}) {
101 const dragging = useImageDrop({ images, setImages, running });
102
103 return (
105 {children}
106 {dragging && (
107 <div className="image-drop-overlay">
108 <div className="image-drop-inner">
109 Drop images here to upload
110 </div>
111 </div>
115}
116
117export function useImageDrop ({ images, setImages, running }: {
118 images: (string|null)[];
119 setImages(images: (string|null)[]) => void;
120 running: boolean;
121}) {
143 setDragging(false);
144 if (e.dataTransfer?.files && !running) {
145 processFiles(Array.from(e.dataTransfer.files), images, setImages);
146 }
147 }
164}
165
166function ImageRow ({ images, setImages }: {
167 images: (string|null)[];
168 setImages: (images: (string|null)[]) => void;
169}) {
170 return (
171 <div className="image-row">
172 {images.map((image, i) => (
173 <Thumbnail
174 key={i}
175 image={image}
176 onRemove={() => {
177 setImages([
178 ...images.slice(0, i),
179 ...images.slice(i + 1),
180 ]);
181 }}
186}
187
188function Thumbnail ({ image, onRemove }: {
189 image: string|null;
190 onRemove: () => void;
191}) {
192 if (!image) return null;
193
194 return (
195 <div className="input-image">
196 <img
197 src={image}
198 alt="User uploaded image"
199 className="image-thumbnail"
200 />
201 <button
202 type="button"
203 title="Remove image"
204 className="remove-image-button"
205 onClick={onRemove}
206 >
212
213function UploadButton ({
214 images,
215 setImages,
216 disabled,
217}: {
218 images: (string|null)[];
219 setImages: (images: (string|null)[]) => void;
220 disabled: boolean;
221}) {
226 <button
227 type="button"
228 title="Upload image"
229 disabled={disabled}
230 onClick={e => {
234 <PlusIcon />
235 <div className="sr-only">
236 Upload image
237 </div>
238 </button>
243 onChange={e => {
244 if (e.target.files) {
245 processFiles(Array.from(e.target.files), images, setImages);
246 }
247 }}

ImageThing

@refactorized•Updated 2 days ago

Gemini-Image-Banana-012 file matches

@aibotcommander•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