Go back
Matching with friends of same location, age group & interest...
Looking for friends
Caution: We are currently working on the web app. We appreciate your patience. Come back later.
document.getElementById('launchNowButton').addEventListener('click', async (event) => {
event.preventDefault();
// Capture form data
const location = document.getElementById('locationField').value;
const age = document.getElementById('ageField').value;
const interests = document.getElementById('interestsField').value;
// Send data to Vercel backend for matching
const response = await fetch('https://swipechatapp.vercel.app/', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ location, age, interests })
});
const data = await response.json();
if (data.roomLink) {
// Show the overlay and load the video chat room
const videoOverlay = document.getElementById('videoOverlay');
const iframe = videoOverlay.querySelector('iframe');
iframe.src = data.roomLink;
videoOverlay.style.display = 'block';
} else {
alert('No match found. Please try again.');
}
});