ListeningToLastFMmain.tsx1 match
23const trackName = track.name;
24const artist = track.artist["#text"];
25const artwork = track.image ? track.image[track.image.length - 1]["#text"] : null;
2627return Response.json({ trackName, artist, artwork });
cerebras_codermain.tsx1 match
1165<meta property="og:description" content="Turn your ideas into fully functional apps in less than a second – powered by Llama3.3-70b on Cerebras's super-fast wafer chips. Code is 100% open-source, hosted on Val Town."">
1166<meta property="og:type" content="website">
1167<meta property="og:image" content="https://stevekrouse-blob_admin.web.val.run/api/public/CerebrasCoderOG.jpg">
1168
1169
1/** @jsxImportSource https://esm.sh/react@18.2.0 */
2import { Calendar, Heart, Image, Mail, Music } from "https://esm.sh/lucide-react@latest";
3import { nanoid } from "https://esm.sh/nanoid@4.0.0";
4import { createRoot } from "https://esm.sh/react-dom@18.2.0/client";
11name: "Romantic Classic",
12description: "Elegant design with beautiful animations and love counter",
13previewImage: "https://maxm-imggenurl.web.val.run/romantic-classic",
14features: ["Love Counter", "Music Player", "Photo Gallery", "Love Letter"],
15},
18name: "Modern Love Story",
19description: "Contemporary design with timeline and story features",
20previewImage: "https://maxm-imggenurl.web.val.run/modern-story",
21features: ["Timeline View", "Story Cards", "Photo Grid", "Music Integration"],
22},
25name: "Vintage Romance",
26description: "Nostalgic design with romantic elements and memories",
27previewImage: "https://maxm-imggenurl.web.val.run/vintage-romance",
28features: ["Memory Wall", "Love Journal", "Classic Design", "Photo Album"],
29},
191musicUrl: "",
192musicThumbnail: "",
193images: [],
194});
195const [generatedUrl, setGeneratedUrl] = useState(null);
224}
225};
226const handleImageUpload = async (e) => {
227const files = Array.from(e.target.files);
228229if (files.length > 6) {
230alert("Maximum 6 images allowed");
231return;
232}
233234try {
235const base64Images = await Promise.all(files.map(fileToBase64));
236237setFormData(prev => ({
238...prev,
239images: base64Images,
240}));
241} catch (error) {
242console.error("Image upload error", error);
243alert("Failed to upload images");
244}
245};
310>
311<img
312src={template.previewImage}
313alt={template.name}
314className="w-full h-48 object-cover rounded-lg mb-4"
401type="file"
402multiple
403accept="image/*"
404onChange={handleImageUpload}
405className="w-full px-3 py-2 border rounded-md focus:outline-pink-500"
406/>
407<div className="flex flex-wrap gap-2 mt-2">
408{formData.images.map((img, index) => (
409<img
410key={index}
493music_thumbnail TEXT,
494template_type TEXT NOT NULL,
495images TEXT NOT NULL,
496created_at DATETIME DEFAULT CURRENT_TIMESTAMP
497)
510musicUrl,
511musicThumbnail,
512images,
513shareableId,
514template,
526`
527INSERT INTO ${KEY}_love_templates_${SCHEMA_VERSION}
528(shareable_id, partner_name, start_date, love_letter, music_url, music_thumbnail, template_type, images)
529VALUES (?, ?, ?, ?, ?, ?, ?, ?)
530`,
537musicThumbnail || "",
538template,
539JSON.stringify(images),
540],
541);
582583const websiteData = result.rows[0];
584const parsedImages = JSON.parse(websiteData.images);
585586return new Response(
673<!-- Memory Gallery -->
674${
675parsedImages.length > 0
676? `
677<div class="mt-6 fade-in">
679<div class="grid grid-cols-3 gap-4 mt-4">
680${
681parsedImages.map(img => `
682<div class="overflow-hidden rounded-lg shadow-md">
683<img src="${img}" class="w-full h-32 object-cover transition-transform hover:scale-110" />
731// Fetch paginated records
732const result = await sqlite.execute(`
733SELECT shareable_id, partner_name, start_date, love_letter, music_url, music_thumbnail, template_type, images, created_at
734FROM ${KEY}_love_templates_${SCHEMA_VERSION}
735ORDER BY created_at DESC
767<th>Music Thumbnail</th>
768<th>Template Type</th>
769<th>Images</th>
770<th>Created At</th>
771</tr>
783<td><img src="${row.music_thumbnail}" alt="Thumbnail" width="50"></td>
784<td>${row.template_type}</td>
785<td>${row.images ? `<img src="${row.images}" width="50">` : "No Image"}</td>
786<td>${row.created_at}</td>
787</tr>`;
835}
836</style>
837<link rel="icon" href="data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'><text y='28' font-size='28'>🌹</text></svg>">
838</head>
839<body>
9export interface ModelCapabilities {
10textToText: boolean;
11imageGeneration: boolean;
12multimodal: boolean;
13reasoning: boolean;
LlmDashboardllm-provider-gemini13 matches
14candidate_count?: number;
15// For multimodal inputs
16image_base64?: string;
17}
1831capabilities: {
32textToText: true,
33imageGeneration: false,
34multimodal: false,
35reasoning: true,
59capabilities: {
60textToText: true,
61imageGeneration: false,
62multimodal: true,
63reasoning: true,
94const content: Record<string, unknown> = { text: msg.content };
9596// Handle multimodal content if image is provided in provider params
97if (msg.role === "user" && this.currentImageBase64) {
98content.inlineData = {
99mimeType: "image/jpeg",
100data: this.currentImageBase64,
101};
102}
106}
107108// Store current image for multimodal requests
109private currentImageBase64: string | null = null;
110111async complete(
119}
120121// Store image for multimodal processing if provided
122this.currentImageBase64 = config?.providerParams?.image_base64 || null;
123124// Note: This is a placeholder as Val Town doesn't have a native Google AI client
147const result = await response.json();
148149// Clear stored image after request
150this.currentImageBase64 = null;
151152// Approximate token count based on characters
LlmDashboardllm-provider-anthropic2 matches
26capabilities: {
27textToText: true,
28imageGeneration: false,
29multimodal: true,
30reasoning: true,
54capabilities: {
55textToText: true,
56imageGeneration: false,
57multimodal: true,
58reasoning: true,
LlmDashboardllm-provider-openai2 matches
51capabilities: {
52textToText: true,
53imageGeneration: false,
54multimodal: false,
55reasoning: true,
80capabilities: {
81textToText: true,
82imageGeneration: false,
83multimodal: true,
84reasoning: true,
2import { createRoot } from "https://esm.sh/react-dom@18.2.0/client";
3import React, { useEffect, useRef, useState } from "https://esm.sh/react@18.2.0";
4import { RandomPositionImage } from "./random_position_image";
5import { TextArt } from "./text_art";
6import { generateStaticHTML } from "./generate_static_html";
8function App() {
9const [urls, setUrls] = useState([]);
10const [imagePositions, setImagePositions] = useState([]);
11const [valentineName, setValentineName] = useState("");
12const [message, setMessage] = useState("");
16try {
17const params = new URLSearchParams({
18image: "5",
19gif: "3",
20stock_image: "3",
21});
22const response = await fetch(`/image?${params.toString()}`, {
23method: "GET",
24});
76height: "100vh",
77width: "100vw",
78backgroundImage: "url('https://shouser-blob_admin.web.val.run/api/public/pink_gradient_background.jpg')",
79backgroundSize: "cover",
80backgroundPosition: "center",
194textShadow: "1px 1px 0px #000000",
195}}>
196♪ drag text & images! ♪
197</div>
198</div>
199200{urls.map((url, index) => (
201<RandomPositionImage
202key={`img-${index}`}
203imageUrl={url}
204existingPositions={imagePositions.slice(0, index)}
205/>
206))}
210key={`text-${index}`}
211text={text}
212existingPositions={imagePositions}
213/>
214))}
2console.log("generatestatichtml");
3// Get the main container
4const container = document.querySelector("div[style*=\"backgroundImage\"]");
5if (!container) return;
622height: 100vh;
23width: 100vw;
24background-image: url('https://shouser-blob_admin.web.val.run/api/public/pink_gradient_background.jpg');
25background-size: cover;
26background-position: center;
33`;
3435// Get all images and text elements
36const elements = container.querySelectorAll("div[style*=\"position: absolute\"]");
374142if (img) {
43// It's an image element
44html += ` <div style="
45position: absolute;
49height: ${el.style.height};
50">
51<img src="${img.src}" alt="Valentine Image" style="
52width: 100%;
53height: 100%;
2import React, { useEffect, useRef, useState } from "https://esm.sh/react@18.2.0";
34export function RandomPositionImage({
5imageUrl = "https://maxm-imggenurl.web.val.run/random-colorful-abstract-shape",
6existingPositions = [],
7}) {
8const [position, setPosition] = useState({ top: 0, left: 0 });
9const [size, setSize] = useState({ width: 250, height: 250 });
10const [imageLoaded, setImageLoaded] = useState(false);
11const [isDragging, setIsDragging] = useState(false);
12const [dragOffset, setDragOffset] = useState({ x: 0, y: 0 });
113width: `${size.width}`,
114height: `auto`,
115opacity: imageLoaded ? 1 : 0,
116transition: isDragging ? "none" : "opacity 0.3s ease-in-out",
117cursor: isDragging ? "grabbing" : "grab",
121<img
122ref={imgRef}
123src={imageUrl}
124alt="Random Generated Image"
125onLoad={() => setImageLoaded(true)}
126style={{
127width: "100%",