Skip to main content

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

How it works:
  1. Prevent default form submission behavior
  2. Validate all required fields are filled
  3. Format message with name, email, and message content
  4. Encode message using encodeURIComponent() for URL safety
  5. Build WhatsApp URL using wa.me API format
  6. Open in new tab using window.open()
  7. Reset form after successful submission
WhatsApp URL Format:
Phone Number Format:
  • 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
Full-width button links to social platforms.

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 the required attribute.

JavaScript Validation

Icons Used

Contact Cards

  • ti-phone - Phone number
  • ti-mail - Email address
  • ti-map-pin - Location
  • ti-brand-github - GitHub profile
  • ti-brand-linkedin - LinkedIn profile
  • ti-brand-whatsapp - WhatsApp contact
  • ti-mail - Email link

Form Buttons

  • ti-send - Submit button
  • ti-rotate - Reset button

Section Dividers

Horizontal rules separate the four subsections:
  1. Title
  2. Contact form
  3. Contact information cards
  4. 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