sercrod

*camera

*camera turns an element into an explicit image action. *camera.capture takes a new photo and *camera.pick selects an existing image. Both delegate to sercrod.camera. n-camera, n-camera.capture, and n-camera.pick are aliases.

<button type="button" *camera.capture *response="'photo'">
  Take photo
</button>

<button
  type="button"
  *camera.pick
  *response="{ preview: response.dataUrl, selectedName: response.name }">
  Pick image
</button>

The normalized result is written to $camera. Use *response for whole-result placement or field mapping. Camera does not save, upload, or persist images; combine it with explicit filesystem or upload actions when needed.

Browser capture

For *camera.capture, the browser backend first requests getUserMedia() and displays a live preview with Take photo and Cancel controls. A successful photograph has the usual normalized File and Data URL result.

If live capture is unsupported, no camera is found, or requested video constraints cannot be met, Sercrod falls back to an image input with a capture hint. Canceling the preview, denying permission, or a security failure does not open that second surface. Specify *camera.capture="{ live: false }" to use the legacy file-input path directly. HTTPS (or localhost) and camera permission are required for live capture.