Support the Ringside Report Network
When you see headlines about Knox Jolie-Pitt winning a Muay Thai tournament or Shakira’s sons medaling in Taekwondo, the immediate reaction is predictable: nepotism, privilege, bought success. The internet lights up with accusations of preferential treatment and wealthy families gaming the system.
I get it. The optics look terrible when a Hollywood icon’s child stands on a podium. But here’s the thing: The nepo baby debate in combat sports reveals something far more uncomfortable about combat sports than celebrity corruption. It exposes the brutal reality that elite-level competition has always been partially pay-to-play, and we’ve been pretending otherwise for decades.
The Nepo Baby Advantage: Resources Nobody Wants to Discuss The reality is that developing a world-class martial artist requires resources most families simply don’t have. We’re talking about $20,000 to $50,000 annually for serious international competition preparation.
Support the Ringside Report Network
Support the Ringside Report Network
Rash Guards Private coaching: $100-150 per hour.Travel: Thousands per trip for G-rank tournaments (where national team selectors actually look).Support Staff: Strength coaches, sports psychologists, and physical therapists for injury prevention.The nepo baby advantage in combat sports isn’t special treatment at competition. They’re getting special treatment for the fifteen years before they ever step into the ring . That’s the actual advantage, and it’s completely legal.
The Myth of the “Working Class” Fighter What’s often overlooked is that this isn’t unique to combat sports. This pattern exists in Olympic figure skating and tennis, too. The pathway to elite status has been economically gatekept for generations. The difference is that combat sports carry this “Rocky” mythology—the idea that anyone with heart and discipline can rise to the top. That story sells tickets. The truth is much more complicated.
Support the Ringside Report Network
A celebrity’s kid can train 25-30 hours per week with world-class instruction, proper rest, and zero financial stress. The average talented kid is juggling school, a part-time job, and relying on group classes. After five years, that isn’t a skill gap—it’s a chasm.
Are the Medals Actually Legitimate? Here’s where I need to be direct about something uncomfortable: Yes, in most cases, these kids are legitimately skilled.
Take Taekwondo (WT style), for example. International judging operates under electronic scoring systems (PSS) using Daedo or KPNP sensors in the protective gear. These sensors register valid strikes based on pressure, not opinion.
The Tech Factor: The scoring for body kicks is largely objective.The Reality: You can buy the best coaching in the world, but you cannot bribe a pressure sensor.However, this defense only applies to specific sports. In subjective arts like Muay Thai or Boxing, the concern about “reputation scoring” is valid. When judges know they’re watching a high-profile athlete, unconscious bias is real. The athlete who looks like a champion often gets scored like one in tight rounds.
My Prediction: The Rise of “Blind Judging” Because of this perception problem, here is my bold prediction: within the next Olympic cycle, we will see major organizations implement blind judging protocols or AI-assisted scoring for subjective arts. World Taekwondo is already experimenting with 360-degree cameras and AI replays. The sport cannot afford the credibility damage as more high-profile “nepo babies” enter the pipeline.
The Real Scandal The nepo baby phenomenon in combat sports is actually a symptom of a much larger structural problem. We’ve created systems in which economic barriers determine who has the opportunity to discover their potential.
How many potential Olympic medalists are currently working retail jobs, never knowing they had the physical gifts for elite fighting because they couldn’t afford the $200 monthly dojang fees?
Ringside Report will continue covering these stories, not to tear down individual athletes—Knox and the others trained hard for those wins—but to push for transparency. The real scandal isn’t that some kids have advantages. It’s that we keep pretending they don’t, while the sport’s potential remains locked behind economic barriers most families can’t overcome.
The medals are legitimate. The system that determines who gets to compete for them? That needs to change.
Want to discuss access and equity in combat sports? Join us for Ringside Report MMA every Thursday at 8 PM, where we break down the stories that actually matter.
Ringside Report Network’s Combat Sports Gym Finder
.gym-finder * {
margin: 0;
padding: 0;
box-sizing: border-box;
}
.gym-finder {
width: 100% !important;
max-width: 700px !important;
margin: 0 auto !important;
background: #04010E !important;
border-radius: 16px !important;
overflow: hidden !important;
box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5) !important;
border: 2px solid #4a6fa5 !important;
font-family: -apple-system, BlinkMacSystemFont, ‘Segoe UI’, Roboto, Oxygen, Ubuntu, sans-serif !important;
}
.gym-finder-header {
background: linear-gradient(135deg, #283655 0%, #336699 100%) !important;
padding: 20px 24px !important;
}
.gym-finder-header h2 {
color: #FFFFFF !important;
font-size: 24px !important;
font-weight:
700 !important;
display: flex !important;
align-items: center !important;
gap: 10px !important;
text-shadow: 0 2px 4px rgba(0,0,0,0.3) !important;
margin: 0 !important;
padding: 0 !important;
}
.gym-finder-header p {
color: #FFFFFF !important;
font-size: 14px !important;
margin-top: 6px !important;
opacity: 0.95 !important;
font-weight: 500 !important;
}
.gym-finder-content {
padding: 24px !important;
background: #04010E !important;
}
.gym-finder .search-row {
display: flex !important;
gap: 10px !important;
margin-bottom: 14px !important;
}
.gym-finder .search-input-wrapper {
flex: 1 !important;
position: relative !important;
}
.gym-finder .search-input {
width: 100% !important;
padding: 16px 16px 16px 48px !important;
background: #FFFFFF !important;
border: 2px solid #4a6fa5 !important;
border-radius: 12px !important;
color: #1a1a2e !important;
font-size: 16px !important;
font-weight: 500 !important;
transition: all 0.2s !important;
}
.gym-finder .search-select {
width: 100% !important;
padding: 16px !important;
background: #FFFFFF !important;
border: 2px solid #4a6fa5 !important;
border-radius: 12px !important;
color: #1a1a2e !important;
font-size: 16px !important;
font-weight: 500 !important;
transition: all 0.2s !important;
cursor: pointer !important;
appearance: none !important;
background-image: url(“data:image/svg+xml,%3Csvg width=’12’ height=’12’ viewBox=’0 0 24 24′ fill=’none’ stroke=’%231a1a2e’ stroke-width=’3′ xmlns=’http://www.w3.org/2000/svg’%3E%3Cpath d=’m6 9 6 6 6-6’/%3E%3C/svg%3E”) !important;
background-repeat: no-repeat !important;
background-position: right 16px center !important;
}
.gym-finder .search-input:focus,
.gym-finder .search-select:focus {
outline: none !important;
border-color: #32B258 !important;
box-shadow: 0 0 0 4px rgba(50, 178, 88, 0.3) !important;
}
.gym-finder .search-input::placeholder {
color: #666677 !important;
font-weight: 400 !important;
}
.gym-finder .search-icon {
position: absolute !important;
left: 16px !important;
top: 50% !important;
transform: translateY(-50%) !important;
color: #336699 !important;
}
.gym-finder .options-row {
display: flex !important;
gap: 10px !important;
margin-bottom: 18px !important;
flex-wrap: wrap !important;
}
.gym-finder .country-select-wrapper {
flex: 1 !important;
min-width: 150px !important;
}
.gym-finder .unit-toggle {
display: flex !important;
background: #FFFFFF !important;
border: 2px solid #4a6fa5 !important;
border-radius: 12px !important;
overflow: hidden !important;
}
.gym-finder .unit-btn {
padding: 16px 20px !important;
background: transparent !important;
border: none !important;
color: #1a1a2e !important;
font-size: 14px !important;
font-weight: 700 !important;
cursor: pointer !important;
transition: all 0.2s !important;
}
.gym-finder .unit-btn.active {
background: #336699 !important;
color: #FFFFFF !important;
}
.gym-finder .unit-btn:hover:not(.active) {
background: #e8f0f8 !important;
}
.gym-finder .btn {
padding: 16px 20px !important;
border: none !important;
border-radius: 12px !important;
font-size: 14px !important;
font-weight: 700 !important;
cursor: pointer !important;
transition: all 0.2s !important;
display: flex !important;
align-items: center !important;
gap: 8px !important;
}
.gym-finder .btn-primary {
background: #32B258 !important;
color: #FFFFFF !important;
text-transform: uppercase !important;
letter-spacing: 0.5px !important;
}
.gym-finder .btn-primary:hover {
background: #28a04a !important;
}
.gym-finder .btn-secondary {
background: #336699 !important;
color: #FFFFFF !important;
}
.gym-finder .btn-secondary:hover {
background: #4080b8 !important;
}
.gym-finder .btn:disabled {
opacity: 0.5 !important;
cursor: not-allowed !important;
}
.gym-finder .filter-toggle {
background: #1a2744 !important;
border: 2px solid #4a6fa5 !important;
border-radius: 12px !important;
color: #FFFFFF !important;
font-size: 14px !important;
font-weight: 700 !important;
cursor: pointer !important;
display: flex !important;
align-items: center !important;
gap: 10px !important;
padding: 14px 18px !important;
transition: all 0.2s !important;
width: 100% !important;
text-transform: uppercase !important;
letter-spacing: 0.5px !important;
}
.gym-finder .filter-toggle:hover {
background: #253350 !important;
border-color: #32B258 !important;
}
.gym-finder .filters {
display: none;
flex-wrap: wrap !important;
gap: 10px !important;
padding: 20px !important;
background: #0d1520 !important;
border: 2px solid #4a6fa5 !important;
border-radius: 12px !important;
margin-top: 14px !important;
margin-bottom: 18px !important;
}
.gym-finder .filters.show {
display: flex !important;
}
.gym-finder .filter-btn {
padding: 12px 20px !important;
border: none !important;
border-radius: 25px !important;
font-size: 14px !important;
font-weight: 700 !important;
cursor: pointer !important;
transition: all 0.2s !important;
background: #FFFFFF !important;
color: #1a1a2e !important;
text-transform: uppercase !important;
letter-spacing: 0.5px !important;
}
.gym-finder .filter-btn:hover {
background: #e8f0f8 !important;
transform: translateY(-1px) !important;
}
.gym-finder .filter-btn.active {
background: #32B258 !important;
color: #FFFFFF !important;
box-shadow: 0 4px 12px rgba(50, 178, 88, 0.4) !important;
}
.gym-finder .select-all-row {
width: 100% !important;
display: flex !important;
gap: 10px !important;
margin-bottom: 14px !important;
padding-bottom: 14px !important;
border-bottom: 2px solid #4a6fa5 !important;
}
.gym-finder .select-all-btn {
padding: 10px 18px !important;
border: none !important;
border-radius: 8px !important;
font-size: 13px !important;
font-weight: 700 !important;
cursor: pointer !important;
background: #336699 !important;
color: #FFFFFF !important;
transition: all 0.2s !important;
text-transform: uppercase !important;
letter-spacing: 0.5px !important;
}
.gym-finder .select-all-btn:hover {
background: #4080b8 !important;
}
.gym-finder .error {
padding: 14px 18px !important;
background: #3d1a1f !important;
border: 2px solid #ff6b7a !important;
border-radius: 12px !important;
color: #ff8a95 !important;
font-size: 14px !important;
font-weight: 600 !important;
margin-bottom: 16px !important;
}
.gym-finder .warning {
padding: 14px 18px !important;
background: #3d3a1a !important;
border: 2px solid #ffd54f !important;
border-radius: 12px !important;
color: #ffe082 !important;
font-size: 14px !important;
font-weight: 600 !important;
margin-bottom: 16px !important;
}
.gym-finder .info {
padding: 14px 18px !important;
background: #1a2d3d !important;
border: 2px solid #64b5f6 !important;
border-radius: 12px !important;
color: #90caf9 !important;
font-size: 14px !important;
font-weight: 600 !important;
margin-bottom: 16px !important;
}
.gym-finder .results {
margin-top: 20px !important;
}
.gym-finder .results-header {
color: #FFFFFF !important;
font-size: 18px !important;
font-weight: 700 !important;
margin-bottom: 16px !important;
display: flex !important;
align-items: center !important;
gap: 10px !important;
}
.gym-finder .results-header svg {
color: #32B258 !important;
}
.gym-finder .map-container {
border-radius: 12px !important;
overflow: hidden !important;
border: 2px solid #4a6fa5 !important;
margin-bottom: 16px !important;
}
.gym-finder .map-container iframe {
display: block !important;
width: 100% !important;
height: 220px !important;
border: none !important;
}
.gym-finder .gym-links {
display: flex !important;
flex-direction: column !important;
gap: 10px !important;
}
.gym-finder .gym-link {
display: flex !important;
align-items: center !important;
justify-content: space-between !important;
padding: 18px 20px !important;
background: #FFFFFF !important;
border: 2px solid #4a6fa5 !important;
border-radius: 12px !important;
text-decoration: none !important;
transition: all 0.2s !important;
}
.gym-finder .gym-link:hover {
background: #e8f8ec !important;
border-color: #32B258 !important;
transform: translateY(-2px) !important;
box-shadow: 0 4px 12px rgba(50, 178, 88, 0.2) !important;
}
.gym-finder .gym-link-text {
color: #1a1a2e !important;
font-weight: 700 !important;
font-size: 16px !important;
}
.gym-finder .gym-link-subtext {
color: #336699 !important;
font-size: 14px !important;
margin-left: 8px !important;
font-weight: 500 !important;
}
.gym-finder .gym-link svg {
color: #336699 !important;
transition: color 0.2s !important;
flex-shrink: 0 !important;
}
.gym-finder .gym-link:hover svg {
color: #32B258 !important;
}
.gym-finder .results-footer {
text-align: center !important;
color: #FFFFFF !important;
font-size: 13px !important;
margin-top: 20px !important;
font-weight: 500 !important;
opacity: 0.8 !important;
}
.gym-finder .initial-state {
text-align: center !important;
padding: 50px 20px !important;
}
.gym-finder .initial-state-icon {
width: 80px !important;
height: 80px !important;
background: #1a2744 !important;
border: 2px solid #4a6fa5 !important;
border-radius: 50% !important;
display: flex !important;
align-items: center !important;
justify-content: center !important;
margin: 0 auto 20px !important;
}
.gym-finder .initial-state-icon svg {
color: #FFFFFF !important;
opacity: 0.7 !important;
}
.gym-finder .initial-state p {
color: #FFFFFF !important;
font-size: 16px !important;
font-weight: 500 !important;
line-height: 1.6 !important;
}
.gym-finder-footer {
padding: 16px 24px !important;
background: #0d1520 !important;
border-top: 2px solid #4a6fa5 !important;
text-align: center !important;
}
.gym-finder-footer p {
color: #FFFFFF !important;
font-size: 13px !important;
font-weight: 500 !important;
opacity: 0.7 !important;
}
.gym-finder .spinner {
animation: gym-finder-spin 1s linear infinite !important;
}
@keyframes gym-finder-spin {
from { transform: rotate(0deg); }
to { transform: rotate(360deg); }
}
/* MOBILE STYLES */
@media (max-width: 600px) {
.gym-finder {
border-radius: 12px !important;
margin: 0 8px !important;
}
.gym-finder-header {
padding: 16px 18px !important;
}
.gym-finder-header h2 {
font-size: 20px !important;
}
.gym-finder-header h2 svg {
width: 20px !important;
height: 20px !important;
}
.gym-finder-content {
padding: 16px !important;
}
.gym-finder .search-row {
flex-wrap: wrap !important;
}
.gym-finder .search-input-wrapper {
width: 100% !important;
flex: none !important;
}
.gym-finder .search-input {
padding: 16px 16px 16px 48px !important;
font-size: 16px !important;
}
.gym-finder .btn {
padding: 16px !important;
}
.gym-finder .btn-text {
display: none !important;
}
.gym-finder .options-row {
flex-direction: column !important;
gap: 10px !important;
}
.gym-finder .country-select-wrapper {
width: 100% !important;
}
.gym-finder .search-select {
padding: 16px !important;
font-size: 16px !important;
}
.gym-finder .unit-toggle {
width: 100% !important;
justify-content: center !important;
}
.gym-finder .unit-btn {
flex: 1 !important;
padding: 16px !important;
font-size: 15px !important;
}
.gym-finder .filter-toggle {
padding: 14px 16px !important;
font-size: 13px !important;
}
.gym-finder .filters {
padding: 16px !important;
gap: 8px !important;
}
.gym-finder .filter-btn {
padding: 12px 16px !important;
font-size: 12px !important;
flex-grow: 1 !important;
text-align: center !important;
min-width: calc(33% – 8px) !important;
}
.gym-finder .select-all-row {
flex-wrap: wrap !important;
}
.gym-finder .select-all-btn {
flex: 1 !important;
text-align: center !important;
padding: 12px !important;
}
.gym-finder .results-header {
font-size: 16px !important;
}
.gym-finder .map-container iframe {
height: 180px !important;
}
.gym-finder .gym-link {
padding: 16px !important;
}
.gym-finder .gym-link-text {
font-size: 14px !important;
}
.gym-finder .gym-link-subtext {
display: none !important;
}
.gym-finder .initial-state {
padding: 40px 16px !important;
}
.gym-finder .initial-state-icon {
width: 64px !important;
height: 64px !important;
}
.gym-finder .initial-state-icon svg {
width: 28px !important;
height: 28px !important;
}
.gym-finder .initial-state p {
font-size: 14px !important;
}
.gym-finder-footer {
padding: 14px 18px !important;
}
}
/* Extra small screens */
@media (max-width: 380px) {
.gym-finder .filter-btn {
min-width: calc(50% – 6px) !important;
font-size: 11px !important;
padding: 10px 12px !important;
}
}
All Countries
United States
Canada
United Kingdom
Australia
Brazil
Germany
France
Japan
Mexico
Netherlands
Ireland
New Zealand
Philippines
Poland
Russia
South Africa
South Korea
Spain
Sweden
Thailand
KM
MILES
Select Disciplines (0 selected)
Select All
Clear All
BJJ
10th Planet
Boxing
Muay Thai
Kickboxing
Wrestling
Judo
Karate
Taekwondo
Please select at least one discipline to search for gyms.
Enter your location, select disciplines, then search to find combat sports gyms nearby
(function() {
// State
let coordinates = null;
let locationName = ”;
let selectedTypes = [];
let distanceUnit = ‘miles’;
// Elements
const locationInput = document.getElementById(‘locationInput’);
const countrySelect = document.getElementById(‘countrySelect’);
const searchBtn = document.getElementById(‘searchBtn’);
const gpsBtn = document.getElementById(‘gpsBtn’);
const filterToggle = document.getElementById(‘filterToggle’);
const filters = document.getElementById(‘filters’);
const filterCount = document.getElementById(‘filterCount’);
const errorEl = document.getElementById(‘error’);
const warningEl = document.getElementById(‘warning’);
const infoEl = document.getElementById(‘info’);
const initialState = document.getElementById(‘initialState’);
const results = document.getElementById(‘results’);
const locationNameEl = document.getElementById(‘locationName’);
const mapFrame = document.getElementById(‘mapFrame’);
const gymLinks = document.getElementById(‘gymLinks’);
const filterBtns = document.querySelectorAll(‘.filter-btn’);
const unitKm = document.getElementById(‘unitKm’);
const unitMiles = document.getElementById(‘unitMiles’);
const selectAllBtn = document.getElementById(‘selectAllBtn’);
const clearAllBtn = document.getElementById(‘clearAllBtn’);
// Icons
const searchIcon = ”;
const spinnerIcon = ”;
const externalIcon = ”;
// Functions
function showError(message) {
errorEl.textContent = message;
errorEl.style.display = ‘block’;
warningEl.style.display = ‘none’;
infoEl.style.display = ‘none’;
}
function hideError() {
errorEl.style.display = ‘none’;
}
function showWarning() {
warningEl.style.display = ‘block’;
errorEl.style.display = ‘none’;
infoEl.style.display = ‘none’;
}
function hideWarning() {
warningEl.style.display = ‘none’;
}
function showInfo(message) {
infoEl.textContent = message;
infoEl.style.display = ‘block’;
}
function hideInfo() {
infoEl.style.display = ‘none’;
}
function setLoading(isLoading) {
searchBtn.disabled = isLoading;
gpsBtn.disabled = isLoading;
searchBtn.innerHTML = isLoading
? spinnerIcon + ‘
Searching… ‘
: searchIcon + ‘
Search ‘;
}
function updateFilterCount() {
filterCount.textContent = selectedTypes.length;
if (selectedTypes.length > 0) {
hideWarning();
}
}
function showResults() {
if (selectedTypes.length === 0) {
showWarning();
return;
}
hideWarning();
hideInfo();
initialState.style.display = ‘none’;
results.style.display = ‘block’;
// Show friendly location name
const displayName = locationName.split(‘,’)[0].trim();
locationNameEl.textContent = displayName;
// Update map
const bbox = `${coordinates.lng – 0.05},${coordinates.lat – 0.05},${coordinates.lng + 0.05},${coordinates.lat + 0.05}`;
mapFrame.src = `https://www.openstreetmap.org/export/embed.html?bbox=${bbox}&layer=mapnik&marker=${coordinates.lat},${coordinates.lng}`;
// Update gym links
gymLinks.innerHTML = ”;
filterBtns.forEach(btn => {
if (selectedTypes.includes(btn.dataset.type)) {
const searchTerm = btn.dataset.search;
const label = btn.textContent;
const query = encodeURIComponent(`${searchTerm} near ${locationName}`);
const url = `https://www.google.com/maps/search/${query}/@${coordinates.lat},${coordinates.lng},13z`;
const link = document.createElement(‘a’);
link.href = url;
link.target = ‘_blank’;
link.rel = ‘noopener noreferrer’;
link.className = ‘gym-link’;
link.innerHTML = `
${label} Gyms
near you
${externalIcon}
`;
gymLinks.appendChild(link);
}
});
}
// Geocoding with multiple fallback attempts
async function geocodeLocation(query, country) {
const searchQueries = [];
// Build search queries in order of specificity
if (country) {
searchQueries.push(`${query}, ${country}`);
}
searchQueries.push(query);
// If query looks like an address, also try just the city/region part
if (query.includes(‘,’)) {
const parts = query.split(‘,’).map(p => p.trim());
if (parts.length >= 2) {
// Try city, country
if (country) {
searchQueries.push(`${parts[1]}, ${country}`);
}
searchQueries.push(parts[1]);
}
}
// Try postal code pattern (for Canada: A1A 1A1, for US: 12345)
const postalMatch = query.match(/[A-Za-z]\d[A-Za-z]\s*\d[A-Za-z]\d|\d{5}/);
if (postalMatch && country) {
searchQueries.push(`${postalMatch[0]}, ${country}`);
}
for (const searchQuery of searchQueries) {
try {
const response = await fetch(
`https://nominatim.openstreetmap.org/search?q=${encodeURIComponent(searchQuery)}&format=json&limit=1&addressdetails=1`,
{
headers: {
‘Accept’: ‘application/json’
}
}
);
if (!response.ok) continue;
const data = await response.json();
if (data.length > 0) {
return {
lat: parseFloat(data[0].lat),
lng: parseFloat(data[0].lon),
displayName: data[0].display_name,
searchUsed: searchQuery
};
}
}
catch (err) {
console.log(‘Geocode attempt failed for:’, searchQuery);
continue;
}
}
return null;
}
async function searchLocation() {
const query = locationInput.value.trim();
const country = countrySelect.value;
if (!query) {
showError(‘Please enter a location’);
return;
}
if (selectedTypes.length === 0) {
showWarning();
return;
}
hideError();
hideWarning();
hideInfo();
setLoading(true);
try {
const result = await geocodeLocation(query, country);
if (result) {
coordinates = { lat: result.lat, lng: result.lng };
locationName = result.displayName.split(‘,’).slice(0, 3).join(‘,’);
// Update input with friendly name
const friendlyName = result.displayName.split(‘,’)[0].trim();
locationInput.value = friendlyName;
showResults();
} else {
showError(‘Location not found. Try a city name or postal code.’);
}
} catch (err) {
showError(‘Error searching for location. Please try again.’);
}
setLoading(false);
}
function useGeolocation() {
if (!navigator.geolocation) {
showError(‘Geolocation is not supported by your browser’);
return;
}
if (selectedTypes.length === 0) {
showWarning();
return;
}
hideError();
hideWarning();
hideInfo();
setLoading(true);
navigator.geolocation.getCurrentPosition(
async (position) => {
coordinates = {
lat: position.coords.latitude,
lng: position.coords.longitude
};
try {
const response = await fetch(
`https://nominatim.openstreetmap.org/reverse?lat=${coordinates.lat}&lon=${coordinates.lng}&format=json&addressdetails=1`
);
const data = await response.json();
const city = data.address?.city || data.address?.town || data.address?.village || data.address?.municipality || ”;
const state = data.address?.state || data.address?.province || ”;
const country = data.address?.country || ”;
locationName = [city, state, country].filter(Boolean).join(‘, ‘);
locationInput.value = city || locationName;
} catch {
locationName = `${coordinates.lat.toFixed(4)}, ${coordinates.lng.toFixed(4)}`;
locationInput.value = locationName;
}
setLoading(false);
showResults();
},
(err) => {
let errorMsg = ‘Unable to get your location. ‘;
if (err.code === 1) {
errorMsg += ‘Please allow location access or enter your location manually.’;
} else if (err.code === 2) {
errorMsg += ‘Position unavailable. Please enter your location manually.’;
} else {
errorMsg += ‘Please enter your location manually.’;
}
showError(errorMsg);
setLoading(false);
},
{ enableHighAccuracy: true, timeout: 10000 }
);
}
// Event Listeners
searchBtn.addEventListener(‘click’, searchLocation);
locationInput.addEventListener(‘keydown’, (e) => {
if (e.key === ‘Enter’) searchLocation();
});
gpsBtn.addEventListener(‘click’, useGeolocation);
filterToggle.addEventListener(‘click’, () => {
filters.classList.toggle(‘show’);
});
filterBtns.forEach(btn => {
btn.addEventListener(‘click’, () => {
const type = btn.dataset.type;
if (btn.classList.contains(‘active’)) {
selectedTypes = selectedTypes.filter(t => t !== type);
btn.classList.remove(‘active’);
} else {
selectedTypes.push(type);
btn.classList.add(‘active’);
}
updateFilterCount();
if (coordinates && selectedTypes.length > 0) {
showResults();
}
});
});
selectAllBtn.addEventListener(‘click’, () => {
selectedTypes = [];
filterBtns.forEach(btn => {
btn.classList.add(‘active’);
selectedTypes.push(btn.dataset.type);
});
updateFilterCount();
if (coordinates) showResults();
});
clearAllBtn.addEventListener(‘click’, () => {
selectedTypes = [];
filterBtns.forEach(btn => {
btn.classList.remove(‘active’);
});
updateFilterCount();
});
// Unit toggle
unitKm.addEventListener(‘click’, () => {
distanceUnit = ‘km’;
unitKm.classList.add(‘active’);
unitMiles.classList.remove(‘active’);
});
unitMiles.addEventListener(‘click’, () => {
distanceUnit = ‘miles’;
unitMiles.classList.add(‘active’);
unitKm.classList.remove(‘active’);
});
})();