Skip to content

Latest commit

 

History

History
155 lines (121 loc) · 5.95 KB

File metadata and controls

155 lines (121 loc) · 5.95 KB

Changelog

All notable changes to this project will be documented in this file.

The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.

[2.1.0] - 2026-04-24

Fixed

  • Trails now fully fade to the background instead of leaving dim residue. Replaced source-over RGB blending (which got stuck 1-2 units above bg due to 8-bit integer rounding) with destination-out alpha decay followed by destination-over gradient refill.
  • Stars now reset at the camera plane (z = 0) instead of z = -200, so projection scale no longer spikes to 3x right before the star vanishes.
  • Added a proximity brightness fade so stars dim smoothly into the reset point instead of disappearing at full brightness.
  • updateConfig now applies combined starCount + starColors / starSize updates correctly (previously the color/size branch was skipped when starCount was also passed).
  • updateConfig no longer stops and restarts the animation internally, eliminating a delta-time blip every time the optimizer retuned the star count.
  • background config is now validated at construction and via updateConfig; malformed gradients throw a clear error instead of crashing deep inside the render pipeline.

Changed

  • Version log is now printed once per page rather than once per instance.
  • FPS computation is performed once per frame and shared between the optimizer and getCurrentFPS().
  • Rolling frame-timestamp window now covers the full 3-second continuous measurement duration with headroom.
  • Normalization constant changed from deltaTime / 16.67 to deltaTime * 60 / 1000 (removes a 0.02% speed bias).

Performance

  • _render no longer allocates an offscreen canvas and copies the main canvas to it on every frame.
  • _update mutates stars in place via a new _resetStar helper, avoiding a per-reset throwaway object allocation.

2.0.3 - 2025-10-24

Documentation

  • Added comprehensive CHANGELOG.md with full version history
  • Updated README.md with v2.0.0+ gradient API format and examples
  • Added migration guide for upgrading from v1.x to v2.x
  • Added performance optimization documentation
  • Updated TypeScript definitions with @since tags for breaking changes
  • Corrected default gradient colors in all documentation

2.0.2 - 2025-10-24

Fixed

  • Fixed localStorage namespace collision by changing key from starfield-optimized-count to @byteventures/starfield:optimized-count

2.0.1 - 2025-10-24

Fixed

  • Fixed frame-rate dependent speed with delta time compensation for consistent animation speed across different refresh rates (60Hz, 120Hz, etc.)

2.0.0 - 2025-10-24

BREAKING CHANGES

Background Gradient Configuration

The background gradient configuration structure has changed from CSS-based to canvas-native API for proper interaction with the trail effect.

Old (v1.x):

background: {
  gradient: 'radial-gradient(ellipse at center, #001018 0%, #000 100%)'
}

New (v2.0.0+):

background: {
  type: 'radial',
  colors: [
    { stop: 0, color: '#001018' },
    { stop: 1, color: '#000000' }
  ]
}

Migration Instructions:

  1. If you're using the default gradient, no changes needed - just update the library
  2. If you have custom gradient configuration:
    • Change gradient: 'radial-gradient(...)' to the new object structure
    • Convert your CSS gradient string to { type, colors } format
    • Extract color stops from your CSS gradient string

Example Migration:

// Before (v1.x)
const starfield = new Starfield('#canvas', {
  background: {
    gradient: 'radial-gradient(circle, #ff0000 0%, #0000ff 100%)'
  }
});

// After (v2.0.0+)
const starfield = new Starfield('#canvas', {
  background: {
    type: 'radial',
    colors: [
      { stop: 0, color: '#ff0000' },
      { stop: 1, color: '#0000ff' }
    ]
  }
});

Changed

  • Default gradient changed from blue-tinted (#001018 to #000000) to purple-tinted (#000000 to #341b6f)
  • Background gradient now drawn directly on canvas instead of using CSS

Added

  • Automatic FPS-based performance optimization system with two-phase approach:
    • Initial aggressive calibration (1s measurements, up to 8 attempts)
    • Conservative continuous optimization (3s measurements every 10s)
  • localStorage caching of optimized star count for instant adaptation on repeat visits
  • debug configuration option to enable console logging for performance optimization (default: false)
  • maxStarCount configuration option to cap maximum stars during auto-optimization (default: 10000)
  • getCurrentFPS() method to check real-time performance

Fixed

  • Gradient now properly interacts with trail effect (previously gradient was CSS-based and didn't blend with canvas trails)

1.0.3 - 2024-10-XX

Fixed

  • Minor bug fixes and stability improvements

1.0.2 - 2024-10-XX

Fixed

  • Performance optimizations

1.0.1 - 2024-10-XX

Fixed

  • Initial release bug fixes

1.0.0 - 2024-10-XX

Added

  • Initial release
  • 3D starfield animation with HTML5 Canvas
  • Configurable star count, speed, colors, and size
  • Background gradient support
  • Trail effect (motion blur)
  • Auto-start capability
  • Device detection (mobile/desktop)
  • Framework integration examples (Astro, React, Vue, Svelte)
  • TypeScript support with full type definitions
  • ES Module distribution