TuffLogoStroke
Animated SVG stroke treatment for the Tuff logo with once, breathe, hover, and loop modes.
Usage
Best Practices
- Use
oncefor splash, loading-complete, or first-view brand moments. - Use
hoverwhen the logo sits near an interactive affordance and should not animate continuously. - Use
breathe/loopsparingly; repeating brand motion can compete with primary UI feedback. - Keep custom colors close to the surrounding surface palette. High-saturation gradients work best on calm backgrounds.
- Do not wrap the SVG in another animation unless you have checked reduced-motion behavior for the combined effect.
API Reference
Props
| Prop | Type | Default | Description |
|---|---|---|---|
size | string | number | 120 | SVG width and height. Numeric values are normalized to px. |
mode | 'once' | 'breathe' | 'hover' | 'loop' | 'once' | Animation trigger mode. loop is normalized to breathe. |
durationMs | number | 2200 | Base animation duration in milliseconds. |
strokeColor | string | '#4C4CFF' | Outline stroke color. |
fillStartColor | string | '#199FFE' | Start color of the core fill gradient. |
fillEndColor | string | '#810DC6' | End color of the core fill gradient. |
outerStartColor | string | '#D73E4D' | Start color of the outer radial gradient. |
outerEndColor | string | '#7F007F' | End color of the outer radial gradient. |
Slots
No slots.
Events
No component events.
Animation Modes
once plays the draw-in sequence on mount. breathe and loop keep a subtle pulse after the draw-in sequence. hover waits until the user hovers the SVG.
Loading demo...
Palette and Duration
Customize the stroke, core gradient, outer glow, and animation duration when the logo appears on a themed surface.
Loading demo...
Overview
- The component renders one SVG with
role="img"and the accessible nameTuff logo stroke animation. mode="loop"is an alias formode="breathe"; both produce the breathe state class.- Gradient and filter ids are instance-scoped through
useId(), so multiple logos can render on the same page without SVG id collisions. durationMsis written to--tx-tuff-logo-duration; breathe mode derives its pulse duration from that value.- The component includes
prefers-reduced-motion: reduceCSS that disables animations and shows the final drawn state.
Technologies
- Motion note:
breatheandloopare visually identical after normalization. Uselooponly when matching older call sites; preferbreathein new examples because it names the actual class state. - SVG note: Gradient and filter ids are generated per instance with
useId(). This prevents collisions in repeated logos but means snapshots should assert existence/uniqueness, not exact id strings. - Verified coverage:
tuff-logo-stroke.test.tschecks accessible SVG semantics, numeric and string sizes, CSS duration variable,looptobreathemapping, palette forwarding, instance-scoped SVG ids, and install registration. - Component source:
packages/tuffex/packages/components/src/tuff-logo-stroke/src/TxTuffLogoStroke.vue. - Types:
packages/tuffex/packages/components/src/tuff-logo-stroke/src/types.tsexportsTuffLogoStrokeProps. - Export alias:
packages/tuffex/packages/components/src/tuff-logo-stroke/index.tsexportsTuffLogoStroke,TxTuffLogoStroke,TuffLogoStrokeProps, andTxTuffLogoStrokeInstance. - Coverage:
packages/tuffex/packages/components/src/tuff-logo-stroke/__tests__/tuff-logo-stroke.test.tsverifies modes, dimensions, palette props, SVG ids, accessibility, and install behavior.
查看源码
packages/tuffex/packages/components/src/tuff-logo-stroke/index.ts