
Security News
152 Chrome Live Wallpaper Extensions Hid Ad Tracking and Faked Google Search Traffic
A network of 152 Chrome live wallpaper extensions hid ad tracking and made extension-driven traffic look like Google search clicks.
poem-text-animator
Advanced tools
一个可直接引用的轻量文字动画库,支持逐字动画与逐行播放,适用于诗词、歌词、Slogan、Banner 文案等场景。
type="module")<link rel="stylesheet" href="./index.css" />
<div id="target"></div>
<script type="module">
import { createTextAnimator } from "./index.js";
const animator = createTextAnimator("#target", {
animationClass: "three",
charDelay: 0.05,
lineInterval: 700,
});
animator.renderLines(["你好,世界", "这是文字动画库"]);
</script>
import { createTextAnimator, ANIMATION_PRESETS } from "@/libs/poem/index.js";
import "@/libs/poem/index.css";
也支持默认导入:
import PoemTextAnimator from "@/libs/poem/index.js";
const { createTextAnimator, ANIMATION_PRESETS } = PoemTextAnimator;
createTextAnimator(container, options)container: CSS 选择器字符串或 DOM 元素。options:
baseClass:基础类名,默认 animateanimationClass:动画预设类名,默认 onelineTag:每一行的标签名,默认 pcharDelay:字符间延迟(秒),默认 0.05lineInterval:逐行渲染间隔(毫秒),默认 1000clearBeforeRender:渲染前是否清空,默认 falseanimationClasses:按行循环使用的动画类名数组animationResolver(lineIndex, options):自定义按行返回动画类名render(text, overrideOptions):渲染单行文字。renderLines(lines, overrideOptions):按时间间隔逐行渲染,返回 Promise<HTMLElement[]>。updateOptions(nextOptions):更新默认配置。cancel():取消尚未执行的逐行任务。clear():取消任务并清空容器。destroy():销毁实例。splitTextToSpans(targetElement, text, charDelay):把文本拆分为 span 并写入目标元素。库内置 7 种动画:one、two、three、four、five、six、seven。
import { ANIMATION_PRESETS } from "./index.js";
使用任意静态服务器打开目录后访问 index.html,即可看到“单卡片逐首切换”示例:共 7 首诗循环播放,并依次使用 one~seven 动画预设。
FAQs
We found that poem-text-animator demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
A network of 152 Chrome live wallpaper extensions hid ad tracking and made extension-driven traffic look like Google search clicks.

Company News
Socket’s first CISO brings deep experience securing high-growth SaaS companies as open source supply chain threats accelerate.

Company News
Replit is integrating Socket Firewall into its AI-powered development experience to help protect builders from malicious open source packages.