Public
Like
icalEvents
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.
This directory contains the frontend files for the URL Shortener application.
index.html
- Main HTML template with TailwindCSS stylingindex.js
- JavaScript for form handling, API calls, and user interactions
- Responsive Design: Works on desktop and mobile devices
- Real-time Validation: URL input validation and error handling
- Copy to Clipboard: One-click copying of generated short links
- Loading States: Visual feedback during API calls
- Error Handling: User-friendly error messages
- Accessibility: Proper labels, focus management, and keyboard navigation
The frontend uses TailwindCSS via CDN for styling, providing:
- Modern, clean design
- Responsive grid layouts
- Hover and focus states
- Loading animations
- Color-coded action buttons
- Form submission handling
- Fetch API for backend communication
- Clipboard API integration
- DOM manipulation for dynamic content
- Error state management
- Auto-focus and keyboard shortcuts
The frontend communicates with the backend API endpoints:
POST /shorten
- Create new short links- Displays generated short URLs, status links, and calendar download links
- Handles API errors gracefully with user feedback