Story Bell Logo Story Bell

These stories spark wonder, amazement, excitement and astonishment, guiding children through unexpected events with curiosity and joy. Each tale encourages flexibility, open‑mindedness and a delight in discovery, turning surprise into a positive experience. Explore more: Stories About Happiness for Kids Stories About Sadness for Kids Stories About Fear for Kids Stories About Anger for Kids

Social–Emotional Learning Focus

Emma and the Surprise Party

Emma and the Surprise Party

Emma plans a secret party for her granddad and learns the joy of surprises.

The Secret in the Library

The Secret in the Library

An adventure about two friends solving a mystery, and the surprise they find.

if (!window.firebase) { console.error("Firebase SDK not found"); } let _sbUI; function ensureUI(){ if (!_sbUI) _sbUI = new firebaseui.auth.AuthUI(firebase.auth()); return _sbUI; } window.openAuthModal = function(){ var modal = document.getElementById('auth-modal'); if(!modal){ console.warn('auth-modal not found'); return; } // Show modal immediately modal.style.display = 'flex'; // Ensure container exists inside modal var container = document.getElementById('firebaseui-auth-container'); if(!container){ var content = modal.querySelector('.auth-modal-content, .modal-content, [role="dialog"]') || modal; container = document.createElement('div'); container.id = 'firebaseui-auth-container'; content.appendChild(container); } // Make sure container is visible container.style.display = 'block'; container.style.minHeight = '140px'; // Helper: start FirebaseUI with singleton and safe defaults function startUI(){ try{ if(!(window.firebase && window.firebaseui && firebase.auth)) return false; var ui = window.firebaseui.auth.AuthUI.getInstance() || new firebaseui.auth.AuthUI(firebase.auth()); var cfg = { signInFlow: 'popup', credentialHelper: (window.firebaseui && firebaseui.auth && firebaseui.auth.CredentialHelper) ? firebaseui.auth.CredentialHelper.NONE : undefined, signInOptions: [ firebase.auth.GoogleAuthProvider.PROVIDER_ID, firebase.auth.EmailAuthProvider.PROVIDER_ID ], callbacks: { signInSuccessWithAuthResult: function(){ if (typeof window.closeAuthModal==='function') window.closeAuthModal(); return false; } } }; ui.start('#firebaseui-auth-container', cfg); return true; }catch(e){ console.error('startUI error', e); return false; } } // If project defines a hook, let it run first (it may build custom menu/UI) try { if (typeof window.onOpenAuthModalHook === 'function') window.onOpenAuthModalHook(); } catch(e){ console.error(e); } // Robust first-open: retry until buttons appear (max ~1s) var tries = 0; function needButtons(){ var has = container.querySelector('.firebaseui-idp-button, .firebaseui-idp-list, .firebaseui-card-content, .firebaseui-provider-wrapper'); return !has; } function tick(){ // Start if not already started if (needButtons()) { startUI(); } tries++; if (needButtons() && tries < 7) { // Wait a frame + small delay to allow CSS/layout & hook work setTimeout(tick, 150); } } // Kick off after a frame so modal is in the layout if (document.startViewTransition) { // No-op; just schedule requestAnimationFrame(tick); } else { requestAnimationFrame(tick); } }; window.closeAuthModal = function(){ const m = document.getElementById('auth-modal'); if (m) m.style.display = 'none'; }; window.signOutFirebase = function(){ if (firebase?.auth) { firebase.auth().signOut().then(()=>alert('Signed out')).catch(console.error); } }; document.addEventListener('click', function(e){ const m = document.getElementById('auth-modal'); if (!m) return; if (e.target === m) closeAuthModal(); }); // Guard sign-in behind consent checkbox (function(){ function enforceConsent(){ var c = document.getElementById('sb-consent'); if (!c || c.checked) return true; alert('Please agree to the Terms & Privacy Policy to continue.'); return false; } // Intercept clicks inside the FirebaseUI area document.addEventListener('click', function(e){ var modal = document.getElementById('auth-modal'); var container = document.getElementById('firebaseui-auth-container'); if (!modal || !container) return; if (modal.style.display !== 'flex') return; if (container.contains(e.target)) { if (!enforceConsent()){ e.stopPropagation(); e.preventDefault(); return false; } } }, true); })(); // Enforce consent checkbox before sign-in (function(){ function enforceConsent(){ var c = document.getElementById('sb-consent'); if (!c || c.checked) return true; alert('Please agree to the Terms & Privacy Policy to continue.'); return false; } document.addEventListener('click', function(e){ var m = document.getElementById('auth-modal'); var container = document.getElementById('firebaseui-auth-container'); if (!m || !container) return; if (m.style.display !== 'flex') return; if (container.contains(e.target)) { if (!enforceConsent()){ e.stopPropagation(); e.preventDefault(); return false; } } }, true); })();