AlexJSully-Portfolio

Constants Module

The constants module centralizes timing, thresholds, and configuration values used throughout the application. These values control interactive behaviors, network detection, and animations.

Why Centralize Constants?

Using a single source of truth for magic numbers provides:

Module Exports

The module exports four const objects, each grouping related values:

DELAYS

Debounce delays and timing values in milliseconds:

Usage: Import to control debouncing and timing in components.

THRESHOLDS

Trigger thresholds for interactive features:

Usage: Import to control when interactions trigger animations or Easter eggs.

NETWORK

Network performance thresholds for adaptive loading:

Usage: Import in isNetworkFast() to determine whether to autoplay videos.

ANIMATIONS

Multi-stage animation durations in milliseconds:

Usage: Import to sequence the avatar sneeze animation in Avatar component.

Implementation: src/constants/index.ts