multiplayerCirclesREADME.md1 match
3Move circles around. State is synced with the server. Open a window in another tab and watch the circles update as you move them .
45
6
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
OpenTowniesystem_prompt.txt2 matches
18* Response.redirect is broken. Use `return new Response(null, { status: 302, headers: { Location: "/place/to/redirect" }})`
1920* Avoid external images or base64 images, use emojis, unicode symtols, or icon fonts/libraries instead, unless that's not practical for the user's request (e.g. if they ask for a particular animated gif).
2122* If you want an AI generated image, use https://maxm-imggenurl.web.val.run/the-description-of-your-image to dynamically generate one.
2324* DO NOT use the Deno KV module for storage.
importProjectFileREADME.md1 match
789
10
MrIdentifymain.tsx18 matches
45function App() {
6const [image, setImage] = useState<File | null>(null);
7const [result, setResult] = useState<string | null>(null);
8const [error, setError] = useState<string | null>(null);
910const handleImageUpload = async (e: React.ChangeEvent<HTMLInputElement>) => {
11const file = e.target.files?.[0];
12if (file) {
13setImage(file);
14setResult(null);
15setError(null);
1819const identifyMovie = async () => {
20if (!image) return;
2122const formData = new FormData();
23formData.append('image', image);
2425try {
51<input
52type="file"
53accept="image/*"
54onChange={handleImageUpload}
55style={{marginBottom: '15px'}}
56/>
57{image && (
58<div>
59<img
60src={URL.createObjectURL(image)}
61alt="Uploaded"
62style={{maxWidth: '100%', maxHeight: '300px', marginBottom: '15px'}}
110
111const formData = await request.formData();
112const imageFile = formData.get('image') as File;
113
114if (!imageFile) {
115return new Response(JSON.stringify({ error: 'No image uploaded' }), {
116status: 400,
117headers: { 'Content-Type': 'application/json' }
119}
120121const imageBytes = await imageFile.arrayBuffer();
122const base64Image = btoa(
123String.fromCharCode(...new Uint8Array(imageBytes))
124);
125135},
136{
137type: "image_url",
138image_url: { url: `data:image/jpeg;base64,${base64Image}` }
139}
140]
152} catch (error) {
153console.error(error);
154return new Response(JSON.stringify({ error: 'Image processing failed' }), {
155status: 500,
156headers: { 'Content-Type': 'application/json' }
urgentVoicemailAppmain.tsx2 matches
45function LandingPage() {
6const [imageUrl] = useState(`https://maxm-imggenurl.web.val.run/young-girl-tech-entrepreneur-cartoon-style-holding-smartphone-and-gadgets`);
78// Replace this with the actual URL of your voicemail val
35}}>
36<img
37src={imageUrl}
38alt="Girl with Tech Gadgets"
39style={{
1011<div align="center">
12<img src="https://imagedelivery.net/iHX6Ovru0O7AjmyT5yZRoA/67a1d35e-c37c-41a4-0e5a-03a9ba585d00/public" width="500px"/>
13</div>
earthquakesmain.tsx1 match
52"<svg xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" version=\"1.1\" ",
53),
54{ headers: { "Content-Type": "image/svg+xml" } },
55)
56: new Response(
lockfileImportMapREADME.md2 matches
234
56Use an import map to make sure your Val frontend and backend are always using the exact same versions.
22You can see that the `"https://esm.sh/react"` import imports the version directly without any redirects. Saving on network hops and also ensuring version stability!
2324<p><img width=400 src="https://imagedelivery.net/iHX6Ovru0O7AjmyT5yZRoA/38d61d0a-0dee-42de-dd44-b4ce9bd57000/public" /></p>
2526
1314let TIME_LIMIT = 10;
15let CHALLENGE_IMAGES: Challenge[] = [];
1617const capitalize = (str: string) => {
23switch (category) {
24case "bicycle":
25CHALLENGE_IMAGES.push({
26src: `https://dapper-halva-6db681.netlify.app/Bicycle/Bicycle%20(${i + 1}).png`,
27category,
3031case "palm":
32CHALLENGE_IMAGES.push({
33src: `https://dapper-halva-6db681.netlify.app/Palm/Palm%20(${i + 1}).png`,
34category,
3738case "hydrant":
39CHALLENGE_IMAGES.push({
40src: `https://dapper-halva-6db681.netlify.app/Hydrant/Hydrant%20(${i + 1}).png`,
41category,
4445case "crosswalk":
46CHALLENGE_IMAGES.push({
47src: `https://dapper-halva-6db681.netlify.app/Crosswalk/Cross%20(${i + 1}).png`,
48category,
73function App() {
74const [challenge, setChallenge] = useState(generateChallenge());
75const [selectedImages, setSelectedImages] = useState<number[]>([]);
76const [score, setScore] = useState(0);
77const [timeLeft, setTimeLeft] = useState(TIME_LIMIT);
98const targetCategory = randomCategory();
99return {
100prompt: `Select all images with ${targetCategory}s`,
101category: targetCategory,
102};
103}
104105function handleImageClick(index: number) {
106if (gameState !== "playing") return;
107108setSelectedImages(prev =>
109prev.includes(index)
110? prev.filter(i => i !== index)
116if (gameState !== "playing") return;
117118const correctSelections = CHALLENGE_IMAGES.slice(0, 9)
119.map((img, index) => img.category === challenge.category ? index : -1)
120.filter(i => i !== -1);
121122const isCorrect = correctSelections.every(ci => selectedImages.includes(ci))
123&& selectedImages.every(si => correctSelections.includes(si));
124125if (isCorrect) {
126setScore(prev => prev + 10);
127shuffle(CHALLENGE_IMAGES);
128setChallenge(generateChallenge());
129setSelectedImages([]);
130setTimeLeft(Math.max(10, TIME_LIMIT - Math.floor(score / 50)));
131} else {
160setTimeLeft(TIME_LIMIT);
161setGameState("playing");
162shuffle(CHALLENGE_IMAGES);
163setChallenge(generateChallenge());
164setSelectedImages([]);
165setSubmissionResult({});
166}
299</div>
300<div className="grid grid-cols-3 gap-5 lg:pl-6">
301{CHALLENGE_IMAGES.slice(0, 9).map((img, index) => (
302<img
303key={index}
304onClick={() => handleImageClick(index)}
305className={`
306text-6xl
312duration-200
313${
314selectedImages.includes(index)
315? "border-green-500 bg-green-100"
316: "border-gray-300 bg-white hover:bg-gray-50"