ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β β
β Point your phone at a marker. β
β Watch a photo gallery appear floating in mid-air. β
β No app. No install. Just a browser. β Tcode-Motion β‘ β
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
A universal marker-based AR photo gallery built with A-Frame and AR.js β works in any modern smartphone browser, no app install required. Point your phone camera at the Hiro marker on any screen and watch a full photo gallery materialize floating in 3D space.
π― Single file. Zero build tools. Pure web AR magic.
| π Link | π Description |
|---|---|
| tcode-motion.github.io/ar-photo | Live AR Gallery β open on your phone |
| Hiro Marker | Open this on your PC/monitor as the AR target |
Step 1 β Open the Live Demo on your PHONE
π https://tcode-motion.github.io/ar-photo/
Step 2 β Open the Hiro Marker on your PC / monitor
π https://ar-js-org.github.io/AR.js/data/images/HIRO.jpg
Step 3 β Tap "Launch Camera" on your phone
β Allow camera access when prompted
Step 4 β Point your phone camera at the Hiro Marker on your screen
Step 5 β β¨ AR Gallery appears floating on the marker!
β Use Prev / Next to browse, or switch to Gallery Mode
| β¨ Feature | π Description |
|---|---|
| πΌοΈ Single Mode | Browse photos one at a time with Prev / Next navigation |
| π Gallery Mode | All 5 photos in a beautiful fan/ring arrangement |
| β‘ Ultra Stable | 30-frame smoothing algorithm β zero hand-shake jitter |
| π Universal | Works on Android & iOS β any phone, any modern browser |
| π¦ No App Needed | 100% web-based, zero install, zero friction |
| π― Marker-Based AR | Standard Hiro marker for rock-solid tracking |
| π‘ Single File App | Entire gallery in one index.html β no build process |
| Library | Version | Purpose |
|---|---|---|
| A-Frame | 1.3 | WebXR / 3D scene framework β renders the AR world |
| AR.js | Latest | Marker-based AR tracking in the browser |
| HTML5 / JavaScript | β | App logic, gallery navigation, image management |
| GitHub Pages | β | Zero-cost live hosting |
π₯ No build tools. No backend. No npm. No app store. Open a browser β it works.
ar-photo/
βββ index.html β π Entire app β single file, no build
βββ images/
β βββ photo1.jpg β Personal photo
β βββ gallery1.png β Mountain Lake
β βββ gallery2.png β Abstract Art
β βββ gallery3.png β Cyberpunk City
β βββ gallery4.png β Architecture
βββ .nojekyll β GitHub Pages config
βββ .gitignore
βββ README.md
Customizing the gallery takes 4 simple steps:
Step 1 β Drop your image into images/:
images/your-photo.jpg
Step 2 β Register it in <a-assets> inside index.html:
<a-assets>
<!-- existing images... -->
<img id="img5" src="images/your-photo.jpg" crossorigin="anonymous">
</a-assets>Step 3 β Add it to the gallery ring:
<a-entity id="galleryRing">
<!-- existing images... -->
<a-image src="#img5" position="0 0 -1" width="0.8" height="0.6"></a-image>
</a-entity>Step 4 β Update the JavaScript arrays:
const IMAGE_IDS = ['img1', 'img2', 'img3', 'img4', 'img5'];
const IMAGE_NAMES = ['Personal', 'Mountain Lake', 'Abstract Art', 'Cyberpunk', 'Your Photo'];Done! β Refresh β your photo is now in the AR gallery.
π± Phone Camera
β
Captures live video frame
β
AR.js scans for HIRO marker pattern
β
Calculates marker position & orientation in 3D space
β
A-Frame renders 3D scene anchored to marker coordinates
β
β¨ Photos appear floating in augmented reality
The Hiro marker is a high-contrast black-and-white pattern AR.js reliably detects even in varying lighting.
# 1. Fork this repo on GitHub
# 2. Clone your fork
git clone https://github.com/YOUR-USERNAME/ar-photo.git
cd ar-photo
# 3. Add your photos to images/
# 4. Edit index.html with your IMAGE_IDS and IMAGE_NAMES
# 5. Push to GitHub
git add .
git commit -m "Add my photos to AR gallery"
git push
# 6. Enable GitHub Pages:
# Settings β Pages β Source: master branch β / (root)
# Live URL: https://YOUR-USERNAME.github.io/ar-photo/| Requirement | Details |
|---|---|
| Device | Any smartphone (Android or iOS) |
| Browser | Any modern mobile browser (Chrome, Safari, Firefox) |
| Camera | Rear camera with camera permission granted |
| AR Target | Hiro Marker on any screen or printed |
| Internet | Required to load A-Frame + AR.js from CDN |
Contributions welcome! Ideas:
- π΅ Audio / video AR support
- π¨ Custom marker support (beyond Hiro)
- π More gallery layout modes (grid, stack, spiral)
- π Dark UI overlay theme
β Star the repo if you find it useful!
MIT β free to use, fork, and modify.