A friendly kids learning app parent login screen in pure CSS and vanilla JavaScript: a parent gate with a simple maths question unlocks the email and password sign-in form. It is an HTML mobile template for mobile sites and PWAs and can be packaged as a native app with Capacitor. Use it as the parental gate and parent sign-in UI of an education app, a reading app or any children's app that keeps settings behind a grown-up check.
How it works
The root .kpl-app is a 430 px app column on a sky background. A top bar holds a back button, the Tumbletree brand and a help button. Below it, an inline SVG illustration with alphabet blocks and a book sits in the rounded .kpl-art card.
The .kpl-gate form asks a question that makeQuestion() builds at random (an addition or a times table) and writes in words through toWords(), so early readers cannot simply copy digits. The answer field uses inputmode="numeric" and accepts digits only. A wrong answer shows a message and swaps in a new question. The right answer enables the [data-kpl-fields] fieldset, sets data-kpl-gate-state="open" on the root, shows an "Unlocked" badge and moves focus to the email field.
The .kpl-form checks the email format and an 8-character password, shows inline errors and simulates the request. On success the form is replaced by .kpl-done, where the parent picks a child profile.
Two bottom sheets, help and password reset, open from [data-kpl-open] buttons. They close with Escape, the backdrop or a close button, keep Tab focus inside, and return focus to the opener. The reset sheet validates the email and shows a confirmation.
Customization
--kpl-sky,--kpl-accentand--kpl-accent-darkon.kpl-appinstyle.css: page tint, the orange buttons and their pressed shadow.--kpl-radius: rounding of cards, the gate and buttons (22 px by default).makeQuestion()inscript.js: change the number ranges inrand()to make the parent gate harder or easier.SUBMIT_DELAY: length of the simulated sign-in. Replace thesetTimeoutin the form submit handler withfetch()to your auth endpoint.- Edit the
.kpl-profilebuttons inindex.htmlto list the real child profiles, and their.kpl-avatar--a/.kpl-avatar--bcolours instyle.css. - Replace the inline SVG in
.kpl-artwith your own illustration.
Use cases
- Kids learning apps: parents sign in to manage profiles, progress and subscriptions.
- Reading and storytelling apps: keep purchases and settings behind a grown-up check.
- Kids games: a parental gate before external links or account screens.
- School and tutoring apps: parent accounts that sit next to a child mode.
Accessibility
The gate question is the label of the answer field and feedback is announced in a polite live region. Inputs use autocomplete="email" and current-password, errors are linked with aria-describedby and aria-invalid. The password toggle uses aria-pressed. Sheets are role="dialog" with aria-modal="true". Touch targets are at least 44 px and the sheet animation is disabled for prefers-reduced-motion.