czarkowyEdytorDatmain.tsx19 matches
1/**
2* This app allows users to drop an image onto the canvas, add text to it, move the text around,
3* edit the text directly on the canvas, and save the result to their local disk.
4* We'll use the HTML5 Canvas API for image manipulation and the File System Access API for saving files.
5* The app is styled with a playful and colorful design, using the Caveat font for a handwritten feel.
6*/
1112function App() {
13const [image, setImage] = useState(null);
14const [text, setText] = useState("Enter text here");
15const [textPosition, setTextPosition] = useState({ x: 250, y: 250 });
25window.addEventListener('resize', handleResize);
26return () => window.removeEventListener('resize', handleResize);
27}, [image, text, textPosition, canvasSize, textColor, fontSize, fontFamily]);
2829const handleResize = () => {
30if (!image) {
31setCanvasSize({ width: window.innerWidth, height: window.innerHeight });
32}
38ctx.clearRect(0, 0, canvas.width, canvas.height);
39
40if (image) {
41ctx.drawImage(image, 0, 0, canvas.width, canvas.height);
42} else {
43ctx.fillStyle = "#f0f0f0";
46ctx.font = "20px Caveat";
47ctx.textAlign = "center";
48ctx.fillText("Drop an image here", canvas.width / 2, canvas.height / 2);
49}
5095e.preventDefault();
96const file = e.dataTransfer.files[0];
97if (file && file.type.startsWith('image/')) {
98const reader = new FileReader();
99reader.onload = (event) => {
100const img = new Image();
101img.onload = () => {
102setImage(img);
103const aspectRatio = img.width / img.height;
104let newWidth = Math.min(window.innerWidth, img.width);
123const handleSave = async () => {
124try {
125const blob = await new Promise(resolve => canvasRef.current.toBlob(resolve, 'image/png'));
126const handle = await window.showSaveFilePicker({
127suggestedName: 'image-with-text.png',
128types: [{
129description: 'PNG Files',
130accept: {'image/png': ['.png']},
131}],
132});
134await writable.write(blob);
135await writable.close();
136console.log('Image saved successfully!');
137} catch (err) {
138console.error('Error saving the image:', err);
139console.log('Failed to save the image. Please try again.');
140}
141};
169<option value="Courier New">Courier New</option>
170</select>
171<button onClick={handleSave} disabled={!image} className="save-button">
172Save Image with Text
173</button>
174<a href={import.meta.url.replace("esm.town", "val.town")} className="source-link">View Source</a>
password_authREADME.md1 match
3Protect your vals behind a password. Use session cookies to persist authentication.
45
67## Demo
resumeDetailsmain.tsx3 matches
4"name": "SY Lee",
5"label": "Developer",
6"image": "",
7"email": "shiyung@gmail.com",
8"phone": "",
35"highlights": [
36"Built an event management platform with secure authentication and full CRUD capabilities, streamlining client operations",
37"Crafted a website for a food truck that captures their unique branding and playful image. The site features a fun, user-centric interface that facilitates online inquiries and enhances user engagement",
38"Designed and developed a responsive, accessibility-focused website for a law firm, improving client accessibility and increasing inquiries by 20%",
39],
145"highlights": [
146"Enhanced scene consistency with seed settings and introduced controls for motion, quality, and frame rate adjustments",
147"Integrated GPT-3.5 for prompt enhancement, significantly improving image and video quality",
148"Overcame the challenge of running FFmpeg client-side in Next.js, enabling real-time video processing in the browser",
149],
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
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