Contact Section Component
The contact section includes a form that sends messages via WhatsApp, contact information cards, and social media links.Section Structure
Contact Form
The form collects user information and sends it via WhatsApp using JavaScript.Form HTML
Form Layout
class
Form container uses 8 columns (66% width) on large screens, centered
class
Grid layout with 1rem gap between elements
class
Name and email fields use 50% width on medium screens and above
class
Message field and buttons span full width
WhatsApp Integration
The form submission is handled by JavaScript that formats the data and opens WhatsApp.JavaScript Implementation
WhatsApp Integration Details
WhatsApp Integration Details
How it works:Phone Number Format:
- Prevent default form submission behavior
- Validate all required fields are filled
- Format message with name, email, and message content
- Encode message using
encodeURIComponent()for URL safety - Build WhatsApp URL using
wa.meAPI format - Open in new tab using
window.open() - Reset form after successful submission
- No spaces, dashes, or parentheses
- Include country code
- Example:
573229520608(Colombia +57)
Customizing WhatsApp Number
Message Template
Contact Information Cards
Three cards display contact methods with icons.Cards HTML
Card Styling
Hover Effects
- Lift effect: Card moves up 8px
- Background change: Opacity increases with blue tint
- Border color: Changes to accent blue
- Transition duration: 0.35s
Social Media Links
Full-width button links to social platforms.Social Links HTML
Social Button Layout
class
Each button occupies 25% width on medium screens and above
class
Large button size for better touch targets
class
Button spans full width of its column
Form Validation
HTML5 validation is used with therequired attribute.
JavaScript Validation
Icons Used
Contact Cards
ti-phone- Phone numberti-mail- Email addressti-map-pin- Location
Social Links
ti-brand-github- GitHub profileti-brand-linkedin- LinkedIn profileti-brand-whatsapp- WhatsApp contactti-mail- Email link
Form Buttons
ti-send- Submit buttonti-rotate- Reset button
Section Dividers
- Title
- Contact form
- Contact information cards
- Social media links
Responsive Layout
Desktop (≥ 768px)
- Form: 66% width, centered
- Contact cards: 3 columns side by side
- Social buttons: 4 columns side by side
Mobile (< 768px)
- Form: Full width
- Contact cards: Stack vertically
- Social buttons: Stack vertically
Key Features
- WhatsApp integration - Form submits directly to WhatsApp
- No backend required - Pure client-side JavaScript
- Form validation - HTML5 and JavaScript validation
- Reset functionality - Clear form with dedicated button
- Hover effects - Interactive contact cards
- Responsive grid - Bootstrap-based layout
- Icon integration - Tabler Icons for visual elements
- External links - Proper security attributes (
noopener noreferrer) - Multiple contact methods - Form, direct links, and social media