惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

人人都是产品经理
人人都是产品经理
博客园_首页
IT之家
IT之家
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
Vercel News
Vercel News
美团技术团队
D
Docker
WordPress大学
WordPress大学
T
Tailwind CSS Blog
酷 壳 – CoolShell
酷 壳 – CoolShell
The Cloudflare Blog
Y
Y Combinator Blog
F
Fortinet All Blogs
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
G
Google Developers Blog
爱范儿
爱范儿
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
月光博客
月光博客
MongoDB | Blog
MongoDB | Blog
S
SegmentFault 最新的问题
GbyAI
GbyAI
Hugging Face - Blog
Hugging Face - Blog
Microsoft Azure Blog
Microsoft Azure Blog
A
About on SuperTechFans

Hacker News: Show HN

PurrrrrFocus: Pomodoro Timer App - App Store Workflow Engine — Multi-Step Orchestration for Bun RapidPhoto: Pro Photo Editor App - App Store GitHub - DheerG/swarms: Achieve extraordinary results with claude code across a variety of tasks SPICE simulation → oscilloscope → verification with Claude Code — Lucas Gerads Show HN: VCoding – A 5 MB native Windows IDE with no dynamic dependencies Show HN: LLMs don't hallucinate because they're bad at math, it's the format GitHub - Agent-FM/agentfm-core: AgentFM is a peer-to-peer network that turns everyday computers into a decentralized AI supercomputer. AgentFM lets you run massive AI workloads directly across a global mesh of idle CPUs and GPUs. Show HN: Tracking Top US Science Olympiad Alumni over Last 25 Years GitHub - Potarix/agent-hub: One place to talk to all your agents Show HN: Runtime security for AI agents(injection,tool abuse, data exfiltration) GitHub - dubeyKartikay/lazyspotify: Terminal Spotify client for macOS and Linux GitHub - the-banana-tool/king-louie: Easy to use GUI Personal AI Assistant. Win/Linux/Mac. Show HN I made my vacation rental bookable by AI agents–no Airbnb, 0% commission GitHub - basteez/jsf-autoreload: maven plugin to enable hot reload on jsf projects uvm32/hosts/host-gdbstub at main · ringtailsoftware/uvm32 GitHub - labsai/EDDI: Config-driven engine that turns JSON into production-grade AI agents. Multi-agent orchestration, 12+ LLM providers, MCP/A2A protocols, RAG, persistent memory, and enterprise compliance (EU AI Act, GDPR, HIPAA). Built on Quarkus. GitHub - glitchnsec/fortyone-oss: AI Executive Assistant Platform Quickstart | Alien GitHub - muxshed/shed: One stream in, or many. Every destination, simultaneously. No cloud middleman, no per-channel fees, no limits. GitHub - ocrbase-hq/ocrbase: 📄 PDF/IMG ->.MD/JSON Document OCR API for PaddleOCR and GLMOCR. Self-hostable. GitHub - impactjo/home-memory: MCP server that lets your AI assistant remember everything about your home. GitHub - Sets88/dbcls: DbCls is a powerful terminal database client that supports various databases GitHub - neptun2000/heor-agent-mcp GitHub - SeanFDZ/macmind: Single-layer transformer in HyperTalk for the classic Macintosh RollQuation: Math Puzzles - Apps on Google Play GitHub - dropbox/witchcraft Show HN: Agent-cache – Multi-tier LLM/tool/session caching for Valkey and Redis GitHub - opentalon/opentalon: OpenTalon is an open-source platform built from the ground up in Go as a robust alternative to OpenClaw LinkedIn™ 职位抓取工具 - Chrome 应用商店
GitHub - Jannchie/text-trace: Create Keynote-style SVG te...
jannchie · 2026-04-26 · via Hacker News: Show HN

Demo

Text Trace demo

Packages

  • @text-trace/core: framework-agnostic SVG text trace animation.
  • @text-trace/vue: Vue binding.
  • @text-trace/react: React binding.
  • text-trace-playground: native TypeScript playground for debugging @text-trace/core.

Usage

import { createTextTrace } from "@text-trace/core";

const svg = document.querySelector<SVGSVGElement>("svg")!;
const trace = createTextTrace(svg, {
  text: "Snowcake47",
  ariaLabel: "Snowcake47"
});

await trace.render();

React:

import { TextTrace } from "@text-trace/react";

export function Logo() {
  return <TextTrace text="Snowcake47" aria-label="Snowcake47" />;
}

Vue:

<script setup lang="ts">
import { TextTrace } from "@text-trace/vue";
</script>

<template>
  <TextTrace text="Snowcake47" aria-label="Snowcake47" />
</template>

Nuxt:

<script setup lang="ts">
import { TextTrace } from "@text-trace/vue";
</script>

<template>
  <ClientOnly>
    <TextTrace text="Snowcake47" aria-label="Snowcake47" />
  </ClientOnly>
</template>

Fonts

@text-trace/core does not bundle font files. The default font presets use CDN URLs for quick demos, so production pages should pass a font hosted by your own app.

Pass one local font with fontSource:

import brandFontUrl from "./brand-font.woff?url";

createTextTrace(svg, {
  text: "Snowcake47",
  fontKey: "brand",
  fontSource: brandFontUrl
});

Or pass multiple local fonts with fontSources:

createTextTrace(svg, {
  text: "Snowcake47",
  fontKey: "brand",
  fontSources: {
    brand: "/fonts/brand.woff",
    display: "/fonts/display.woff"
  }
});

WOFF2 fonts are supported, but the decompressor must be provided explicitly. Install wawoff2 if you want to use its browser binding, and host that binding with your app too:

import brandFontUrl from "./brand-font.woff2?url";
import wawoff2Url from "wawoff2/build/decompress_binding.js?url";

createTextTrace(svg, {
  text: "Snowcake47",
  fontKey: "brand",
  fontSource: brandFontUrl,
  wawoff2Url
});

fontUrls is still supported as a backwards-compatible alias for URL-only sources. The CDN presets are exported as TEXT_TRACE_FONT_URLS and TEXT_TRACE_CDN_FONT_URLS for demos or quick experiments.

Accessibility

The SVG uses role="img" and an accessible name by default. The name comes from ariaLabel / aria-label, falling back to text. Core also inserts a <title> element as an SVG fallback.

Use decorative: true when the animation is purely decorative and real text is already present nearby.

Per-Glyph Styles

Use glyphStyles to override colors for specific character indexes. from is inclusive and to is exclusive.

createTextTrace(svg, {
  text: "Snowcake47",
  textColor: "#111827",
  guideColor: "#111827",
  glyphStyles: [
    {
      at: [8, 9],
      style: {
        textColor: "#2563eb",
        guideColor: "#2563eb"
      }
    },
    {
      from: 4,
      to: 8,
      style: {
        textColor: "#dc2626"
      }
    }
  ]
});

SVG Paths

Use getTextTracePaths when you only need the generated glyph paths:

import { getTextTracePaths } from "@text-trace/core";

const result = await getTextTracePaths({
  text: "Snowcake47",
  fontKey: "inter"
});

console.log(result.viewBox, result.paths.map((path) => path.d));

Development

pnpm install
pnpm dev

Build all packages and the playground:

pnpm build

Timing

@text-trace/core accepts a duration option in milliseconds and a timing option with phase positions from 0 to 1:

createTextTrace(svg, {
  text: "Hello, world!",
  textColor: "#111827",
  guideColor: "#111827",
  duration: 1000,
  timing: {
    horizontal: 0,
    guide: 0.1,
    stroke: 0.4,
    fill: 0.8,
    erase: 1
  },
  verticalGuideOvershoot: 28,
  verticalGuideProbability: 0.45,
  mergeOverlappingShapes: true
});