Touch Grass: voice dares that get you off the screen, running on-device with Gemma 3 270M
Описание и применение
Touch Grass — это PWA, генерирующая короткие задания на свежем воздухе на основе пользовательского ввода времени и энергии, используя модель Gemma 3 270M в браузере для обеспечения конфиденциальности и работы без сети.
Задача
Users often spend time on their phones without taking action, leading to inactivity and missed opportunities to be outdoors.
Результат
Touch Grass provides a privacy‑preserving, offline‑capable solution that turns idle phone time into actionable outdoor activity, with a single dare, photo proof, and streak tracking.
Рабочий процесс
- 1. User opens the PWA and speaks their available time and energy via the Web Speech API.
- 2. The app matches the input against a curated dare bank (dares.json) or, if a Hugging Face token is provided, generates a new dare with Gemma 3 270M via transformers.js.
- 3. The generated dare is spoken using the browser’s speechSynthesis and displayed in a dialogue ribbon with time/energy tags and a "prove it outside" button.
- 4. The user clicks the button, the camera opens via getUserMedia, captures a photo, and saves it as proof of completion.
- 5. The app records the completion toward a daily streak and updates the UI accordingly.
Доказательства
Touch Grass — say how much time and energy you've got, and it gives you one short, concrete dare to go do outside.
It's a PWA: install it, and after the first load it keeps working with no signal, because the shell and the model are both cached by a service worker.
dare generation runs on-device with gemma 3 270m via transformers.js, not a hosted api
The app is a static site, no build step.
Camera proof uses getUserMedia + canvas, with a defensive timeout — confirmed by hand that getUserMedia can hang indefinitely on a device with no camera rather than reject, which otherwise traps the UI with no way out.
- Дата записи: 2026-10-10T19:41:01.062Z