Pluto UIpluto/ui
Components

Scanner Reveal

An animated card stream component with a scanner effect that reveals ASCII art as cards pass through.

// Code for scanner-reveal/basic

Installation

Loading installation instructions...

Usage

import { ScannerReveal } from "@/components/pluto-ui/scanner-reveal"
<ScannerReveal
  items={[
    { id: "1", image: "/path/to/image.jpg" },
    { id: "2", image: "/path/to/image2.jpg" },
  ]}
/>

Props

PropTypeDefaultDescription
itemsScannerRevealItem[]requiredArray of items to display in the stream
classNamestringundefinedAdditional CSS classes
speednumber120Initial scrolling speed in pixels per second
cardWidthnumber400Width of each card in pixels
cardHeightnumber250Height of each card in pixels
cardGapnumber60Gap between cards in pixels
showControlsbooleantrueShow play/pause, reset, and direction controls
showSpeedIndicatorbooleantrueShow the current speed indicator
scannerColorstring"rgba(0, 255, 255, 1)"Color of the scanner line
particleIntensitynumber0.8Intensity of particle effects (0-1)
autoPlaybooleantrueStart animation automatically
onItemScanned(item: ScannerRevealItem, index: number) => voidundefinedCallback when an item passes through the scanner

ScannerRevealItem

PropertyTypeDescription
idstringUnique identifier for the item
imagestringURL of the image to display
contentReactNodeCustom React content to display (alternative to image)
asciiContentstringCustom ASCII art content (auto-generated if not provided)

Examples

Basic Usage

// Code for scanner-reveal/basic

Custom Content

Use React nodes instead of images:

// Code for scanner-reveal/custom-content

Minimal Configuration

Minimal setup without controls:

// Code for scanner-reveal/minimal

With Callback

Track when items are scanned:

// Code for scanner-reveal/with-callback

Features

  • Interactive: Drag to scroll, mouse wheel support
  • Smooth animations: RequestAnimationFrame-based animation
  • Particle effects: Dynamic particle system that intensifies during scanning
  • ASCII art reveal: Automatically generates code-like ASCII art that reveals as cards pass through the scanner
  • Customizable: Control speed, colors, dimensions, and behavior via props
  • Responsive: Adapts to window resizing

Notes

  • The component requires a dark background for optimal visual effect
  • The scanner line is positioned at the center of the viewport
  • Cards automatically wrap when reaching the edges
  • The particle system dynamically adjusts intensity when cards are being scanned

Credits

This component was inspired by the Scanner Reveal animation by @blacklead-studio on CodePen.