πΊοΈ
Find people who move through the world the way you do.
OutdoorWorld β’ Eco-Living
Loading latest buddiesβ¦
β¨ Your Plan
STYLING css
:root {
--bg:#0f3d27; --text:#eaffea; --muted:#bfe8c7; --accent:#22c55e;
--card:#113d2e; --shadow:0 10px 30px rgba(0,0,0,.35); --radius:18px;
}
*{box-sizing:border-box}
body{ margin:0; font-family:sans-serif; color:var(--text); background:#0c2b1c; }
.wrap{ max-width:1200px; margin:0 auto; padding:16px; }
.main-layout{ display: flex; flex-wrap: wrap; gap: 24px; }
.header-block{ flex: 1; min-width: 350px; }
.header{ border-radius:var(--radius); padding:20px; background:#114a32; text-align:center; box-shadow:var(--shadow); }
.badge{ display:inline-block; background:#1c5a3e; padding:5px 15px; border-radius:20px; font-size:.8rem; }
.panel-left{ width:340px; background:#f2f5f1; color:#111; border-radius:var(--radius); padding:20px; box-shadow:var(--shadow); height: fit-content; position: sticky; top: 16px; }
.panel-left label{ font-weight:800; display:block; margin-top:12px; font-size: 0.85rem; }
.panel-left input, .panel-left select{ width:100%; padding:10px; border-radius:8px; border:1px solid #ccc; margin-top:5px; }
.cards{ display:grid; grid-template-columns:repeat(auto-fill,minmax(340px,1fr)); gap:20px; margin-top:20px; }
.card{ background:var(--card); border:1px solid #1d5a40; border-radius:15px; padding:18px; box-shadow:var(--shadow); }
.avatar{ width:40px; height:40px; border-radius:50%; background:#1a6a49; display:grid; place-items:center; font-weight:bold; }
.match-bar{ height:10px; background:#0e3222; border-radius:5px; overflow:hidden; margin:12px 0; }
.match-fill{ height:100%; background:linear-gradient(90deg, #ff3b30, #22c55e); transition:width 0.5s; }
.contact-btn{ display:block; text-align:center; padding:12px; background:#135a3d; border:2px solid #22c55e; color:#fff; text-decoration:none; border-radius:25px; font-weight:bold; margin-top:10px; }
.chips{ display:flex; flex-wrap:wrap; gap:6px; margin-top:8px; max-height: 250px; overflow-y: auto; padding:10px; background:#fff; border-radius:8px; border:1px solid #ddd; }
.chip{ padding:4px 10px; border-radius:15px; cursor:pointer; background:#eee; color:#333; font-size:0.7rem; border:1px solid #ccc; }
.chip.active{ background:var(--accent); color:#0c2b1c; font-weight:bold; }
Script JS jason
(function() {
// We gebruiken 'const' binnen deze functie zodat WordPress er niet bij kan
const REIS_URL = "https://wtgeiauncryuslsrwfot.supabase.co";
const REIS_KEY = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6Ind0Z2VpYXVuY3J5dXNsc3J3Zm90Iiwicm9sZSI6ImFub24iLCJpYXQiOjE3NjI2NDA1MDMsImV4cCI6MjA3ODIxNjUwM30.zcuj4w81wkZBCmlWE1XhGBXK7omsZIYwttdVwWlmbXQ";
let mijnReisApp;
let alleLeden = [];
let gekozenInteresses = new Set();
const REGIO_LIJST = ["Portugal North", "Portugal Central", "Portugal South", "Spain North", "Spain Central", "Spain South", "France North", "France South", "Italy", "Netherlands", "Belgium", "Germany"];
const INTERESSE_LIJST = ["Animals", "Art-music", "Campings", "Children", "Cooking", "Eco Community", "Gardening", "Meditation", "Mountains", "Off-grid", "Permaculture", "Sea", "Van Life", "Vegan", "Volunteer"];
// Start pas als de pagina EN de supabase-bibliotheek geladen zijn
window.addEventListener('load', function() {
if (typeof window.supabase === 'undefined') {
console.error("Supabase is nog niet geladen door de browser.");
return;
}
// We maken de verbinding hier pas aan
mijnReisApp = window.supabase.createClient(REIS_URL, REIS_KEY);
bouwInterface();
haalLedenOp();
});
async function haalLedenOp() {
const { data, error } = await mijnReisApp.from('travel_buddies').select('*').order('created_at', { ascending: false });
if (error) {
console.error("Database fout:", error);
return;
}
alleLeden = data || [];
updateOverzicht();
}
function updateOverzicht() {
const kaartContainer = document.getElementById('cards');
const tellerElement = document.getElementById('t-matches');
const geselecteerdeRegio = document.getElementById('region1').value;
let resultaatLijst = alleLeden.map(lid => {
let matchScore = 5; // Basis score
// Regio match (45 punten)
if (geselecteerdeRegio && lid.region1 === geselecteerdeRegio) {
matchScore += 45;
}
// Interesses match (15 punten per stuk)
const overlap = (lid.interests || []).filter(i => gekozenInteresses.has(i));
matchScore += (overlap.length * 15);
return { ...lid, score: Math.min(matchScore, 100) };
});
// ALTIJD SORTEREN OP HOOGSTE SCORE
resultaatLijst.sort((a, b) => b.score - a.score);
// BIJ OPSTARTEN: Toon 9 nieuwste als er geen filters zijn
if (!geselecteerdeRegio && gekozenInteresses.size === 0) {
resultaatLijst = resultaatLijst.slice(0, 9);
if(tellerElement) tellerElement.textContent = "Showing 9 latest members";
} else {
if(tellerElement) tellerElement.textContent = resultaatLijst.length + " matches found";
}
if(!kaartContainer) return;
kaartContainer.innerHTML = "";
resultaatLijst.forEach(lid => {
kaartContainer.innerHTML += `
`;
});
}
function bouwInterface() {
const regioDropdown = document.getElementById('region1');
const interesseBak = document.getElementById('interests');
if (regioDropdown) {
regioDropdown.innerHTML = '';
REGIO_LIJST.forEach(r => {
let opt = document.createElement('option');
opt.value = r;
opt.textContent = r;
regioDropdown.appendChild(opt);
});
regioDropdown.onchange = updateOverzicht;
}
if (interesseBak) {
interesseBak.innerHTML = "";
INTERESSE_LIJST.forEach(it => {
const button = document.createElement('button');
button.className = 'chip';
button.textContent = it;
button.style.margin = "3px";
button.onclick = function() {
this.classList.toggle('active');
if (gekozenInteresses.has(it)) {
gekozenInteresses.delete(it);
} else {
gekozenInteresses.add(it);
}
updateOverzicht();
};
interesseBak.appendChild(button);
});
}
const matchBtn = document.getElementById('recalcBtn');
if (matchBtn) matchBtn.onclick = updateOverzicht;
}
})();
INDEX.html
πΊοΈ
Find people who move through the world the way you do.
OutdoorWorld β’ Eco-Living
Loading latest buddies...
β¨ Your Plan
DEFAULT php
You Are All Set to Go!
All you have to do now is upload your website files and start your journey. Check out how to do that below: