--- go-around-v49/mock.js +++ designer/mock.js @@ -11,9 +11,11 @@ /* ── LOGO SLOT: the only place the logo is set. Swap this file when the new logo arrives. ── */ var LOGO='assets/logo.png'; function logo(cls){return 'Go Around';} -document.getElementById('logoSlot').innerHTML=logo(); +document.getElementById('logoSlot').innerHTML=''; /* Designer: no logo mark until MT's logo is final */ var I={ /* simple line icons, no emoji */ + passkey:'', + chev:'', back:'', mail:'', lock:'', @@ -75,7 +77,7 @@ function addDays(d,n){var x=new Date(d.getFullYear(),d.getMonth(),d.getDate());x.setDate(x.getDate()+n);return x;} function addMonth(d){var y=d.getFullYear(),m=d.getMonth()+1,day=d.getDate();var last=new Date(y,m+1,0).getDate();return new Date(y,m,Math.min(day,last));} var TODAY=new Date(); -var PLANS={founding:{name:'Founding Pilot',price:299,was:399,note:'First 50 members. Your price stays locked while you stay subscribed.'}, +var PLANS={founding:{name:'Founding Member',price:299,was:399,note:'First 50 members. Your price stays locked while you stay subscribed.'}, pro:{name:'Pro',price:399,note:'Every member tool, including anonymous reviews.'}, ato:{name:'ATO account',price:3999,note:'One account per ATO. Replies, page tools and stats.'}}; function rands(n,cents){var s=String(n).replace(/\B(?=(\d{3})+(?!\d))/g,',');return 'R'+s+(cents?'.00':'');} @@ -141,16 +143,73 @@ if(ST==='signup-mismatch'){c.cls='bad';c.msg=I.x+'Passwords don\u2019t match. Type the same one twice.';c.msgCls='bad';} cf='
'+inp(c)+'
'; } - if(!up) pw.under='Forgot your password?'; + if(!up) pw.under='Forgot password?'; var si=pb('Sign in',up?'gls':'pri',ST==='loading'?'loading':'',ST==='press'||ST==='loading'?'lg float':'lg'); var su=pb('Sign up',up?'pri':'gls',ST==='signup-mismatch'?'disabled':'','lg'); - return pg('
'+logo('logo-big')+'

'+(up?'Join
Go Around.':'What every
pilot needs.')+'

'+(up?'Type your password twice. Free to start, 14 days of Pro on us.':'Everything a pilot needs before take-off: weather, aerodromes, ATOs and DFEs in one place.')+'

'+ - '
'+alert+inp(em)+inp(pw)+cf+ - acts('
'+si+su+'
'+ - '
or
'+ - 'Browse as guest')+'
'); + /* ── Designer (12 Nov 2026): order = Google · passkey · "or" · email + password · Forgot · Sign in | Sign up · + email-code · guest. Google + passkey are NOT .pb pills so Go Around's tests (which find pills by text) keep passing. + ── NEXT SESSION — from Designer ────────────────────────────────────────────────────────────────── + Google : not in the code yet. Wire .gsi.google to GA_AUTH.startGoogleOAuth(up?'signup':'signin') and the + callback to GA_AUTH.handleOAuthCallback(state). See auth-hooks.js for the server steps. + Passkey : endpoints exist on job6/member-doorways (not live). Wire .alt-btn.passkey to GA_AUTH.passkeySignIn(). + Hidden on sign-up on purpose: the server only lets a SIGNED-IN member add a passkey. + Email code: endpoints exist (job6). Wire a.email-code → GA_AUTH.sendEmailCode(email) → verify screen. + Password + Forgot: NOT in the server code yet (email-code only). Build /api/auth/password/* or drop them. + ─────────────────────────────────────────────────────────────────────────────────────────────────── */ + var gsi=''; + var pk=up?'':''; + /* ── Designer v3 (12 Nov 2026, MT t87): base = the FIRST sign-in Designer sent (build v1): title + lede on top, + the runway scene under it, then email, password, "Forgot", the Sign in | Sign up pill pair, a link row, legal. + Changes on top: NO "GO AROUND" name, no PAPI, no tower; official Google button; passkey; email code; + Browse as guest; and a blurred, dimmed layer (.dim) between the scene and every control. + Two faithful adjustments, picked with ?v=a | ?v=b (only the placement of Google / passkey and the dim layer differ): + A — Google + passkey ABOVE the email ("or with email" between); dim = a floating frosted panel. + B — the original order kept: email first; Google sits under the pair; the passkey stays in the original link row; + dim = a full-width layer that rises out of the runway with a soft, blurred top edge (no hard line). + The pair is the original one: both .pb pills, so Go Around's handlers and 81 tests are unchanged. ── */ + var V=(Q.get('v')==='b')?'b':'a'; + var scene=window.runwaySVG?'':''; + var hero='

'+(up?'Create your
account.':'What every
pilot needs.')+'

'+(up?'Free to start. 14 days of Pro on us, no card.':'Weather, aerodromes, ATOs and DFEs, in one place.')+'

'+scene+'
'; + var pair='
'+si+su+'
'; + var legal=''; + var dot=''; + if(V==='a'){ + var rowA=up?'

Browse as guest

' + :'

Email me a code'+dot+'Browse as guest

'; + return pg(hero+'
'+alert+ + '
'+gsi+pk+'
'+ + inp(em)+inp(pw)+cf+acts(pair+rowA+legal)+'
'); + } + var pkLink=up?'':''+I.passkey+'Use a passkey'+dot; + var rowB=up?'

Browse as guest

' + :'

'+pkLink+'Email me a code'+dot+'Guest

'; + return pg(hero+'
'+alert+ + inp(em)+inp(pw)+cf+acts(pair+'
'+gsi+'
'+rowB+legal)+'
'); }, /* forgot — no mailbox icon; real email input; live resend countdown */ +/* verify — Designer: 6-digit email sign-in code (DECISIONS: 10 minutes, 5 tries). Server: /api/auth/email/start + /verify (job6). + NEXT SESSION — from Designer: call GA_AUTH.sendEmailCode(email) before showing this, GA_AUTH.verifyEmailCode(email,code) on the 6th digit. */ +'verify':function(){topBack(null); + var email=DB.get('email',DEMO.email), bad=ST==='wrong', exp=ST==='expired', code=bad?'481920':''; + var cells=''; for(var i=0;i<6;i++) cells+=''+(code[i]||'')+''; + return pg(qwrap('
Sign-in code

Check your
email.

We sent a 6-digit code to
'+esc(email)+'
It works for 10 minutes.

'+ + '
'+cells+'
'+ + '

'+(bad?'That code isn\u2019t right. 4 tries left.':exp?'That code has expired. We\u2019ve sent a new one.':'')+'

'+ + '

Send a new code in 0:42Use another email

')+ + acts(pb('Sign in','pri',code.length===6?'':'disabled'))); +}, +/* google — Designer: PREVIEW of the hand-off. In the live site Google's own page (accounts.google.com) opens here. + NEXT SESSION — from Designer: replace this screen with GA_AUTH.startGoogleOAuth(mode) (a redirect). On return, + GA_AUTH.handleOAuthCallback(state) decides: known member → back to the page; new → identity?via=google (name + email + prefilled, no password step). MT must create the Google Cloud OAuth client + consent screen first (NEXT-SESSION.md). */ +'google':function(){topBack(null); + var up=Q.get('mode')==='signup'; + return pg(qwrap('
Design preview

'+(up?'Sign up with
Google.':'Continue with
Google.')+'

Google\u2019s own page opens here. You pick your account; Google shares your name and email address with Go Around.

'+ + '
'+G+'Choose an account
'+ + ''+ + (up?'':'')+ + '

No Google password is ever shared with Go Around.

')+acts('Back to sign in')); +}, 'forgot':function(){topBack(null); var email=DB.get('email',DEMO.email); if(ST==='sent')return pg('
Forgot password

Check your
email.

If '+esc(email)+' has an account, a reset link is on its way. It works for 30 minutes.

'+ @@ -268,43 +327,43 @@ }, /* school-claim — "Is this your ATO?" kept */ 'school-claim':function(){topBack([5,6]); - var rows=[['SA','Skyline Aviation Academy','FAGC · Grand Central · ATO 0000'],['SA','Skyline Air Training','FALA · Lanseria · ATO 0000']]; + var rows=[['SA','Demo ATO','FAGC · Grand Central · ATO 0000'],['SA','Demo ATO · Lanseria','FALA · Lanseria · ATO 0000']]; return pg(prog(5,6)+qwrap('
ATO

Is this
your ATO?

One account per ATO. Pick it from the SACAA list, then tell us your role.

'+ - field({label:'Search ATOs',val:'Skyline',icon:I.search,df:'ato_query'})+ + field({label:'Search ATOs',val:'Grand Central',icon:I.search,df:'ato_query'})+ '
'+rows.map(function(r,k){return '
'+r[0]+''+r[1]+''+r[2]+'
';}).join('')+'
Demo names
'+ - '
'+field({label:'Your role at the ATO',val:'Head of Training',right:''+I.down+'',df:'ato_role'})+field({label:'Work email',val:'training@skyline.example',icon:I.mail,df:'ato_email',msg:'We send a check link here. Use the ATO\u2019s own domain if you can.'})+'
')+ + '
'+field({label:'Your role at the ATO',val:'Head of Training',right:''+I.down+'',df:'ato_role'})+field({label:'Work email',val:'training@your-ato.example',icon:I.mail,df:'ato_email',msg:'We send a check link here. Use the ATO\u2019s own domain if you can.'})+'
')+ acts(pb('Send claim','pri',ST==='submitting'?'loading':'')+'My ATO isn\u2019t listed')); }, 'school-pending':function(){topBack([5,6]);wash(); - return pg(prog(5,6)+'
'+GTICK+'

Claim sent.

We\u2019ll confirm you speak for Skyline Aviation Academy. Next, pick your ATO plan.

'+ + return pg(prog(5,6)+'
'+GTICK+'

Claim sent.

We\u2019ll confirm you speak for Demo ATO. Next, pick your ATO plan.

'+ '

Paid and Verified are separate. An ATO plan unlocks replies and your page tools. The Verified badge comes only after Go Around audits the ATO.

'+ acts(pb('Choose ATO plan','pri'))); }, /* NEW ato-plan — where an ATO claim lands (payment). MONTHLY ONLY (no-refund policy, MT t2627) */ 'ato-plan':function(){topBack([6,6]); - return pg(prog(6,6)+'
ATO plan

Your ATO
plan.

For Skyline Aviation Academy. Pay now, or look around first. Your claim is checked either way.

'+ + return pg(prog(6,6)+'
ATO plan

Your ATO
plan.

For Demo ATO. Pay now, or look around first. Your claim is checked either way.

'+ MLINE+ '

ATO account

Replies, page tools and stats. Audit for Verified.

R3,999per month
'+ '
'+ '

Renews every month until you cancel. No refunds for a month already started; cancel before the renewal date to stop the next charge. Paid and Verified are separate.

'+ acts(pb('Subscribe','pri')+'Pay later, look around first')); }, -/* trial — v3.1: trial does NOT include anonymous reviews; paid upsell (Founding Pilot R299 / Pro R399) */ +/* trial — v3.1: trial does NOT include anonymous reviews; paid upsell (Founding Member R299 / Pro R399) */ 'trial':function(){topBack([6,6]); return pg(prog(6,6)+'
Welcome gift
14days of Pro,
on us.

No card needed. Every Pro tool except anonymous reviews. When it ends you drop to Free, and nothing is charged.

'+ '
'+ '
Want to post anonymously?Anonymous reviews are for paying members only. Your free trial doesn\u2019t include them.'+ - '
'+ - '
Founding Pilot seatsThe first 50 paying members keep R299 a month for life.12of 50 left
'+ + '
Founding MemberR299 / monthProR399 / month
'+ + '
Founding Member seatsThe first 50 paying members keep R299 a month while they stay subscribed.12of 50 left
'+ acts(MLINE.replace('mline','mline in-acts')+'
'+pb('See plans','gls','','lg')+pb('Start trial','pri',ST==='loading'?'loading':'','lg')+'
')); }, /* plan — price boxes kept exactly; MONTHLY ONLY; three spaced sections */ 'plan':function(){topBack(null); var sold=ST==='soldout'; - var found=sold?'
All 50 taken

Founding Pilot

The 50 founding seats are gone. New members join Pro at the normal price.

': - '
Founding Pilot

First 50 only

Your price is locked for life while you stay subscribed.

R299per monthR399
'+ - '
38 of 50 seats taken12 left
'+ - '
'; + var found=sold?'
All 50 taken

Founding Member

The 50 founding seats are gone. New members join Pro at the normal price.

': + '
Founding Member

First 50 only

Your price is locked while you stay subscribed.

R299per monthR399
'+ + '
38 of 50 takenYour seat: No. 39
'+ + '
'; return pg('
Plans

Choose your plan.

Your 14-day trial is already running. Choose now or any time before it ends.

'+ MLINE+ sect('For pilots','Anonymous reviews included')+found+ @@ -313,7 +372,7 @@ '

Free

Read all reviews, vote, 3 ATOs a month. Reviews with your name only. No tools.

R0always
'+ sect('For ATOs','One account per ATO')+ '

ATO account

Reply on your ATO page, page tools and stats. Audit for Verified.

R3,999per month
'+ - '

You pay on our payment partner\u2019s secure page. Paid plans renew every month until you cancel in Settings. No refunds for a month already started; cancel before the renewal date to stop the next charge. Unused trial days are added on top. Founding price is lost if you cancel.

'+ + '

You pay on our payment partner\u2019s secure page. Paid plans renew every month until you cancel in Settings. No refunds for a month already started; cancel before the renewal date to stop the next charge. If you pay during your trial, the trial days left are dropped and your plan starts at once. Prices exclude VAT. Founding price is lost if you cancel.

'+ acts(pb(sold?'Subscribe to Pro':'Claim a founding seat','pri')+'Stay on the trial for now')); }, 'done':function(){noHead(); @@ -321,7 +380,7 @@ Same green tick as the DFE "Claim sent" screen (GTICK): same SVG, 112px size, colour and draw+pop animation. Nothing more. Rows depend on the path: ?via= email|google|signin|reset, ?plan= trial|founding|pro|free|ato|ato-later, ?claim= dfe|ato */ var via=Q.get('via')||'', plan=Q.get('plan')||'trial', claim=Q.get('claim')||''; - var back=(via==='signin'||via==='reset'); + var back=(via==='signin'||via==='reset'||via==='passkey'); document.body.classList.add('scr-done'); function kv(k,v,mono){return '
'+k+''+v+'
';} var tick=GTICK.replace('aria-label="Sent"','aria-label="'+(back?'Signed in':'Account created')+'"'); @@ -329,13 +388,13 @@ if(back){ head='
Signed in

'+greet('Welcome back')+'

'; lede='

Taking you back to the page you were on.

'; - card='
'+kv('Plan','Pro trial')+kv('Days left','11 of 14',1)+'
'; + card='
'+kv('Plan','Pro trial')+kv('Days left','11 of 14',1)+(via==='passkey'?kv('Signed in with','Passkey'):'')+'
'; }else{ head='
All set

'+greet('Welcome aboard')+'

'; var REN=fmtD(addMonth(TODAY)), TEND=fmtD(addDays(TODAY,14)), paid=Q.get('paid'); var P={ trial:['Your Pro trial has started.', kv('Plan','Pro trial')+kv('Days left','14 of 14',1)+'
'+kv('Trial ends',TEND)+kv('Card on file','None')+kv('After the trial','Free, unless you pick a plan')], - founding:['Your Founding Pilot plan is active.', kv('Plan','Founding Pilot')+kv('Price','R299 / month',1)+kv('Renews',REN)+kv('Anonymous reviews','Included')], + founding:['Your Founding Member plan is active.', kv('Plan','Founding Member')+kv('Founding seat','No. 39 of 50',1)+kv('Price','R299 / month',1)+kv('Renews',REN)+kv('Anonymous reviews','Included')], pro:['Your Pro plan is active.', kv('Plan','Pro')+kv('Price','R399 / month',1)+kv('Renews',REN)+kv('Anonymous reviews','Included')], free:['Your free account is ready.', kv('Plan','Free')+kv('Card on file','None')+kv('Reviews','3 ATOs a month, with your name')+kv('Upgrade','Any time from Plans')], ato:['Your ATO account is active.', kv('Plan','ATO account')+kv('Price','R3,999 / month',1)+kv('Renews',REN)+kv('Verified badge','After our audit')], @@ -345,7 +404,10 @@ if(paid==='1')P[1]+=kv('Payment','Confirmed · receipt emailed'); if(paid==='pending'){P[1]=P[1].replace(kv('Card on file','None'),'').replace(kv('After the trial','Free, unless you pick a plan'),kv('Then','Your paid plan, once confirmed'));P[0]='Your Pro trial has started. We\u2019ll switch on your paid plan as soon as the payment is confirmed.';P[1]+=kv('Payment','Waiting for confirmation');} lede='

'+P[0]+'

'; - card='
'+P[1]+(via==='google'?kv('Signed up with','Google'):'')+'
'; + card='
'+P[1]+(via==='google'?kv('Signed up with','Google'):'')+'
' + /* Designer: offer a passkey right after the account exists (the server only allows it when signed in). + NEXT SESSION — from Designer: wire a.pk-add to GA_AUTH.passkeyRegister('iPhone'); hide when !GA_AUTH.passkeySupported(). */ + card+='
Sign in faster next timeAdd a passkey. Face ID or Touch ID instead of a password.
Add a passkey
'; if(claim.indexOf('dfe')>-1)card+='
DFE claimPending
'; if(claim.indexOf('ato')>-1)card+='
ATO claimPending
'; card+=MLINE.replace('mline','mline in-acts'); @@ -381,7 +443,7 @@ '
Due today'+rands(P.price,1)+'
'+ '
RenewsEvery month on the '+next.getDate()+ordinal(next.getDate())+'
'+ '
Next charge'+rands(P.price,1)+' · '+fmtD(next)+'
'+ - (ato?'
ForSkyline Aviation Academy
':'')+ + (ato?'
ForDemo ATO
':'')+ ''+ '
You\u2019ll be redirected to our secure payment partnerYou pay on their page. Your bank may ask you to approve (3-D Secure). Go Around never sees or stores your card number.
'+ ''+ @@ -424,7 +486,7 @@ return pg('
'+ '

Confirming
your payment.

We wait for the payment partner to confirm with our server before your plan unlocks. This takes a few seconds.

'+ ''+ + '
'+kvx('Plan',P.name)+(k==='founding'?kvx('Founding seat','No. 39 of 50',1):'')+kvx('Paid',rands(P.price,1)+' ZAR',1)+kvx('Next charge',fmtD(addMonth(TODAY)))+kvx('Reference',ref,1)+'
'+ ''+ ''+acts(pb('Continue','pri','disabled'))); @@ -475,7 +537,7 @@ try{ var u=new URL(url, location.href); u.searchParams.set('t', themeKey()); - ['via','role','claim','plan','paid','layout'].forEach(function(k){ if(Q.get(k) && !u.searchParams.get(k)) u.searchParams.set(k,Q.get(k)); }); /* keep the tap-through path */ + ['via','role','claim','plan','paid','layout','v'].forEach(function(k){ if(Q.get(k) && !u.searchParams.get(k)) u.searchParams.set(k,Q.get(k)); }); /* keep the tap-through path */ if(Q.has('capture')) u.searchParams.set('capture','1'); if(Q.get('state') && u.searchParams.get('s')==='consent') u.searchParams.set('state', Q.get('state')); return u.pathname.split('/').pop()+u.search; @@ -616,10 +678,10 @@ var aside=document.createElement('aside'); aside.className='ipad-brand'; aside.setAttribute('aria-hidden','true'); - aside.innerHTML=art+'
'+ + aside.innerHTML=(window.runwaySVG?'':art)+'
'+ '

Aerodromes, weather, ATOs and DFEs in one place.

'+ '

Go Around · Part 91 general aviation

'+ - '
14 days of Pro, on us. No card.Then Founding Pilot R299 or Pro R399 per month. Monthly, cancel anytime before renewal.
'; + '
14 days of Pro, on us. No card.Then Founding Member R299 or Pro R399 per month. Monthly, cancel anytime before renewal.
'; document.body.insertBefore(aside, document.body.firstChild); return; } @@ -658,7 +720,7 @@ (function tapThrough(){ var Q=new URLSearchParams(location.search), S=Q.get('s')||'signin-a', ST=Q.get('state')||'idle'; var html=document.documentElement, capture=Q.has('capture'), DB=window.GADB; - var CTX=['via','role','claim','plan','paid','layout']; + var CTX=['via','role','claim','plan','paid','layout','v']; var reduce=matchMedia('(prefers-reduced-motion: reduce)').matches; function esc(s){return String(s==null?'':s).replace(/[&<>"']/g,function(c){return {'&':'&','<':'<','>':'>','"':'"',"'":'''}[c];});} var MON=['Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec']; @@ -727,6 +789,22 @@ }); } /* small toast, absolute (no position:fixed), transform/opacity only */ + /* Designer: a faithful stand-in for the phone's OWN passkey sheet (Safari draws the real one; we can't style it). + NEXT SESSION — from Designer: delete this and call GA_AUTH.passkeySignIn() (navigator.credentials.get). */ + function passkeySheet(done){ + var w=document.createElement('div'); w.className='pk-wrap'; w.setAttribute('role','dialog'); w.setAttribute('aria-modal','true'); w.setAttribute('aria-label','Sign in with a passkey'); + w.innerHTML='

Design preview of the iPhone\u2019s own sheet

'+ + '

Sign in

Use your saved passkey for goaround.co.za?

'+ + '
alex.pilot@example.comPasskey · iCloud Keychain
'+ + ''+ + '
'; + document.body.appendChild(w); requestAnimationFrame(function(){ w.classList.add('in'); }); + var go_=w.querySelector('.pk-go'); go_.focus(); + function close(){ w.classList.remove('in'); setTimeout(function(){ w.remove(); },320); } + w.querySelector('.pk-x').addEventListener('click',close); w.querySelector('.pk-scrim').addEventListener('click',close); + go_.addEventListener('click',function(){ w.classList.add('scan'); setTimeout(function(){ w.classList.add('ok'); },900); setTimeout(done,1500); }); + } + window.GApasskeySheet=passkeySheet; function toast(msg){ var t=document.createElement('div'); t.className='demo-toast'; t.setAttribute('role','status'); t.textContent=msg; t.style.top=(window.scrollY+14)+'px'; document.body.appendChild(t); @@ -774,7 +852,7 @@ else go(k,{from:S,ret:null,state:null,fst:ST!=='idle'?ST:null}); }); /* back arrow */ - var BACK={'forgot':'signin-a','reset':'forgot','identity':'signin-a','dob':'identity','under18':'dob','aviation':'consent', + var BACK={'verify':'signin-a','google':'signin-a','forgot':'signin-a','reset':'forgot','identity':'signin-a','dob':'identity','under18':'dob','aviation':'consent', 'licences':'aviation','dfe-claim':'licences','dfe-pending':'dfe-claim','school-claim':'aviation','school-pending':'school-claim', 'ato-plan':'school-pending','trial':'aviation','plan':'trial','profile':'done','checkout':'plan','pay-return':'checkout'}; if(S==='checkout' && Q.get('plan')==='ato') BACK.checkout='ato-plan'; @@ -891,10 +969,33 @@ on('.pair .pb','Sign in',function(el){ if(up) go('signin-a',{state:null},{back:true}); else signIn(el); }); on('.pair .pb','Sign up',function(el){ if(up) signUp(el); else { if(em.value.trim()) DB.set('email',em.value.trim().toLowerCase()); go('signin-a',{state:'signup'}); } }); $('#authForm').addEventListener('submit',function(e){ e.preventDefault(); if(up) signUp(suBtn); else signIn(siBtn); }); - on('.pb.google',null,function(el){ go('identity',{via:'google',state:null,plan:null,claim:null,role:null,paid:null},{btn:el,net:true,wait:700}); }); + /* Designer: Google → hand-off preview (live: GA_AUTH.startGoogleOAuth). Passkey → the iPhone's own sheet (live: GA_AUTH.passkeySignIn). */ + on('.gsi.google',null,function(el){ el.classList.add('busy'); go('google',{mode:up?'signup':'signin',state:null,plan:null,claim:null,role:null,paid:null},{net:true,wait:420}); }); + on('.alt-btn.passkey',null,function(el){ passkeySheet(function(){ go('done',{via:'passkey',plan:null,claim:null,role:null,paid:null,state:null},{wait:200}); }); }); + on('a.email-code',null,function(){ if(!checkEmail('em')) return; go('verify',{via:'signin-code',state:null},{net:true}); }); on('a.forgot',null,function(){ if(em.value.trim()) DB.set('email',em.value.trim().toLowerCase()); go('forgot',{state:null}); }); on('a.guest',null,function(){ toast('Guest browsing opens Go Around without an account. (Demo)'); }); }, + 'verify':function(){ + var c=$('#code'), cells=document.querySelectorAll('.code .cell'), b=$('.acts .pb'); + function paint(){ var v=c.value.replace(/\D/g,'').slice(0,6); if(v!==c.value) c.value=v; + cells.forEach(function(el,i){ el.textContent=v[i]||''; el.classList.toggle('cur',i===v.length); }); + $('.code').classList.remove('bad'); setMsg('code','',''); b.disabled=v.length!==6; return v; } + c.addEventListener('input',function(){ if(paint().length===6) submit(b); }); + function submit(el){ var v=paint(); if(v.length!==6) return; + if(v==='000000'){ $('.code').classList.add('bad'); var m=$('#code-m'); m.className='msg c bad'; m.textContent='That code isn\u2019t right. 4 tries left.'; return; } + go('done',{via:'signin',state:null},{btn:el,net:true}); } + on('.acts .pb','Sign in',function(el){ submit(el); }); + $('#codeForm').addEventListener('submit',function(e){e.preventDefault(); submit(b);}); + on('a.change-email',null,function(){ go('signin-a',{state:null},{back:true}); }); + var cd=$('.cd'), n=capture?42:45; (function tick(){ if(!cd) return; cd.textContent='0:'+(n<10?'0':'')+n; if(n>0 && !capture){ n--; setTimeout(tick,1000); } })(); + }, + 'google':function(){ + on('.g-acct',null,function(el){ el.classList.add('on'); + if(el.getAttribute('data-new')==='1'){ if(el.classList.contains('g-new')) DB.set('name','Thandi Mokoena'); go('identity',{via:'google',state:null,mode:null},{wait:380}); } + else go('done',{via:'signin',state:null,mode:null},{wait:380}); }); + on('a.g-cancel',null,function(){ go('signin-a',{state:Q.get('mode')==='signup'?'signup':null,mode:null},{back:true}); }); + }, 'forgot':function(){ if(ST==='sent'){ on('.pb','Back to sign in',function(el){ go('signin-a',{state:null},{back:true}); }); @@ -1169,6 +1270,7 @@ on('.acts .pb','Continue',function(el){ if(pend) go('done',{plan:'trial',paid:'pending',state:null},{btn:el}); else go('done',{plan:k,paid:'1',state:null},{btn:el}); }); }, 'done':function(){ + on('a.pk-add',null,function(el){ el.textContent='Adding\u2026'; GA_AUTH.passkeyRegister('iPhone').then(function(){ var o=el.closest('.pk-offer'); o.classList.add('added'); o.innerHTML='
Passkey addedNext time, tap \u201cSign in with a passkey\u201d.
'; }); }); on('.acts .pb',null,function(){ toast('End of the sign-up demo. Tap Restart to go again.'); showRestart(); }); on('.acts a.linkish','View my profile',function(){ go('profile',{state:null}); }); function showRestart(){ var a=$('.acts'); if(a && !a.querySelector('.rs')){ a.insertAdjacentHTML('beforeend','Restart'); on('.acts a.rs',null,function(){ DB.clear(); go('signin-a',{state:null,via:null,plan:null,claim:null,role:null,paid:null}); }); } }