'use strict'; // ---- Simple mode: for young children or grandparents. A parent turns it on for a person; the app then has no menus, just a Home screen of big buttons for the few // things they can use, and a big Home button to get back. function simpleStart() { if (!ME || !ME.simple) return; document.body.classList.add('simple'); if (!document.getElementById('simplehome')) { const b = document.createElement('a'); b.id = 'simplehome'; b.href = '#/home'; b.innerHTML = icon('home') + 'Home'; document.body.appendChild(b); } const sync = () => { const h = document.getElementById('simplehome'); if (h) h.hidden = !location.hash || location.hash === '#/' || location.hash === '#/home'; }; addEventListener('hashchange', sync); sync(); } function viewSimple() { const tabs = leafTabs().filter(t => !['settings', 'search', 'family', 'files', 'office', 'links', 'planner'].includes(t[0]) && t[0] !== 'home'), h = new Date().getHours(), greet = h < 12 ? 'Good morning' : h < 18 ? 'Good afternoon' : 'Good evening'; $('#view').innerHTML = `

${greet}${ME ? ', ' + esc(ME.name.split(' ')[0]) : ''}!

${tabs.map(([id, label]) => `${icon(TAB_ICON[id] || 'menu')}${esc(label)}`).join('') || '

Nothing is turned on yet. Ask a parent.

'}
`; }