跳到正文

正在自动登录…

← 返回项目列表

bas3line/ascii

网页动画终端展示图片转ASCII

为网页提供动画ASCII艺术组件的库,支持React、Next.js、Astro或纯HTML标签使用,包含236种预设图案,也可自行创作。 面向喜欢极简风格、希望在纯文本或终端风格页面中加入动态效果的开发者。

AI 中文解读 · 根据仓库描述与 README 生成 · 2026/10/16 21:51:47 · 查看原文

值得看TypeScript库与框架兼有 应用与服务
累计 Stars
984
当前热度
未达当前门槛
仓库创建时间
打开 GitHub ↗项目网站 ↗

选用指南

AI 根据 README 整理 · 2026/10/16 21:51:47

使用方式

可通过npm安装后以React组件、Astro组件、HTML标签或CLI方式使用,也可直接引用CDN脚本。

查看 README 依据
I've always been a fan of Markdown files and terminal-style websites: plain text, one monospace face, nothing that moves without a reason. The kind of quiet web that [planetscale.com](https://planetscale.com) does well. So I made this, a way to put a little motion on pages like that without giving up the style. If you like minimalism, this library is for you. ## Install ```sh npm install ascii.rest ``` Or skip installing: the [HTML tag](#html-no-build-step) loads everything from ascii.rest. Or copy the source into your project, to keep and change, through shadcn or the CLI: ```sh
The first frame is rendered on the server, so the page is whole before any script runs; the piece starts playing once the page loads. ## HTML, no build step ```html <script type="module" src="https://ascii.rest/ascii.js"></script> <ascii-art piece="donut"></ascii-art> ``` Style it like text: `ascii-art { font-size: 10px; color: teal; }`. The logos, companies and distros come in their own colours; add `mono`, `<ascii-art piece="rust" mono>`, to draw one in the text's colour instead. In a bundled app, `import "ascii.rest/element"` defines the same tag. ## In a GitHub README
## In a terminal ```sh npx ascii.rest rust # plays until you press a key npx ascii.rest night-coast --seconds 10 npx ascii.rest list # every piece's name, by category npx ascii.rest banner 'my cli' # your text in block letters ```
部署要求

浏览器需支持ES模块、自定义元素和IntersectionObserver,彩色图案还需ResizeObserver。

查看 README 依据
| `src` | or the URL of any module that follows the piece contract | | `fps` | overrides the frame rate | | `options` | JSON overriding the option defaults: `'{"text":"hello"}'` | | `label` | what it shows, for screen readers | | `mono` | draws a coloured piece in one ink, the text's colour | ## Browser support Any current browser: it needs ES modules, custom elements and `IntersectionObserver`, plus `ResizeObserver` for the coloured pieces. Importing any module on a server, for server rendering, is safe: nothing touches the DOM until a piece is mounted.
已知限制

部分系统字体缺少方框绘制字符时,需从ascii.rest加载专用字体;终端过小会裁剪图案并提示。

查看 README 依据
Many pieces draw with box drawing and block glyphs (`─ │ ╭ █ ▄ ░`). Where the system monospace face has none, as on Android, the tag and the Astro component take them from "ascii.rest mono", a 3 KB cut of [JetBrains Mono](https://github.com/JetBrains/JetBrainsMono) (OFL) served by ascii.rest, so every row keeps its width. Only a browser that lacks the glyphs fetches it. With React, put it in your own `<pre>`'s font stack: ```css @font-face { font-family: "ascii.rest mono"; src: url("https://ascii.rest/fonts/ascii-rest-mono.woff2") format("woff2");
The logos, companies, distros and scenes play in their own colours, in 24-bit colour. A scene is shrunk to fit the terminal, whatever its size, and drawn in tones, two of its rows in each of the terminal's as half blocks, so the dots it is made of blend as they do on a page. `--mono` draws a coloured piece in the terminal's own colour, for a terminal without 24-bit colour, and `--light` takes the colours meant for a light background. `--fps` and `--seconds` set the speed and the length. The piece plays centred; any other piece wider or taller than the terminal shows only its middle, and it

README

正在加载 README…

收录信息

仓库创建时间
2026/10/7 14:48:54
首次达标收录
2026/10/9 12:11:09
统计更新时间
2026/10/22 19:10:50

按创建时长与累计 Stars 判断等级。首次达标收录后,即使未达当前门槛仍保留;累计 Stars 和仓库状态会定期更新。确认只有 README 及辅助文件的仓库会停止公开。

模型评估

值得看加权总分 4.0 / 5

新颖度
3.8
实用价值
4.0
成熟度
4.6
实质含量
3.9

由 Jev 模型根据仓库描述与 README 评估,2026/10/16 20:26:24 生成。评分仅供参考,不是代码、安全或许可证审查;热度等级另按创建时长与累计 Stars 计算。

仓库信息

最近推送
2026/10/18 02:04:13
许可证标识
MIT
Fork 数
62
当前状态
未归档

收录记录

按创建时长与累计 Stars 首次收录:小火
首次发现项目