Urgent.News

What's breaking now, across hundreds of outlets.

Tech

Animated ASCII Art for Web Pages

A collection of 191 animated ASCII art pieces is now available for web developers to enhance their web pages. These pieces include 13 full-color scenes, loaders, charts, type, 27 language logos, and 22 Linux distros, available in either color or black and white. The collection also features 3D shapes, physics, and creatures.

Each piece is a small, typed TypeScript module that requires no dependencies, making it compatible with React, Next.js, Astro, or a plain HTML page. The best part? These animated ASCII art pieces are free to use and modify under the MIT license, with no install or build step required.

The animated ASCII art system is defined by the ascii.js file, which creates an 'ascii-art' tag. This tag loads the piece from ascii.rest, plays it while it's on screen, and holds the first frame for those who prefer reduced motion. To use a specific piece, you only need to pass its name, such as 'piece=donut', to the tag.

The system works seamlessly with the Next.js app router, as it returns the first frame on the server, ensuring the page is fully loaded before any scripts run. Once the piece loads, it plays the animation. To stop the animation, the system returns a function that can be called.

Every aspect of these animated ASCII pieces, including options and frames, is typed, providing developers with a clear structure and better code management.

Rewritten by urgent.news; may contain errors — check the original.

Source: ascii.rest

Other reports of this story

Every outlet that reported this, and when →

Read the original at ascii.rest →

Report a problem with this story

More in Tech

More from Wednesday 7 October →