resumeHandlermain.tsx1 match
17<meta name="viewport" content="width=device-width, initial-scale=1.0">
18<title>hello, resume</title>
19<link rel="icon" href="data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'><text y='50%' font-size='24' text-anchor='middle' x='50%' dy='.3em'>📄</text></svg>">
20<style>
21${helloResume}
blob_adminREADME.md1 match
3This is a lightweight Blob Admin interface to view and debug your Blob data.
45
67Use this button to install the val:
16You can try a demo at <https://pomdtr-lastloginhonoexample.web.val.run> (see @pomdtr/lastLoginHonoExample for code)
1718
1920## Usage
lastlogin_demoREADME.md1 match
12
3
234
56Live demo: https://stevekrouse-lastlogin_demo.web.val.run/
sqliteExplorerAppREADME.md1 match
3View and interact with your Val Town SQLite data. It's based off Steve's excellent [SQLite Admin](https://www.val.town/v/stevekrouse/sqlite_admin?v=46) val, adding the ability to run SQLite queries directly in the interface. This new version has a revised UI and that's heavily inspired by [LibSQL Studio](https://github.com/invisal/libsql-studio) by [invisal](https://github.com/invisal). This is now more an SPA, with tables, queries and results showing up on the same page.
45
67## Install
test_migratedmain.tsx1 match
97const svg = render(badge);
9899return new Response(svg, { headers: { "Content-Type": "image/svg+xml;charset=utf-8" } });
100}
10* Create a [Val Town API token](https://www.val.town/settings/api), open the browser preview of this val, and use the API token as the password to log in.
1112<img width=500 src="https://imagedelivery.net/iHX6Ovru0O7AjmyT5yZRoA/7077d1b5-1fa7-4a9b-4b93-f8d01d3e4f00/public"/>
memeGeneratormain.tsx27 matches
1/**
2* This meme creation tool app will allow users to create memes by selecting an image and adding top and bottom text.
3* We'll use HTML5 Canvas to render the meme directly in the browser, with custom positioning for different meme templates.
4*/
35}, []);
3637const getTextPositions = (imageWidth: number, imageHeight: number, templateId: string): [TextPosition, TextPosition] => {
38const defaultColor = "white";
39switch (templateId) {
40case "1": // Drake
41return [
42{ x: imageWidth * 0.7, y: imageHeight * 0.25, maxWidth: imageWidth * 0.5, color: "black" },
43{ x: imageWidth * 0.7, y: imageHeight * 0.75, maxWidth: imageWidth * 0.5, color: "black" }
44];
45case "2": // Distracted Boyfriend
46return [
47{ x: imageWidth * 0.6, y: imageHeight * 0.1, maxWidth: imageWidth * 0.3, color: defaultColor },
48{ x: imageWidth * 0.8, y: imageHeight * 0.1, maxWidth: imageWidth * 0.3, color: defaultColor }
49];
50case "3": // Two Buttons
51return [
52{ x: imageWidth * 0.5, y: imageHeight * 0.1, maxWidth: imageWidth * 0.8, color: defaultColor },
53{ x: imageWidth * 0.5, y: imageHeight * 0.9, maxWidth: imageWidth * 0.8, color: defaultColor }
54];
55case "4": // Expanding Brain
56return [
57{ x: imageWidth * 0.5, y: imageHeight * 0.15, maxWidth: imageWidth * 0.8, color: defaultColor },
58{ x: imageWidth * 0.5, y: imageHeight * 0.95, maxWidth: imageWidth * 0.8, color: defaultColor }
59];
60case "5": // Change My Mind
61return [
62{ x: imageWidth * 0.5, y: imageHeight * 0.7, maxWidth: imageWidth * 0.8, color: defaultColor },
63{ x: imageWidth * 0.5, y: imageHeight * 0.9, maxWidth: imageWidth * 0.8, color: defaultColor }
64];
65default:
66return [
67{ x: imageWidth * 0.5, y: imageHeight * 0.1, maxWidth: imageWidth * 0.9, color: defaultColor },
68{ x: imageWidth * 0.5, y: imageHeight * 0.9, maxWidth: imageWidth * 0.9, color: defaultColor }
69];
70}
78if (!ctx) return;
7980const selectedImage = templates.find(t => t.id === selectedTemplate);
81if (!selectedImage) return;
8283const image = new Image();
84image.crossOrigin = "anonymous";
85image.onload = () => {
86canvas.width = image.width;
87canvas.height = image.height;
88ctx.drawImage(image, 0, 0);
8990const fontSize = Math.floor(image.height / 15);
91ctx.font = `bold ${fontSize}px Impact, sans-serif`;
92ctx.textAlign = "center";
9394const [topPosition, bottomPosition] = getTextPositions(image.width, image.height, selectedTemplate);
9596// Function to draw text with word wrap
131setMemeUrl(canvas.toDataURL());
132};
133image.src = selectedImage.url;
134};
135164</form>
165<canvas ref={canvasRef} style={{ display: 'none' }}></canvas>
166{memeUrl && <img src={memeUrl} alt="Generated Meme" className="meme-image" />}
167<p>
168<a href={import.meta.url.replace("esm.town", "val.town")} target="_blank">View Source</a>
247background-color: #45a049;
248}
249.meme-image {
250max-width: 100%;
251display: block;
QRCodeScannermain.tsx3 matches
71canvas.height = video.videoHeight;
72canvas.width = video.videoWidth;
73context.drawImage(video, 0, 0, canvas.width, canvas.height);
74const imageData = context.getImageData(0, 0, canvas.width, canvas.height);
75addDebug(`Scanning frame: ${canvas.width}x${canvas.height}`);
76const code = jsQR(imageData.data, imageData.width, imageData.height);
7778if (code) {