chat-photo-stack

TheSAAADSalmon

A zero-dependency JavaScript and CSS component for swipeable, expandable photo stacks in chat interfaces.

JavaScriptCreated

What is TheSAAADSalmon/chat-photo-stack?

chat-photo-stack is a lightweight, framework-free UI component inspired by WeChat that groups three or more chat images into an interactive stacked card deck. Composed of a single ES module JavaScript file and one CSS stylesheet, it keeps multi-photo chat bubbles compact until a user chooses to browse or expand them.

Stacked cards tilt and fan behind the front photo, following horizontal touch swipes or mouse drags without interfering with vertical page scrolling. Tapping expand smoothly morphs each cropped thumbnail from its stacked slot into a full-aspect-ratio column aligned to the left or right chat side while gradually pushing surrounding messages down, and tapping collapse reverses the animation. It respects OS reduced-motion preferences and exposes options, imperative open/close/show methods, click callbacks, and CSS variables for radii, shadows, and spacing.

MIT-licensed, the component supports iOS Safari, Android Chrome, and major desktop browsers simply by copying two source files.

Before you startThe README says

Runs on
In the browser (iOS Safari, Android Chrome, desktop Chrome, Safari, Firefox)
Needs
Zero framework dependencies; ES module JavaScript and CSS support
How you get it
Copy chat-photo-stack.js and chat-photo-stack.css into your web project
Not yet
Fewer than three images display directly in a column without stacking
README language
Chinese

Facts from GitHub (updated Dec 1, 2026) and the project's README. License summaries are simplified: check the license file. RepoRanking reviews listings for relevance and spam, and doesn't test or vouch for code.