T
Val Town is a collaborative website to build and scale JavaScript apps.
Deploy APIs, crons, & store data – all from the browser, and deployed in milliseconds.
index.ts
https://Shaban111--9ae2e42638c511f0959b9e149126039e.web.val.run
A simple web app that resizes any photo to fit perfectly in a 640x640 square canvas while preserving the original image proportions. Perfect for creating WhatsApp profile pictures.
- Upload any photo (horizontal or vertical)
- Automatically resizes and scales to fit within a 640x640 square canvas
- Preserves original image proportions - no cropping!
- White background fills any empty space
- Mobile-friendly interface
- Download or share the resized image
- Preview before processing
- Click "Choose Photo" to select an image
- Preview your selected image
- Click "Resize to Square for WhatsApp" to process
- Download or share the final square image
The app uses smart scaling to ensure your photo fits entirely within the 640x640 square:
- Portrait photos: Scales down to fit height, adds white background on sides
- Landscape photos: Scales down to fit width, adds white background on top/bottom
- Square photos: Scales to fit perfectly
- No cropping - your entire photo is preserved!
- Frontend: React with TypeScript
- Canvas API for image processing and smart scaling
- Responsive design with TailwindCSS
- Works on mobile and desktop
- Client-side processing (no server upload required)
- JPEG output with white background for better compatibility
├── frontend/
│ ├── index.html # Main HTML template
│ ├── index.tsx # React app entry point
│ └── components/
│ └── App.tsx # Main app component
├── backend/
│ └── index.ts # Static file server
└── README.md