MIRROR

Don't find someone who looks right. Find someone who fits right.

10 doors. 10 glimpses of your future. Who are you really?

The Hallway

A long corridor stretches before you. Ten doors line the walls, each glowing with a different light. The air hums with possibility. Choose any door.

0 of 10 doors explored
🪞 Compare with Your Partner ← Back to MIRROR
`; // Animate bars setTimeout(()=>{ document.querySelectorAll('.trait-fill[data-w]').forEach(el=>{ el.style.width=el.dataset.w+'%'; }); },400); // Save to localStorage localStorage.setItem('mirror_profile',JSON.stringify({archetype:arch.name,traits:{eo,ind,amb,tru,lp,conflictLabel},attachment,loveLanguage:ll,fear,value,doorOrder:state.doorOrder,timestamp:Date.now()})); // Save archetype data for profile creation localStorage.setItem('mirror_archetype', arch.name); localStorage.setItem('mirror_archetype_scores', JSON.stringify({emotionalOpenness:eo,independence:ind,ambition:amb,trust:tru,lovePriority:lp,conflictStyle:conflictPct})); mirrorAnalytics('game_complete',{game:'doors',archetype:arch.name,doors_opened:state.visited.size,attachment:attachment,loveLanguage:ll}); // Auto-nudge: after 8s, pulse the "Find Your Match" button + show floating prompt setTimeout(()=>{ const cta=document.getElementById('main-profile-cta'); if(cta){ cta.style.animation='pulse-glow 1.5s infinite'; const nudge=document.createElement('div'); nudge.innerHTML=`

Ready to find someone compatible?

Create Profile — 2 min →

Not now

`; document.body.appendChild(nudge); } },8000); } function shareWhatsApp(){ const p=JSON.parse(localStorage.getItem('mirror_profile')||'{}'); const arch=p.archetype||'Unknown'; const msg=`I just played MIRROR and got *${arch}* as my archetype 🪞\n\nIt's a psychology game that reveals how you love, fight, trust and commit — in 8 minutes.\n\nPlay it and let's compare: https://mirror.love/doors-game/?utm_source=whatsapp&utm_medium=share&utm_campaign=archetype_share\n\nThink you can handle the truth? 😏`; const url='https://api.whatsapp.com/send?text='+encodeURIComponent(msg); window.open(url,'_blank'); mirrorAnalytics('share_whatsapp',{archetype:arch}); } function challengeFriend(){ const p=JSON.parse(localStorage.getItem('mirror_profile')||'{}'); const arch=p.archetype||'Unknown'; const challengeText=`⚔️ I dare you to play MIRROR.\n\nI got "${arch}" — let's see what YOU get.\n\nThen we compare archetypes and find out if we're compatible... or a disaster waiting to happen 💀\n\nhttps://mirror.love/doors-game/?utm_source=whatsapp&utm_medium=share&utm_campaign=challenge`; if(navigator.share){ navigator.share({title:'MIRROR Challenge',text:challengeText}).then(()=>{ mirrorAnalytics('challenge_sent',{archetype:arch,method:'native'}); }).catch(()=>{}); } else { navigator.clipboard.writeText(challengeText).then(()=>{ const btn=event.target;btn.textContent='✅ Copied!';setTimeout(()=>{btn.textContent='⚔️ Challenge a Friend'},2000); mirrorAnalytics('challenge_sent',{archetype:arch,method:'clipboard'}); }); } } // UTM capture const _up=new URLSearchParams(location.search); const _utm={utm_source:_up.get('utm_source'),utm_medium:_up.get('utm_medium'),utm_campaign:_up.get('utm_campaign')}; if(_utm.utm_source)sessionStorage.setItem('mirror_utm',JSON.stringify(_utm)); const _sutm=JSON.parse(sessionStorage.getItem('mirror_utm')||'{}'); function mirrorAnalytics(event,data){ try{ fetch('/api/collect',{method:'POST',headers:{'Content-Type':'application/json'},body:JSON.stringify({event:event,data:{...data,..._sutm},ts:Date.now(),url:location.href,ua:navigator.userAgent})}); }catch(e){} } function shareCard(){ const profile=JSON.parse(localStorage.getItem('mirror_profile')||'{}'); const c=document.createElement('canvas');c.width=1080;c.height=1920; const ctx=c.getContext('2d'); // Purple gradient bg const bg=ctx.createLinearGradient(0,0,0,1920); bg.addColorStop(0,'#0f0a1a');bg.addColorStop(0.5,'#1a1025');bg.addColorStop(1,'#0f0a1a'); ctx.fillStyle=bg;ctx.fillRect(0,0,1080,1920); // Purple glow const glow=ctx.createRadialGradient(540,200,0,540,200,600); glow.addColorStop(0,'rgba(168,85,247,0.2)');glow.addColorStop(1,'transparent'); ctx.fillStyle=glow;ctx.fillRect(0,0,1080,600); // Stars for(let i=0;i<150;i++){ctx.fillStyle=`rgba(255,255,255,${Math.random()*0.5+0.1})`;ctx.beginPath();ctx.arc(Math.random()*1080,Math.random()*1920,Math.random()*3+1,0,Math.PI*2);ctx.fill();} const purple='#a855f7';const cream='#f5e6c8'; // Top bar ctx.fillStyle=purple;ctx.fillRect(440,80,200,4); ctx.fillStyle=purple;ctx.font='500 28px Georgia,serif';ctx.textAlign='center'; ctx.fillText('MIRROR · DOORS',540,140); // Door emoji (large) ctx.font='120px serif';ctx.fillText(profile.firstDoor===0?'🚪':profile.firstDoor===1?'🚪':profile.firstDoor===2?'🚪':'🚪',540,280); // "I am" small ctx.font='italic 32px Georgia,serif';ctx.fillStyle='#a080a0'; ctx.fillText('My archetype:',540,360); // Archetype name - HUGE ctx.font='900 96px Georgia,serif';ctx.fillStyle=purple; const name=profile.archetype||'Unknown'; const nameLines=name.length>15?fitText(ctx,name,900,96):[name]; let y=460;nameLines.forEach(ln=>{ctx.fillText(ln,540,y);y+=100;}); // Divider const lg=ctx.createLinearGradient(100,0,980,0); lg.addColorStop(0,'transparent');lg.addColorStop(0.5,purple);lg.addColorStop(1,'transparent'); ctx.strokeStyle=lg;ctx.lineWidth=3;ctx.beginPath();ctx.moveTo(100,y+30);ctx.lineTo(980,y+30);ctx.stroke(); // Traits - big bars const t=profile.traits||{}; const traits=[{l:'OPENNESS',v:t.eo||50},{l:'INDEPENDENCE',v:t.ind||50},{l:'AMBITION',v:t.amb||50}]; y+=80; traits.forEach(tr=>{ ctx.textAlign='left';ctx.font='bold 22px Georgia,serif';ctx.fillStyle='#a080a0'; ctx.fillText(tr.l,100,y); ctx.textAlign='right';ctx.font='bold 36px Georgia,serif';ctx.fillStyle=cream; ctx.fillText(tr.v+'%',980,y); // Bar ctx.fillStyle='rgba(255,255,255,0.08)';roundRect(ctx,100,y+15,880,16,8);ctx.fill(); const grad=ctx.createLinearGradient(100,0,100+880*(tr.v/100),0); grad.addColorStop(0,purple);grad.addColorStop(1,'#f9a8d4'); ctx.fillStyle=grad;roundRect(ctx,100,y+15,880*(tr.v/100),16,8);ctx.fill(); y+=70; }); // Love language y+=20;ctx.textAlign='center';ctx.font='italic 28px Georgia,serif';ctx.fillStyle='#c0b0a0'; ctx.fillText('Love Language: '+(profile.loveLanguage||''),540,y); // Story hook y+=60;ctx.font='300 28px Georgia,serif';ctx.fillStyle=cream; ctx.fillText('I opened a door. Which one would YOU choose?',540,y); // CTA y=1620;ctx.font='bold 40px Georgia,serif';ctx.fillStyle=cream; ctx.fillText('Find your archetype',540,y); ctx.font='300 28px Georgia,serif';ctx.fillStyle=purple; ctx.fillText('mirror.love/doors-game',540,y+50); // Bottom ctx.fillStyle=purple;ctx.fillRect(340,1740,400,3); ctx.font='italic 24px Georgia,serif';ctx.fillStyle='#606060'; ctx.fillText('#MirrorChallenge',540,1800); c.toBlob(function(blob){ const file=new File([blob],'mirror-doors.png',{type:'image/png'}); if(navigator.canShare&&navigator.canShare({files:[file]})){ navigator.share({title:'My MIRROR Mirror',text:'I played DOORS and got '+name+'! 🚪 What door would you open?',files:[file]}).catch(()=>dl(blob)); } else dl(blob); },'image/png'); } function dl(blob){const u=URL.createObjectURL(blob);const a=document.createElement('a');a.href=u;a.download='mirror-doors.png';document.body.appendChild(a);a.click();document.body.removeChild(a);URL.revokeObjectURL(u);} function fitText(ctx,text,maxW,fs){ ctx.font='900 '+fs+'px Georgia,serif'; if(ctx.measureText(text).width<=maxW)return [text]; const words=text.split(' ');let line='';const lines=[]; words.forEach(w=>{const t=line+w+' ';if(ctx.measureText(t).width>maxW&&line){lines.push(line.trim());line=w+' ';}else line=t;}); if(line)lines.push(line.trim());return lines.length?lines:[text]; } function roundRect(ctx,x,y,w,h,r){ctx.beginPath();ctx.moveTo(x+r,y);ctx.lineTo(x+w-r,y);ctx.quadraticCurveTo(x+w,y,x+w,y+r);ctx.lineTo(x+w,y+h-r);ctx.quadraticCurveTo(x+w,y+h,x+w-r,y+h);ctx.lineTo(x+r,y+h);ctx.quadraticCurveTo(x,y+h,x,y+h-r);ctx.lineTo(x,y+r);ctx.quadraticCurveTo(x,y,x+r,y);ctx.closePath();} function gatedShare(){ const profile=JSON.parse(localStorage.getItem('mirror_profile')||'{}'); mirrorEmailGate(document.body, 'doors', profile.archetype, function(){ mirrorTrack('share', {game:'doors', archetype:profile.archetype}); shareCard(); }); } function joinWaitlist(){ const email=document.getElementById('waitlist-email').value; if(email&&email.includes('@')){ const p=JSON.parse(localStorage.getItem('mirror_profile')||'{}'); localStorage.setItem('mirror_email', email); mirrorCollectEmail(email, 'doors').then(function(){ document.getElementById('waitlist-msg').style.display='block'; document.getElementById('waitlist-email').value=''; mirrorAnalytics('email_signup',{game:'doors',archetype:p.archetype||'unknown'}); // Show profile CTA var cta=document.getElementById('profile-cta'); if(cta){ cta.style.display='block'; var arch=localStorage.getItem('mirror_archetype')||''; document.getElementById('profile-cta-link').href='/profile/?archetype='+encodeURIComponent(arch)+'&email='+encodeURIComponent(email); } }); } }