A glass ball moves over the picture and refracts what is behind it.

$npx kinetograph add glass-lens
Source

Props

Every prop has a default, so the component renders as it is. Change any of them in Studio or in code.

  • src

    string = "photos/nasa-reef-1.jpg"

    Picture in public/ (used when no children are given).

  • radius

    number = 300

    Radius of the lens in pixels.

  • path

    list

    Where the lens is: [frame, x, y] keys, x and y as fractions of the frame width and height. It eases (slow in, slow out) between keys, so a key is a rest; two close keys make a hold with a little drift.

  • ior

    number = 1.5

    Index of refraction of the glass. 1.5 is crown glass; higher bends more.

  • depth

    number = 0.55

    How thick the lens is, as a share of its radius. More depth is more magnification.

  • dispersion

    number = 0.025

    How far the colours split at the edge (0 for none).

  • rim

    number = 0.55

    Strength of the bright rim and highlight.

  • shadow

    number = 0.3

    Darkness of the lens's shadow on the picture.

  • push

    number = 0.03

    How far the picture pushes in over the shot.

Compositions

  • GlassLens