The Annoyance That Started This
Описание и применение
Небольшое статическое приложение, использующее чистый HTML, CSS Grid и JavaScript, быстро генерирует повторяющийся текст, копирует его в буфер обмена и сохраняет как файл, без серверов и рекламы.
Задача
Existing online tools for repeating a string were slow, bloated, and unreliable, especially for large counts.
Результат
A 5‑KB static page that loads instantly, scores 100 on Lighthouse, and handles thousands of repetitions without performance issues.
Рабочий процесс
- 1. Create a static HTML page with input fields for text, count, and options for numbering and separator.
- 2. Use CSS Grid with
auto-fillandminmaxto layout output in a responsive grid without JavaScript. - 3. Build the repeated string using an array and
jointo avoid costly string concatenation. - 4. Attach a click handler to copy the output to the clipboard using
navigator.clipboard.writeText. - 5. Provide a download button that creates a Blob, generates an object URL, triggers a click on a hidden link, and revokes the URL.
- 6. Test performance with large counts to ensure no visible hitches.
Доказательства
The finished tool is a handful of KB, loads instantly, and scores 100 on Lighthouse
Array build and a single join fixes this outright
Blob plus an object URL does the whole job with no server involved
- Дата записи: 2026-09-20T16:18:34.290Z