versatileWhiteJaymain.tsx3 matches
6const TMDB_API_KEY = "3fd2be6f0c70a2a598f084ddfb75487c"; // Public read-only key
7const TMDB_BASE_URL = "https://api.themoviedb.org/3";
8const TMDB_IMAGE_BASE_URL = "https://image.tmdb.org/t/p/w500";
910// Expanded list of Indian languages and alternative search terms
248>
249<img
250src={`${TMDB_IMAGE_BASE_URL}${actor.profile_path}`}
251alt={actor.name}
252style={{
284>
285<img
286src={`${TMDB_IMAGE_BASE_URL}${movie.poster_path}`}
287alt={movie.title}
288style={{
45<div align="center">
6<img src="https://imagedelivery.net/iHX6Ovru0O7AjmyT5yZRoA/67a1d35e-c37c-41a4-0e5a-03a9ba585d00/public" width="700px"/>
7</div>
isMyWebsiteDownREADME.md1 match
89<div align="center">
10<img src="https://imagedelivery.net/iHX6Ovru0O7AjmyT5yZRoA/67a1d35e-c37c-41a4-0e5a-03a9ba585d00/public" width="500px"/>
11</div>
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.
ThumbMakermain.tsx27 matches
1/**
2* This application creates a thumbnail maker using Hono for server-side routing and client-side JavaScript for image processing.
3* It allows users to upload images, specify output options, and generate a composite thumbnail image.
4* The app uses the HTML5 Canvas API for image manipulation and supports drag-and-drop functionality.
5*
6* The process is divided into two steps:
7* 1. Generating thumbnails: Users choose thumbnail size options and create individual thumbnails.
8* 2. Rendering: Users can create and export the final composite image with options for format and quality.
9* This two-step process allows changing format or quality without re-rendering the entire canvas.
10*
33<h1>Thumbnail Maker</h1>
34<div id="dropZone">
35<p>📷 Drag & drop images here or click to select</p>
36<input type="file" id="fileInput" multiple accept="image/*">
37</div>
38<div id="thumbnailOptions">
57Output Format:
58<select id="outputFormat">
59<option value="image/png">PNG</option>
60<option value="image/jpeg">JPEG</option>
61<option value="image/webp">WebP</option>
62</select>
63</label><br>
74<button id="downloadMetadataBtn">Download Metadata</button>
75</div>
76<div id="imagePreview"></div>
77</div>
78</body>
138select {
139appearance: none;
140background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M10.293 3.293L6 7.586 1.707 3.293A1 1 0 00.293 4.707l5 5a1 1 0 001.414 0l5-5a1 1 0 10-1.414-1.414z' fill='%23333'/%3E%3C/svg%3E");
141background-repeat: no-repeat;
142background-position: right 10px center;
204}
205206#imagePreview {
207margin-top: 20px;
208text-align: center;
209}
210211#imagePreview img {
212max-width: 100%;
213height: auto;
231const keepAspectRatio = document.getElementById('keepAspectRatio');
232const thumbWidth = document.getElementById('thumbWidth');
233const imagePreview = document.getElementById('imagePreview');
234const thumbnailOptions = document.getElementById('thumbnailOptions');
235const renderOptions = document.getElementById('renderOptions');
249renderOptions.style.display = 'none';
250downloadSection.style.display = 'none';
251imagePreview.innerHTML = '';
252thumbnailCanvas = null;
253thumbnailMetadata = null;
274event.preventDefault();
275dropZone.classList.remove('drag-over');
276files = Array.from(event.dataTransfer.files).filter(file => file.type.startsWith('image/'));
277resetToStep1();
278});
289progressBar.value = 0;
290291const image0 = await getImage(files[0]);
292const cols = Math.ceil(Math.sqrt(files.length));
293const rows = Math.ceil(files.length / cols);
294const tHeight = parseInt(thumbHeight.value);
295let tWidth = keepAspectRatio.checked
296? Math.floor(tHeight / image0.height * image0.width)
297: parseInt(thumbWidth.value);
298300const canvasHeight = rows * tHeight;
301302image0.revoke();
303304thumbnailCanvas = new OffscreenCanvas(canvasWidth, canvasHeight);
310const row = Math.floor(i / cols);
311312const img = await getImage(file);
313ctx.drawImage(img, col * tWidth, row * tHeight, tWidth, tHeight);
314img.revoke();
315343const blob = await thumbnailCanvas.convertToBlob({
344type: outputFormat.value,
345quality: outputFormat.value !== 'image/png' ? parseFloat(outputQuality.value) : undefined
346});
347351downloadSection.style.display = 'flex';
352353// Display the generated image
354const img = document.createElement('img');
355img.src = url;
356imagePreview.innerHTML = '';
357imagePreview.appendChild(img);
358359progressBar.style.display = 'none';
375});
376377function getImage(file) {
378return new Promise((resolve) => {
379const url = URL.createObjectURL(file);
380const img = new Image();
381img.revoke = () => URL.revokeObjectURL(url);
382img.onload = () => resolve(img);
competentOlivePeacockmain.tsx7 matches
24Category?: string;
25Tags?: string | string[];
26"Card Image"?: AirtableAttachment[];
27"Intro Image"?: AirtableAttachment[];
28"Body Image 1"?: AirtableAttachment[];
29"Body Image 2"?: AirtableAttachment[];
30"Body Image 3"?: AirtableAttachment[];
31"Quote or Emphasized Text 1"?: string;
32"Quote or Emphasized Text 2"?: string;
166<p className="mb-2">{item.fields.ShortCardText}</p>
167<p className="text-sm text-gray-600 mb-4">Read time: {item.fields.ReadTime}</p>
168{item.fields["Card Image"] && item.fields["Card Image"][0] && (
169<img
170src={item.fields["Card Image"][0].url}
171alt={item.fields.Title}
172className="w-full h-48 object-cover rounded-md mb-4"
githubParsermain.tsx4 matches
16<meta charset="UTF-8">
17<meta name="viewport" content="width=device-width, initial-scale=1.0">
18<link rel="icon" type="image/png" href="https://labspace.ai/ls2-circle.png" />
19<title>GitHub Repository Parser</title>
20<meta property="og:title" content="GitHub Repository Parser" />
21<meta property="og:description" content="Parse and analyze GitHub repositories with ease." />
22<meta property="og:image" content="https://yawnxyz-og.web.val.run/img2?link=https://gh.labspace.ai/&title=GitHub+Parser&subtitle=Parse+and+analyze+GitHub+repos&attachment=https://f2.phage.directory/blogalog/gh-parser.jpg" />
23<meta property="og:url" content="https://gh.labspace.ai" />
24<meta property="og:type" content="website" />
25<meta name="twitter:card" content="summary_large_image" />
26<meta name="twitter:title" content="GitHub Repository Parser" />
27<meta name="twitter:description" content="Parse and analyze GitHub repositories with ease." />
28<meta name="twitter:image" content="https://yawnxyz-og.web.val.run/img2?link=https://gh.labspace.ai/&title=GitHub+Parser&subtitle=Parse+and+analyze+GitHub+repos&attachment=https://f2.phage.directory/blogalog/gh-parser.jpg" />
29<script src="https://cdn.tailwindcss.com"></script>
30<script src="https://unpkg.com/dexie@3.2.2/dist/dexie.js"></script>
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
imageUploadPerMinuteWebsitemain.tsx40 matches
3import { createRoot } from "https://esm.sh/react-dom@18.2.0/client";
45// Main React component for the image upload application
6function App() {
7// State variables to manage images, error messages, upload restrictions, and comments
8const [images, setImages] = useState([]); // Stores uploaded images
9const [error, setError] = useState(null); // Stores error messages
10const [canUpload, setCanUpload] = useState(true); // Controls upload ability
11const [showComments, setShowComments] = useState(false); // Controls comment visibility
12const [comments, setComments] = useState([]); // Stores comments for images
13const [newComment, setNewComment] = useState(''); // Stores new comment input
14const [username, setUsername] = useState(''); // Stores username
19const [uploadProgress, setUploadProgress] = useState(0); // Upload progress
20const [isUploading, setIsUploading] = useState(false); // Upload in progress flag
21const [currentPage, setCurrentPage] = useState(1); // Current page of images
22const [totalPages, setTotalPages] = useState(0); // Total pages of images
2324// Load username from localStorage on component mount
25useEffect(() => {
26const storedUsername = localStorage.getItem('imageAppUsername');
27if (storedUsername) {
28setUsername(storedUsername);
31}, []);
3233// Fetch images and comments when the component first loads or page changes
34useEffect(() => {
35fetchImages();
36fetchComments();
37}, [currentPage]);
3839// Function to retrieve images from the server with pagination
40const fetchImages = async () => {
41try {
42const response = await fetch(`/images?page=${currentPage}`);
43const data = await response.json();
44setImages(data.images);
45setTotalPages(data.totalPages);
46} catch (err) {
47setError("Could not fetch images");
48console.error("Image fetch error:", err);
49}
50};
74// Validate file types and sizes
75const validFiles = files.filter(file =>
76file.type.startsWith('image/') &&
77file.size <= 5 * 1024 * 1024 // 5MB max file size
78);
108const uploadPromises = batch.map(async (file) => {
109const formData = new FormData();
110formData.append('image', file);
111formData.append('username', username);
112127}
128129// Refresh images after upload
130await fetchImages();
131
132// Reset upload states
160return (
161<div style={{ maxWidth: '800px', margin: 'auto', padding: '20px' }}>
162<h1>🖼️ Bulk Image Uploader 📸</h1>
163
164{/* Username setup (existing code) */}
177type="file"
178multiple
179accept="image/*"
180onChange={handleFileSelect}
181disabled={!isUsernameSet || isUploading}
269async function handleUpload(request, sqlite, KEY, TABLE_VERSION) {
270const formData = await request.formData();
271const image = formData.get('image') as File;
272const username = formData.get('username') as string;
273274if (!image || !(image instanceof File)) {
275return new Response(JSON.stringify({ message: "No image uploaded" }), {
276status: 400,
277headers: { 'Content-Type': 'application/json' }
279}
280281const arrayBuffer = await image.arrayBuffer();
282const base64Image = btoa(String.fromCharCode.apply(null, new Uint8Array(arrayBuffer)));
283const dataUrl = `data:${image.type};base64,${base64Image}`;
284285await sqlite.execute(`
286INSERT INTO ${KEY}_images_${TABLE_VERSION} (image_url, username) VALUES (?, ?)
287`, [dataUrl, username]);
288292}
293294async function handleGetImages(sqlite, KEY, TABLE_VERSION, page = 1, pageSize = 100) {
295const offset = (page - 1) * pageSize;
296297// Get total number of images
298const totalCountResult = await sqlite.execute(`
299SELECT COUNT(*) as total
300FROM ${KEY}_images_${TABLE_VERSION}
301`);
302const totalImages = totalCountResult.rows[0].total;
303const totalPages = Math.ceil(totalImages / pageSize);
304305// Get paginated images
306const images = await sqlite.execute(`
307SELECT id, image_url, username
308FROM ${KEY}_images_${TABLE_VERSION}
309ORDER BY uploaded_at DESC
310LIMIT ? OFFSET ?
312313return new Response(JSON.stringify({
314images: images.rows,
315totalPages: totalPages,
316currentPage: page
321322// Modify the server switch statement to pass page parameter
323case '/images':
324if (request.method !== 'GET') break;
325const url = new URL(request.url);
326const page = parseInt(url.searchParams.get('page') || '1', 10);
327return await handleGetImages(sqlite, KEY, TABLE_VERSION, page);
1415<img
16src="https://imagedelivery.net/iHX6Ovru0O7AjmyT5yZRoA/d2a422fe-8dc3-4f04-aaa3-3c35a2e99100/public"
17width="500px"
18/>
50where they can pick which way to login: email, Google, Github, etc.
5152
5354[Live Demo](https://www.val.town/v/stevekrouse/lastlogin_demo)