Welcome Back

Log in to continue your child's personalised Sammy journey.

Welcome to Sammy

Your personalised Sammy journey is ready.

When you're ready, tap below to continue.
text-align: center; font-size: 25px; } .intro { text-align: center; line-height: 1.5; font-size: 15px; margin: 0 0 25px; } label { display: block; margin: 16px 0 7px; font-size: 14px; font-weight: 700; } input { width: 100%; padding: 15px; border: 1px solid #d9d9d9; border-radius: 12px; font-size: 16px; background: #ffffff; color: #2C3E50; outline: none; } input:focus { border-color: #88D66C; } button { width: 100%; border: none; border-radius: 14px; padding: 16px; margin-top: 22px; font-size: 16px; font-weight: 700; cursor: pointer; } button:disabled { opacity: 0.6; cursor: not-allowed; } .login-button { background: #88D66C; margin: 0; font-size: 30px; color: #88D66C; font-weight: 800; } .logo p { margin: 6px 0 0; font-size: 14px; color: #2C3E50; } .card { background: #ffffff; border-radius: 24px; padding: 25px; box-shadow: 0 5px 25px rgba(44, 62, 80, 0.10); border: 1px solid #eeeeee; } h2 { margin-top: 0; font-size: 25px; text-align: center; } .intro { text-align: center; line-height: 1.5; font-size: 15px; margin-bottom: 25px; } label { display: block; margin: 15px 0 7px; font-weight: 700; font-size: 14px; } input { width: 100%; padding: 15px; border: 1px solid #d9d9d9; border-radius: 12px; font-size: 16px; outline: none; background: #ffffff; color: #2C3E50; } input:focus { border-color: #88D66C; } button { width: 100%; border: none; border-radius: 14px; padding: 16px; margin-top: 22px; font-size: 16px; font-weight: 700; cursor: pointer; } .login-button { background: #88D66C; color: #ffffff; } .journey-button { background: #FF69B4; color: #ffffff; } .message { margin-top: 18px; padding: 12px; border-radius: 10px; text-align: center; font-size: 14px; display: none; } .error { display: block; background: #ffe8e8; color: #b00020; } .success { display: block; background: #e9f9e4; color: #39752d; } #dashboard { display: none; } .child-name { text-align: center; font-size: 27px; font-weight: 800; margin: 10px 0; color: #2C3E50; } .programme-name { text-align: center; font-size: 17px; margin-bottom: 20px; color: #666666; } .welcome-box { background: #f4fff1; border-radius: 18px; padding: 18px; margin: 20px 0; line-height: 1.5; text-align: center; } .logout { background: #eeeeee; color: #2C3E50; margin-top: 12px; } .hidden { display: none !important; } .loading { opacity: 0.6; pointer-events: none; }

Welcome Back

Log in to continue your child's personalised Sammy journey.

Welcome to Sammy

Your personalised Sammy journey is ready.

When you're ready, tap below to continue.
padding: 25px; border-radius: 20px; box-shadow: 0 4px 20px rgba(0,0,0,0.08); } h2 { margin-top: 0; } input { width: 100%; padding: 14px; margin: 8px 0; box-sizing: border-box; border: 1px solid #ddd; border-radius: 10px; font-size: 16px; } button { width: 100%; padding: 15px; margin-top: 15px; border: none; border-radius: 10px; background: #88D66C; color: white; font-size: 16px; font-weight: bold; cursor: pointer; } button:disabled { opacity: 0.6; } #message { margin-top: 15px; line-height: 1.5; font-size: 14px; } #journey { display: none; } .programme-box { margin-top: 20px; padding: 18px; border-radius: 12px; background: #f5fff2; }

Sammy

My Emotional Regulation Journey

Parent Login

Your Programme

const SUPABASE_KEY = "sb_publishable_3rDsv7ZXuOZDihTao51yqg_TBQFGySz"; const supabase = createClient( SUPABASE_URL, SUPABASE_KEY ); window.login = async function() { const email = document.getElementById("email").value; const password = document.getElementById("password").value; document.getElementById("message").textContent = "Logging in..."; const { data, error } = await supabase.auth.signInWithPassword({ email, password }); if (error) { document.getElementById("message").textContent = error.message; return; } const user = data.user; const { data: child, error: childError } = await supabase .from("Children") .select("child_name, program_id") .eq("parent_id", user.id) .single(); if (childError) { document.getElementById("message").textContent = "Database error: " + childError.message + " | Code: " + childError.code; return; } document.getElementById("message").textContent = ""; document.getElementById("childName").textContent = "Welcome! " + child.child_name; document.getElementById("journey").style.display = "block"; }; window.openSammy = async function() { const { data: program, error } = await supabase .from("programmes1") .select("canva_url") .eq("name", "SAMMY 1 - UNDERSTANDING MY FEELINGS") .single(); if (error || !program) { alert("Sammy 1 could not be found."); return; } window.location.href = program.canva_url; }; const SUPABASE_URL = "YOUR_SUPABASE_URL"; // Make sure your URL is defined here const SUPABASE_KEY = "sb_publishable_3rDsv7ZXuOZDihTao51yqg_TBQFG..."; const supabase = createClient(SUPABASE_URL, SUPABASE_KEY); window.login = async function() { const email = document.getElementById("email").value; const password = document.getElementById("password").value; const messageEl = document.getElementById("message"); if (messageEl) messageEl.textContent = "Logging in..."; const { data, error } = await supabase.auth.signInWithPassword({ email, password }); if (error) { if (messageEl) messageEl.textContent = error.message; return; } const user = data.user; const { data: child, error: childError } = await supabase .from("Children") .select("child_name, program_id") .eq("parent_id", user.id) .single(); if (childError) { console.error("Error fetching child profile:", childError.message); } // Add your successful redirect or next steps here! };