Townie-Al2Header.tsx2 matches
7374function Avatar ({ user }) {
75if (!user?.profileImageUrl) {
76return (
77<div className="avatar" />
81return (
82<img
83src={user.profileImageUrl}
84alt={user.username}
85width="32"
Townie-Al2favicon.http.tsx1 match
10return new Response(svg, {
11headers: {
12"Content-Type": "image/svg+xml",
13},
14});
Townie-Al2dashboard.ts3 matches
12total_price: number;
13inference_price: number;
14total_images: number;
15used_inference_data?: boolean;
16}
44<th>Total Price</th>
45<th>Inference Price</th>
46<th>Images</th>
47</tr>
48</thead>
59<td class="price">${formatPrice(row.total_price)} ${row.used_inference_data ? '<span class="badge badge-info" title="Using inference data">I</span>' : ''}</td>
60<td class="price">${formatPrice(row.inference_price || 0)}</td>
61<td>${formatNumber(row.total_images)}</td>
62</tr>
63`).join("")}
Townie-Al2.cursorrules2 matches
178179- **Redirects:** Use `return new Response(null, { status: 302, headers: { Location: "/place/to/redirect" }})` instead of `Response.redirect` which is broken
180- **Images:** Avoid external images or base64 images. Use emojis, unicode symbols, or icon fonts/libraries instead
181- **AI Image:** To inline generate an AI image use: `<img src="https://maxm-imggenurl.web.val.run/the-description-of-your-image" />`
182- **Storage:** DO NOT use the Deno KV module for storage
183- **Browser APIs:** DO NOT use the `alert()`, `prompt()`, or `confirm()` methods
Townie-Al2ChatRouteSingleColumn.tsx15 matches
10import { useCreditBalance } from "../hooks/useCreditBalance.tsx";
11import { Messages } from "./Messages.tsx";
12import { InputBox, ImageDropContainer } from "./InputBox.tsx";
13import { PreviewFrame } from "./PreviewFrame.tsx";
14import { BranchSelect } from "./BranchSelect.tsx";
68refetch: () => void;
69}) {
70const [images, setImages] = useState<(string|null)[]>([]);
71const [selectedFiles, setSelectedFiles] = useState<string[]>([]);
72const { audio, user } = useContext(AppContext);
88branchId,
89selectedFiles,
90images,
91soundEnabled: audio,
92});
137138return (
139<ImageDropContainer
140running={running}
141images={images}
142setImages={setImages}>
143<div className="single-column-container">
144<div className="single-sticky-header">
148rel="norefferer"
149className="block-link text-link lockup">
150{project.imageUrl ? (
151<img src={project.imageUrl} className="image-thumbnail" />
152) : user?.profileImageUrl ? (
153<img
154src={user.profileImageUrl}
155className="avatar"
156alt={user.username}
159/>
160) : (
161<div className="image-placeholder" />
162)}
163<div>{project.name}</div>
211onSubmit={e => {
212handleSubmit(e);
213setImages([]);
214}}
215onCancel={handleStop}
216running={running}
217error={error}
218images={images}
219setImages={setImages}
220/>
221)}
223</div>
224</div>
225</ImageDropContainer>
226);
227}
Welcome-to-Valwelcome.ts2 matches
28<meta name="viewport" content="width=device-width, initial-scale=1.0">
29<title>Welcome to Val Town Powered Website</title>
30<link rel="icon" href="https://www.val.town/favicon.svg?dot=false" type="image/svg+xml">
31<link rel="preconnect" href="https://fonts.googleapis.com">
32<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
267<!-- Upper Section: Greeting -->
268<section class="header-section">
269<img src="https://sanuja.biz/images/favicon.webp" alt="Logo" class="logo">
270<h1 class="greeting" id="greeting-text">Hello, ${sanitizedName}!</h1>
271<p style="color: var(--text-secondary);">Welcome to this Val Town powered website.</p>
NowPlayingGrabbermain.tsx8 matches
39if (response.status > 400) {
40const shortenedName = "Error (Forbidden)";
41const image = "/assets/spotify.svg";
42return { shortenedName, image };
43} else if (response.status === 204) {
44const shortenedName = "Currently Not Playing";
45const image = "/assets/spotify.svg";
46return { shortenedName, image };
47}
4849const song = await response.json();
50const image = song.item.album.images[0].url;
51const artistNames = song.item.artists.map(a => a.name);
52const link = song.item.external_urls.spotify;
65formattedArtist,
66artistLink,
67image,
68};
69} catch (error) {
70const shortenedName = "Error";
71const image = "/assets/spotify.svg";
72return { shortenedName, image };
73}
74};
Parse-my-PDF-01main.tsx1 match
32send("text", {
33text:
34"Failed to extract text from PDF. The file may be corrupted or image-based.",
35});
36send("done", {});
html-siteindex.html4 matches
31/>
32<meta property="og:site_name" content="into.md" />
33<meta property="og:image" content="https://into.md/og-image.png" />
3435<!-- Twitter -->
36<meta name="twitter:card" content="summary_large_image" />
37<meta name="twitter:url" content="https://into.md/" />
38<meta
44content="Convert any webpage to clean markdown format. Prefix any URL with into.md/ for instant conversion."
45/>
46<meta name="twitter:image" content="https://into.md/og-image.png" />
4748<link rel="icon" href="/favicon.ico" />
194195.link-underline {
196background-image: linear-gradient(currentColor, currentColor);
197background-position: 0 100%;
198background-repeat: no-repeat;
Gemini-Nano-Bananamain.tsx23 matches
1// deno-lint-ignore no-unused-vars
2async function handleImageGeneration(
3{ prompt, send }: { prompt: string; send: SendEventFn },
4) {
5try {
6send("text", { text: "🎨 Generating image..." });
78// Validate inputs
29parts: [
30{
31text: `Generate an image: ${prompt}`,
32},
33],
35],
36generationConfig: {
37responseModalities: ["TEXT", "IMAGE"],
38temperature: 0.7,
39maxOutputTokens: 2048,
5960console.error(
61`Image generation failed: ${response.status} - ${errorText}`,
62);
637576send("error", {
77text: `Failed to generate image: ${errorMessage}`,
78allow_retry: true,
79});
103send("error", {
104text:
105"Image generation was blocked due to safety filters. Try rephrasing your prompt to avoid potentially harmful content.",
106allow_retry: true,
107});
136}
137138let hasImage = false;
139let hasText = false;
140145hasText = true;
146} else if (part.inlineData?.data) {
147// Handle base64 image data
148const imageData = part.inlineData.data;
149const mimeType = part.inlineData.mimeType || "image/png";
150151// Validate base64 data more thoroughly
152if (
153!imageData || typeof imageData !== "string" || imageData.length === 0
154) {
155console.error("Invalid image data:", part.inlineData);
156continue;
157}
160try {
161// Check if it's valid base64
162atob(imageData);
163} catch (base64Error) {
164console.error("Invalid base64 image data:", base64Error);
165continue;
166}
168send("text", {
169text:
170`\n\nImage generated successfully!`,
171});
172hasImage = true;
173}
174}
175176// Provide feedback based on what was received
177if (!hasImage && !hasText) {
178send("error", {
179text:
181allow_retry: true,
182});
183} else if (!hasImage && hasText) {
184send("text", {
185text:
186"Note: Only text was generated, no image was produced. You may want to try a different prompt.",
187});
188}
189} catch (error) {
190console.error("Image generation error:", error);
191192// More specific error messages based on error type
193let errorMessage = "Image generation failed";
194195if (error instanceof TypeError) {
206errorMessage = "Request was cancelled or timed out - please try again";
207} else if (error.message) {
208errorMessage = `Image generation failed: ${error.message}`;
209}
210