vtProjectSearchimport.ts2 matches
35username: user.username,
36bio: user.bio,
37profile_image_url: user.profileImageUrl,
38url: user.url,
39updated_at: new Date().toISOString(), // Using current time as the API doesn't provide updated_at
53name: val.name,
54description: val.description,
55image_url: val.imageUrl,
56username: val.author.username || "",
57updated_at: mainBranch?.updatedAt || new Date().toISOString(),
vtProjectSearchcomponents.tsx15 matches
220<div className="result-header">
221<div className="result-header-content">
222{result.image_url && (
223<div className="val-image">
224<img src={result.image_url} alt={result.val_name} />
225</div>
226)}
298<div className="result-header">
299<div className="result-header-content">
300{result.image_url && (
301<div className="val-image">
302<img src={result.image_url} alt={result.name} />
303</div>
304)}
371<div className="result-header">
372<div className="user-header">
373{result.profile_image_url && (
374<div className="user-avatar">
375<img src={result.profile_image_url} alt={result.username || "User"} />
376</div>
377)}
1243<a href="?q=api" className="example-link">api</a>
1244<a href="?q=database" className="example-link">database</a>
1245<a href="?q=image" className="example-link">image</a>
1246<a href="?q=function" className="example-link">function</a>
1247<a href="?q=discord" className="example-link">discord</a>
1308<div className="contributor-header">
1309<div className="contributor-avatar">
1310{contributor.profile_image_url
1311? <img src={contributor.profile_image_url} alt={contributor.username} />
1312: (
1313<div
1357rel="noopener noreferrer"
1358>
1359<div className="val-image">
1360{val.image_url
1361? <img src={val.image_url} alt={val.name} />
1362: (
1363<div
1398<a href="?q=api" className="example-link">api</a>
1399<a href="?q=database" className="example-link">database</a>
1400<a href="?q=image" className="example-link">image</a>
1401<a href="?q=function" className="example-link">function</a>
1402<a href="?q=discord" className="example-link">discord</a>
3<source media="(prefers-color-scheme: dark)" srcset="https://mintlify.s3.us-west-1.amazonaws.com/autoblocks/logo/dark.png">
4<source media="(prefers-color-scheme: light)" srcset="https://mintlify.s3.us-west-1.amazonaws.com/autoblocks/logo/light.png">
5<img alt="Autoblocks Logo" width="300px" src="https://app.autoblocks.ai/images/logo-black.png">
6</picture>
7</p>
19status: 301,
20headers: {
21Location: user?.profileImageUrl || UnknownUserProfile,
22},
23});
notionboxddiary-import.ts2 matches
72cover: {
73external: {
74url: imageURL,
75},
76},
102103Poster: {
104files: [{ name: "Poster", external: { url: imageURL } }],
105},
106
stevensDemoREADME.md1 match
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:
45
67For 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.
stevensDemoREADME.md1 match
21## `favicon.svg`
2223As 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/).
2425## `components/`
stevensDemoindex.ts15 matches
73});
7475// --- Blob Image Serving Routes ---
7677// GET /api/images/:filename - Serve images from blob storage
78app.get("/api/images/:filename", async (c) => {
79const filename = c.req.param("filename");
8081try {
82// Get image data from blob storage
83const imageData = await blob.get(filename);
8485if (!imageData) {
86return c.json({ error: "Image not found" }, 404);
87}
8890let contentType = "application/octet-stream"; // Default
91if (filename.endsWith(".jpg") || filename.endsWith(".jpeg")) {
92contentType = "image/jpeg";
93} else if (filename.endsWith(".png")) {
94contentType = "image/png";
95} else if (filename.endsWith(".gif")) {
96contentType = "image/gif";
97} else if (filename.endsWith(".svg")) {
98contentType = "image/svg+xml";
99}
100101// Return the image with appropriate headers
102return new Response(imageData, {
103headers: {
104"Content-Type": contentType,
107});
108} catch (error) {
109console.error(`Error serving image ${filename}:`, error);
110return c.json(
111{ error: "Failed to load image", details: error.message },
112500,
113);
stevensDemoindex.html3 matches
10href="/public/favicon.svg"
11sizes="any"
12type="image/svg+xml"
13/>
14<link rel="preconnect" href="https://fonts.googleapis.com" />
36height: 100%;
37font-family: "Pixelify Sans", sans-serif;
38image-rendering: pixelated;
39}
40body::before {
50/* For pixel art aesthetic */
51* {
52image-rendering: pixelated;
53}
54</style>
stevensDemohandleUSPSEmail.ts12 matches
12}
1314type ImageSummary = {
15sender: string;
16recipient: (typeof RECIPIENTS)[number] | "both" | "other";
22anthropic: Anthropic,
23htmlContent: string,
24imageSummaries: ImageSummary[]
25) {
26try {
36text: `Analyze the following content from an email and provide a response as a JSON blob (only JSON, no other text) with two parts.
3738The email is from the USPS showing mail I'm receiving. Metadata about packages is stored directly in the email. Info about mail pieces is in images, so I've included summaries of those as well.
3940Your response should include:
66And here is info about the mail pieces:
6768${JSON.stringify(imageSummaries)}`,
69},
70],
95const anthropic = new Anthropic({ apiKey });
9697// Process each image attachment serially
98const summaries = [];
99for (const [index, attachment] of e.attachments.entries()) {
100try {
101const imageData = await attachment.arrayBuffer();
102const base64Image = btoa(
103String.fromCharCode(...new Uint8Array(imageData))
104);
105112content: [
113{
114type: "image",
115source: {
116type: "base64",
117media_type: attachment.type,
118data: base64Image,
119},
120},
148summaries.push(parsedResponse);
149} catch (error) {
150console.error(`Image analysis error:`, error);
151summaries.push({
152sender: "Error",
153recipient: "Error",
154type: "error",
155notes: `Image ${index + 1} Analysis Failed: ${error.message}`,
156});
157}