How musaalahmed4/chirpkit works
ChirpKit is a self-animating SVG bird exposed as a framework-agnostic Web Component and an optional React wrapper. A page imports the package entry or renders Birdie; the element creates a shadow-root mascot, then combines palette, gaze, form, and pose state into the display. Pointer tracking and form awareness are automatic by default, while attributes and React props provide overrides. The README documents these capabilities; the sampled implementation supports the relationships shown. The graph omits unsampled details of element synchronization and event timing.
Main entry points: element.ts Bird element · index.ts Web Component entry · react.tsx React wrapper · markup.ts SVG markup
Components 12
Public APIs
- Web Component entry
src/index.ts - React wrapper
src/react.tsx
Element Runtime
- Bird element
src/core/element.ts - Gaze tracking
src/core/gaze.ts - Form awareness
src/core/form-watch.ts - Palette resolver
src/core/palette.ts
Mascot Rendering
- SVG markup
src/core/markup.ts - Wing geometry
src/core/wings.ts - Shadow-root styles
src/core/styles.ts
Other components
- Page author
- Page pointer
- HTML form
Connections 13
- Page author → Web Component entry: imports to register
src/index.ts - Page author → React wrapper: renders Birdie
README.md - Web Component entry → Bird element: defines element
src/index.ts - React wrapper → Bird element: creates element
src/react.tsx - Bird element → SVG markup: inserts markup
src/core/element.ts - Bird element → Shadow-root styles: inserts styles
src/core/element.ts - Bird element → Palette resolver: resolves colors
src/core/element.ts - Bird element → Gaze tracking: starts tracking
src/core/element.ts - Bird element → Form awareness: starts watching
src/core/element.ts - Bird element → Wing geometry: updates wing paths
src/core/element.ts - SVG markup → Wing geometry: gets idle paths
src/core/markup.ts - Page pointer → Gaze tracking: moves pointer
src/core/gaze.ts - HTML form → Form awareness: observes form state
src/core/form-watch.ts