apps / customer-app /admin.html
fungiorganic's picture
v0.3.12.210 Anchorage compact release; new paths only for the car app (0); no deletions
cac8c04 verified
Raw History Blame Contribute Delete
10.7 kB
<!doctype html>
<html lang="en-GB">
<head>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no, shrink-to-fit=no, viewport-fit=cover" />
<title>Anchorage</title>
<!-- The `react-native-web` recommended style reset: https://necolas.github.io/react-native-web/docs/setup/#root-element -->
<style id="expo-reset">
/* These styles make the body full-height */
html,
body {
height: 100%;
}
/* These styles disable body scrolling if you are using <ScrollView> */
body {
overflow: hidden;
}
/* These styles make the root element full-height */
#root {
display: flex;
height: 100%;
flex: 1;
}
</style>
<link rel="icon" href="/customer-app/favicon.ico"/><link rel="manifest" href="/customer-app/manifest.webmanifest"/>
<meta name="theme-color" content="#000000"/>
<meta name="description" content="For guests of The Anchorage: takeaway, bookings, rewards and more."/>
<meta name="mobile-web-app-capable" content="yes"/>
<meta name="apple-mobile-web-app-capable" content="yes"/>
<meta name="apple-mobile-web-app-status-bar-style" content="black"/>
<meta name="apple-mobile-web-app-title" content="Anchorage"/>
<link rel="apple-touch-icon" href="/customer-app/apple-touch-icon.png"/>
<style>html,body{background:#0B0B0B}</style>
<script>(function(){var p=location.pathname;if(/\/index\.html$/.test(p))history.replaceState(null,'',p.slice(0,-10)+location.search+location.hash);})();</script>
<script>(function(){try{var r=sessionStorage.getItem('cc-redirect');if(!r)return;sessionStorage.removeItem('cc-redirect');var u=new URL(r,location.href);if(u.origin===location.origin&&u.pathname.indexOf('/customer-app/')===0&&u.pathname!==location.pathname)history.replaceState(null,'',u.pathname+u.search+u.hash);}catch(e){}})();</script>
<script>/* v0.2.21 update prompt: 'A new version is ready' with an Update button (posts SKIP_WAITING; the page reloads once). v0.2.22: shown through the app's shared slider (window.ccSlider) once the app has loaded, so it queues with other notices; this plain copy is the fallback before then. */
function ccShowUpdate(w){if(window.ccSlider){window.ccSlider({id:'app-update',title:'A new version of the app is ready.',testID:'cc-update',actions:[{label:'Update',testID:'cc-update-btn',keepOpen:true,onPress:function(){try{w.postMessage({type:'SKIP_WAITING'});}catch(e){location.reload();}setTimeout(function(){location.reload();},4000);}},{label:'Later',kind:'ghost'}]});return;}if(document.getElementById('cc-update'))return;var b=document.createElement('div');b.id='cc-update';b.setAttribute('role','status');b.style.cssText='position:fixed;left:12px;right:12px;bottom:calc(12px + env(safe-area-inset-bottom));z-index:2147483000;max-width:520px;margin:0 auto;display:flex;align-items:center;gap:12px;padding:12px 14px;border-radius:14px;background:#17140F;border:1px solid rgba(207,164,95,.55);box-shadow:0 10px 30px rgba(0,0,0,.6);animation:ccsl-in .45s cubic-bezier(.2,1,.3,1) both;font:500 15px system-ui,sans-serif;color:#F5F1E8';b.innerHTML='<style>@keyframes ccsl-in{from{opacity:0;transform:translate3d(0,110%,0)}to{opacity:1;transform:none}}@media (prefers-reduced-motion: reduce){#cc-update{animation:none!important}}</style><span style="flex:1">A new version of the app is ready.</span>';var u=document.createElement('button');u.textContent='Update';u.id='cc-update-btn';u.style.cssText='min-height:44px;padding:0 18px;border-radius:12px;border:0;background:#CFA45F;color:#17130D;font:700 15px system-ui,sans-serif;cursor:pointer';u.onclick=function(){u.textContent='Updating…';try{w.postMessage({type:'SKIP_WAITING'});}catch(e){location.reload();}setTimeout(function(){location.reload();},4000);};var l=document.createElement('button');l.textContent='Later';l.style.cssText='min-height:44px;padding:0 10px;border:0;background:transparent;color:#A89A80;font:500 14px system-ui,sans-serif;cursor:pointer';l.onclick=function(){b.remove();};b.appendChild(u);b.appendChild(l);document.body.appendChild(b);}
function ccWatch(r){if(r.waiting&&navigator.serviceWorker.controller)ccShowUpdate(r.waiting);r.addEventListener('updatefound',function(){var n=r.installing;if(!n)return;n.addEventListener('statechange',function(){if(n.state==='installed'&&navigator.serviceWorker.controller)ccShowUpdate(n);});});}</script>
<script>if('serviceWorker' in navigator){var hadSW=!!navigator.serviceWorker.controller,reloaded=false;navigator.serviceWorker.addEventListener('controllerchange',function(){if(hadSW&&!reloaded){reloaded=true;location.reload();}});window.addEventListener('load',function(){navigator.serviceWorker.register('/customer-app/sw.js',{scope:'/customer-app/',updateViaCache:'none'}).then(function(r){ccWatch(r);r.update().catch(function(){});setInterval(function(){r.update().catch(function(){});},30*60000);}).catch(function(e){console.warn('SW',e)});});}</script>
<style>html,body,#root{overflow-x:hidden;max-width:100vw;overscroll-behavior:none}body{touch-action:pan-x pan-y}</style><script>document.addEventListener("gesturestart",function(e){e.preventDefault()},{passive:false});document.addEventListener("touchmove",function(e){if(e.touches&&e.touches.length>1)e.preventDefault()},{passive:false});</script></head>
<body>
<!-- Use static rendering with Expo Router to support running without JavaScript. -->
<noscript> You need to enable JavaScript to run this app. </noscript>
<!-- The root element for your Expo app. -->
<div id="root"><div id="cc-boot" style="position:fixed;inset:0;display:flex;align-items:center;justify-content:center;background:#0B0B0B"><img src="/customer-app/brand-logo.png" alt="The Anchorage" width="180" height="180"/></div></div>
<script>/* "Add to Home screen" hint for the Cover Charge web apps (injected into each app's index.html by tools/build_site.py).
Chrome/Edge/Samsung: an Install button (beforeinstallprompt). Huawei Browser, Chrome without an install prompt,
iPhone/iPad Safari: short menu steps. Shown once per app until dismissed; never inside the installed app. */
(function () {
var APP = 'Anchorage', KEY = 'cc-install-hint:' + '/customer-app/';
var standalone = (window.matchMedia && (matchMedia('(display-mode: standalone)').matches || matchMedia('(display-mode: fullscreen)').matches)) || navigator.standalone === true || /CoverChargeTablet|CoverChargePhone\//.test(navigator.userAgent);
if (standalone || window.ccDesktop || /CoverChargeMac/.test(navigator.userAgent)) return;
var bip = null, shown = false;
window.addEventListener('beforeinstallprompt', function (e) { e.preventDefault(); bip = e; if (shown) render(); });
window.addEventListener('appinstalled', function () { try { localStorage.setItem(KEY, 'installed'); } catch (e) {} close(); });
var ua = navigator.userAgent, box, HUAWEI = /HuaweiBrowser|HBPC\//i.test(ua);
function steps() {
if (HUAWEI) return 'In Huawei Browser: tap <b>⋮</b> (or <b>☰</b>), then <b>Add to</b> › <b>Home screen</b> (on some versions <b>Add page to</b> › <b>Home screen</b>). If nothing appears, allow <b>Create shortcuts</b> for the browser in Settings › Apps › Huawei Browser › Permissions.';
if (/iPhone|iPad|iPod/.test(ua)) return 'In Safari: tap <b>Share</b> (the square with an arrow), then <b>Add to Home Screen</b> › <b>Add</b>.';
if (/SamsungBrowser/.test(ua)) return 'Tap <b>☰</b>, then <b>Add page to</b> › <b>Home screen</b>.';
return 'In Chrome: tap <b>⋮</b>, then <b>Add to Home screen</b> or <b>Install app</b>. On Huawei phones also allow <b>Create shortcuts</b> for Chrome in Settings › Apps › Chrome › Permissions.';
}
function close() { if (box) { box.remove(); box = null; } }
function render() {
close(); shown = true;
box = document.createElement('div'); box.id = 'cc-install-hint'; box.setAttribute('role', 'dialog'); box.setAttribute('aria-label', 'Add to Home screen');
box.style.cssText = 'position:fixed;left:10px;right:10px;bottom:calc(76px + env(safe-area-inset-bottom));z-index:2147483000;max-width:520px;margin:0 auto;background:#141414;color:#F2EDE4;border:1px solid #CFA45F;border-radius:14px;padding:'+(innerWidth<600?'9px 12px':'12px 14px')+';font:'+(innerWidth<600?'13px/1.35':'14px/1.45')+' Poppins_400Regular,system-ui,sans-serif;box-shadow:0 6px 24px rgba(0,0,0,.6)';
box.innerHTML = '<div style="font-weight:600;color:#CFA45F;margin-bottom:4px">Add ' + APP + ' to your Home screen</div>' +
'<div>' + (bip && !HUAWEI ? 'It opens like a normal app, full screen, and works without a signal after the first visit.' : steps()) + '</div>' +
'<div style="display:flex;gap:8px;justify-content:flex-end;margin-top:'+(innerWidth<600?'6px':'10px')+'">' +
'<button type="button" data-x="later" style="background:none;border:1px solid #555;color:#F2EDE4;border-radius:10px;padding:7px 12px;font:inherit">Not now</button>' +
(bip ? '<button type="button" data-x="install" style="background:#CFA45F;border:0;color:#000;border-radius:10px;padding:7px 14px;font:inherit;font-weight:600">Install</button>' : '') + '</div>';
box.addEventListener('click', function (e) {
var x = e.target && e.target.getAttribute && e.target.getAttribute('data-x');
if (x === 'later') { try { localStorage.setItem(KEY, 'later'); } catch (er) {} close(); }
if (x === 'install' && bip) { bip.prompt(); bip.userChoice.then(function () { bip = null; close(); }); }
});
place(); document.body.appendChild(box);
}
// v0.2.6: step aside while a sheet or dialog is open (it used to cover the Save button on the booking sheet).
function place() {
if (!box) return;
box.style.display = busy() ? 'none' : '';
}
setInterval(place, 400);
// Also keep out of the way of the first-run welcome and the clock-in privacy note: wait until the welcome has closed,
// then a few seconds more.
function busy() { return !!document.querySelector('[aria-modal="true"], [data-testid="invite-welcome"], [data-testid="invite-bad"]'); }
var calm = 0, waiter = setInterval(function () {
calm = busy() ? 0 : calm + 1;
if (calm < 6) return;
clearInterval(waiter); var s = null; try { s = localStorage.getItem(KEY); } catch (e) {} if (!s) render();
}, 1000);
})();
</script>
<script src="/customer-app/_expo/static/js/web/bundle.js?v=0a5722d164603292a7c95f28ba542c9402512a52eb5652aa43f84a887afe00c9" defer></script></body>
</html>