@supuwoerc/masonry
    Preparing search index...

    Class BreathingPlaceholderRenderer

    呼吸渐变占位符渲染器 Breathing gradient placeholder renderer

    在图片加载过程中显示带有呼吸渐变动画的占位图。 整体明暗随正弦曲线周期性变化,模拟呼吸节奏。

    Displays a placeholder with breathing gradient animation during image loading. The overall brightness oscillates following a sine curve, simulating a breathing rhythm.

    const breathing = new BreathingPlaceholderRenderer({
    backgroundColor: '#e0e0e0',
    highlightColor: 'rgba(255, 255, 255, 0.6)',
    duration: 1500,
    radius: 8,
    })

    Implements

    Index

    Constructors

    Methods

    Constructors

    Methods

    • 渲染一帧呼吸动画并返回位图 Render one frame of breathing animation and return bitmap

      Parameters

      • width: number

        占位符宽度(CSS 像素)| Placeholder width (CSS pixels)

      • height: number

        占位符高度(CSS 像素)| Placeholder height (CSS pixels)

      • id: string

        唯一标识(用于缓存动画状态)| Unique ID (for caching animation state)

      Returns Promise<ImageBitmap>

      当前帧的 ImageBitmap | Current frame ImageBitmap