<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/">
  <channel>
    <title>Pwa on Mini Fish</title>
    <link>https://blog.minifish.org/tags/pwa/</link>
    <description>Recent content in Pwa on Mini Fish</description>
    <image>
      <title>Mini Fish</title>
      <url>https://blog.minifish.org/android-chrome-512x512.png</url>
      <link>https://blog.minifish.org/android-chrome-512x512.png</link>
    </image>
    <generator>Hugo -- 0.165.0</generator>
    <language>en-US</language>
    <copyright>Mini Fish 2014-present. Licensed under CC-BY-NC</copyright>
    <lastBuildDate>Thu, 11 Jun 2026 09:00:00 +0800</lastBuildDate>
    <atom:link href="https://blog.minifish.org/tags/pwa/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>driftloop: Browser Generative Music Without a Backend</title>
      <link>https://blog.minifish.org/posts/driftloop-browser-generative-music/</link>
      <pubDate>Thu, 11 Jun 2026 09:00:00 +0800</pubDate>
      <guid>https://blog.minifish.org/posts/driftloop-browser-generative-music/</guid>
      <description>A project note on driftloop, a browser-based generative music app using algorithmic composition, FluidSynth in WebAssembly, and optional Magenta melody generation.</description>
      <content:encoded><![CDATA[<p>driftloop is a pure-frontend web app that streams continuous generative background music in the browser. Click play, and the music starts. Switch style buttons, and the arrangement morphs without a hard cut.</p>
<p>The important constraint is that every note is composed and synthesized live in the browser. There are no prerecorded loops, no server, no account, and no backend generation job.</p>
<h2 id="why-it-is-not-mainly-an-ai-app">Why it is not mainly an AI app</h2>
<p>The interesting origin story is that driftloop came after an earlier model-first attempt. That earlier direction tried to distill a multi-instrument music model and sample from it for the listening experience. The output was structurally chaotic in a way that sampling tweaks did not fix.</p>
<p>driftloop starts from a different premise: for continuous background music, structure matters more than model capacity.</p>
<p>Algorithmic composition handles the load-bearing parts:</p>
<ul>
<li>chord progression</li>
<li>voice leading</li>
<li>bass motion</li>
<li>rhythm</li>
<li>drum pattern</li>
<li>section shape</li>
</ul>
<p>A small model can still help with lead melody, but it should not be responsible for making the whole piece coherent.</p>
<h2 id="runtime-shape">Runtime shape</h2>
<p>The app has two layers:</p>
<ol>
<li>Vanilla JavaScript composition logic that keeps the music in key, on grid, and structurally coherent.</li>
<li>An optional MelodyRNN path through TensorFlow.js for lead melody.</li>
</ol>
<p>Synthesis uses <code>js-synthesizer</code>, a WebAssembly port of FluidSynth, with a General MIDI SoundFont through the WebAudio API.</p>
<p>The SoundFont is large, so deployment has a practical constraint: Cloudflare Pages has a single-file size limit smaller than the SoundFont. The app fetches the SoundFont from a public upstream mirror on first launch, then the service worker caches it for offline reuse.</p>
<h2 id="what-i-learned">What I learned</h2>
<p>Generative music is not only generation. It is arrangement, continuity, transitions, repetition management, and sound rendering.</p>
<p>The most important product question is not “is it AI?” It is “can I leave this playing without getting annoyed?” That favors simple, controllable structure over model novelty.</p>
<h2 id="current-status">Current status</h2>
<p>driftloop is private but product-shaped. It is a static PWA candidate, and the current architecture is intentionally deployable without backend secrets or runtime infrastructure.</p>
]]></content:encoded>
    </item>
    <item>
      <title>AeroPlay: A Flight-Mode Game Hub</title>
      <link>https://blog.minifish.org/posts/aeroplay-offline-game-hub/</link>
      <pubDate>Wed, 03 Jun 2026 09:00:00 +0800</pubDate>
      <guid>https://blog.minifish.org/posts/aeroplay-offline-game-hub/</guid>
      <description>A project note on AeroPlay, a pure frontend offline game hub with mini games, localStorage progress, service worker caching, and add-to-home-screen support.</description>
      <content:encoded><![CDATA[<p>AeroPlay is a pure-frontend, mobile-first game hub optimized for flight-mode use. It includes small games like Snake, Tetris, 2048, Flappy Bird, Maze, Match-3, Sudoku, and Lights Out.</p>
<p>The whole point is that it should keep working with no network.</p>
<h2 id="why-build-it">Why build it</h2>
<p>Airplane mode is a useful product constraint. It removes a lot of lazy assumptions:</p>
<ul>
<li>no backend calls</li>
<li>no CDN dependency during play</li>
<li>no login</li>
<li>no remote save</li>
<li>no ads</li>
<li>no analytics requirement</li>
</ul>
<p>What remains is the app itself: local assets, local state, and games that are worth playing in short sessions.</p>
<h2 id="template-shape">Template shape</h2>
<p>AeroPlay is also designed as a template. The repo can be used to bootstrap another offline game hub without carrying old issues or unrelated history.</p>
<p>That makes the project more useful than a single app. It becomes a base pattern:</p>
<ul>
<li>Vite and TypeScript</li>
<li>local game modules</li>
<li>service worker</li>
<li>manifest</li>
<li><code>localStorage</code> progress</li>
<li>mobile-first layout</li>
</ul>
<h2 id="product-boundary">Product boundary</h2>
<p>The project should not become a general gaming platform. Its strength is the opposite: a small set of local games, predictable input, and no network requirement.</p>
<p>For this kind of app, “more features” can easily make the experience worse. If the user opens it in flight mode, the app should not show half-broken online features.</p>
<h2 id="what-i-learned">What I learned</h2>
<p>Offline-first is easiest when it is a requirement from the beginning. Retrofitting offline behavior onto an app that assumed servers and remote assets is much harder.</p>
<p>AeroPlay also shows that simple games still need polish:</p>
<ul>
<li>touch controls</li>
<li>stable layout</li>
<li>saved state</li>
<li>fast startup</li>
<li>no accidental scroll</li>
<li>clear pause and restart behavior</li>
</ul>
<p>Those details matter more on a phone than in a desktop demo.</p>
<h2 id="open-source-status">Open source status</h2>
<p>AeroPlay is public because it is self-contained, harmless to share, and useful as a template. It is a good example of a small project whose constraints make it more reusable.</p>
]]></content:encoded>
    </item>
    <item>
      <title>TapSurge: An iPad Tap-Speed Tool Built for Competition Use</title>
      <link>https://blog.minifish.org/posts/tapsurge-ipad-tap-test/</link>
      <pubDate>Sun, 24 May 2026 08:20:00 +0800</pubDate>
      <guid>https://blog.minifish.org/posts/tapsurge-ipad-tap-test/</guid>
      <description>A project note on TapSurge, a Vite and TypeScript tap-speed competition tool designed for iPad, offline use, and raw timestamp export.</description>
      <content:encoded><![CDATA[<p>TapSurge is an offline-first multi-finger click-speed test for iPad competition use. It is built with Vite, TypeScript, native DOM APIs, and Canvas.</p>
<p>The product sounds tiny: count taps for 10, 30, or 60 seconds. The interesting part is making that count credible.</p>
<h2 id="why-a-custom-tool">Why a custom tool</h2>
<p>Most tap-speed apps are built for casual play. Competition use has different requirements:</p>
<ul>
<li>work offline</li>
<li>run well on an iPad</li>
<li>avoid accidental browser gestures</li>
<li>count multi-finger input correctly</li>
<li>preserve enough raw data to audit a run</li>
<li>keep history locally without accounts</li>
</ul>
<p>For this use case, simplicity matters more than visual novelty.</p>
<h2 id="input-model">Input model</h2>
<p>TapSurge uses <code>pointerdown</code> and active pointer tracking. The key rule is that holding a finger down should not count repeatedly. A tap is a new press, not a frame, animation event, or repeated touch state.</p>
<p>The app records:</p>
<ul>
<li>total taps</li>
<li>average CPS</li>
<li>one-second live CPS</li>
<li>maximum live CPS</li>
<li>maximum simultaneous fingers</li>
<li>raw timestamps and pointer IDs</li>
</ul>
<p>That raw data is important. It lets a run be inspected after the fact instead of trusting only the final number.</p>
<h2 id="offline-design">Offline design</h2>
<p>The app is intended to work in a PWA-like mode. It has a local app shell, a service worker, and no backend dependency during play.</p>
<p>This is one of those projects where offline support is not a nice extra. It is part of the user story. If the tool is used at a booth, in a classroom, or during a small event, network dependency is unnecessary risk.</p>
<h2 id="ui-constraints">UI constraints</h2>
<p>The UI has to be obvious under pressure. A player should not be reading instructions while the timer is running.</p>
<p>The controls are intentionally few:</p>
<ul>
<li>choose duration</li>
<li>start</li>
<li>tap</li>
<li>see result</li>
<li>review history</li>
<li>export evidence if needed</li>
</ul>
<p>The harder work is preventing the browser from interfering: double-tap zoom, scroll gestures, safe-area issues, and fullscreen behavior all matter more on a real iPad than in a desktop browser.</p>
<h2 id="what-i-learned">What I learned</h2>
<p>Small event tools benefit from being boring. The best version is not the most animated one; it is the one that produces trustworthy results with minimal setup.</p>
<p>TapSurge is a good example of a private tool that could be public, but does not need a large roadmap. Its scope is the feature.</p>
]]></content:encoded>
    </item>
    <item>
      <title>PocketBabel: Browser Translation Without a Backend</title>
      <link>https://blog.minifish.org/posts/pocketbabel-browser-translation/</link>
      <pubDate>Sun, 24 May 2026 08:05:00 +0800</pubDate>
      <guid>https://blog.minifish.org/posts/pocketbabel-browser-translation/</guid>
      <description>A project note on PocketBabel, a frontend-only English-Chinese translation app powered by transformers.js and designed for offline reuse.</description>
      <content:encoded><![CDATA[<p>PocketBabel is a frontend-only English-Chinese translation app. It uses <code>@huggingface/transformers</code> in the browser, targets Cloudflare Pages, and is designed to keep working after the model has been downloaded and cached.</p>
<p>The important constraint is that there is no backend inference service. The browser is not just the UI; it is also the runtime.</p>
<h2 id="why-build-it">Why build it</h2>
<p>Most translation tools are service-shaped: text goes to a server, the server runs a model, and the result comes back. That is fine for many cases, but it is also more infrastructure than I wanted for a narrow personal tool.</p>
<p>PocketBabel asks a smaller question: if the scope is only English to Chinese and Chinese to English, can the whole product be a static site?</p>
<p>That decision makes the system easier to reason about:</p>
<ul>
<li>no API key</li>
<li>no account system</li>
<li>no backend deployment</li>
<li>no request logging</li>
<li>no server-side scaling problem</li>
</ul>
<p>The cost is that the first model download matters and browser performance becomes part of the product.</p>
<h2 id="product-boundary">Product boundary</h2>
<p>The project intentionally avoids becoming a general translation platform. The current shape is narrow:</p>
<ul>
<li>English to Chinese</li>
<li>Chinese to English</li>
<li>text input and output</li>
<li>desktop and mobile browser support</li>
<li>PWA shell and offline reuse</li>
</ul>
<p>It does not try to support OCR, speech input, synced history, arbitrary language pairs, or collaborative workflows. Those features are tempting, but they would change the project from a useful small app into a maintenance surface.</p>
<h2 id="technical-shape">Technical shape</h2>
<p>The implementation is a React and Vite app. Translation is handled by transformers.js with browser-side model loading and caching. Deployment is static, which makes Cloudflare Pages a natural fit.</p>
<p>The UI challenge is not only making a textarea and a button. The app needs to explain model state without becoming noisy:</p>
<ul>
<li>model not downloaded yet</li>
<li>model loading</li>
<li>translation running</li>
<li>offline reuse available</li>
<li>failure state when the browser cannot support the runtime well</li>
</ul>
<p>For an app like this, good status text is part of the architecture. If users do not know whether the model is downloading, warming up, or stuck, the app feels broken even when the code is doing the right thing.</p>
<h2 id="what-i-learned">What I learned</h2>
<p>Browser AI is practical when the product scope is narrow. It is much less practical when you pretend the browser is a free replacement for a server.</p>
<p>The useful pattern is:</p>
<ol>
<li>choose a task with a clear input and output</li>
<li>constrain the model set</li>
<li>make loading and caching behavior visible</li>
<li>avoid account and sync features unless they are essential</li>
</ol>
<p>PocketBabel works because it does not try to be Google Translate. It is a small translation surface for a small set of language directions.</p>
<h2 id="june-2026-update">June 2026 update</h2>
<p>The pushed version has grown in two small but useful directions without changing the core product boundary.</p>
<p>First, short word or phrase inputs can now use dictionary-style prompts. That makes PocketBabel more useful for vocabulary lookup: instead of treating every short input as a sentence, the app can ask for meanings, part-of-speech style structure, and usage notes.</p>
<p>Second, translated output can be read aloud through the browser&rsquo;s <code>speechSynthesis</code> API when the browser supports it. This is deliberately output speech, not speech input or speech translation. It keeps the app frontend-only while making the translated result easier to check.</p>
<h2 id="open-source-status">Open source status</h2>
<p>PocketBabel is public because the architecture is self-contained and does not rely on private infrastructure. It is also a good example of the kind of project that benefits from being inspectable: the privacy story is stronger when the code path is visible.</p>
]]></content:encoded>
    </item>
  </channel>
</rss>
