This project is a browser-based 360° virtual tour, a Braintree web application. It allows users to explore panoramic scenes, navigate between different rooms or areas, and interact with hotspots for information or navigation. The app is built using Marzipano, a 360° media viewer library, and is fully client-side, requiring no backend server.
- Live Demo: https://braintree-virtual-tour.netlify.app/
- Project Summary
- Features
- Project Structure
- Technologies Used
- How It Works
- How to Run
- Component & API Walkthrough
- Reusing Components
- Example Usage
- Keywords
- Conclusion
- Interactive 360° panoramic viewer
- Scene navigation via clickable hotspots
- Info hotspots for contextual information
- Responsive design for desktop and mobile
- Fullscreen and autorotate support
- Scene list for quick navigation
- Keyboard and button controls for view movement and zoom
360-virtual-tour/
├── data.js # Scene and hotspot configuration (JSON)
├── index.html # Main HTML file
├── index.js # Main JavaScript logic
├── style.css # Custom styles
├── vendor/ # Third-party libraries (Marzipano, Bowser, etc.)
├── img/ # UI icons and images
└── tiles/ # Panoramic image tiles for each scene
- HTML5/CSS3/JavaScript: Core web technologies
- Marzipano: 360° panorama viewer
- Bowser: Browser detection
- Screenfull: Fullscreen API wrapper
- Eric Meyer's Reset CSS: CSS reset for cross-browser consistency
- The app loads scene and hotspot data from
data.js
. index.html
provides the UI structure, including the panorama container, scene list, and controls.index.js
initializes Marzipano, loads scenes, sets up navigation and info hotspots, and manages UI interactions (fullscreen, autorotate, etc).- Panoramic images are stored in the
tiles/
directory, organized by scene and resolution level. - The UI is styled via
style.css
and uses icons from theimg/
folder.
-
Clone or download the repository.
-
Start a local HTTP server in the project directory:
-
With Python 3:
python3 -m http.server 8000
-
With Python 2:
python -m SimpleHTTPServer 8000
-
-
Open your browser and go to: http://localhost:8000
- Contains a global
APP_DATA
object with all scene definitions, levels, initial view parameters, and hotspot data. - Each scene has:
id
,name
,levels
(tile resolutions),faceSize
,initialViewParameters
,linkHotspots
,infoHotspots
.
- Loads all scripts and styles.
- Contains UI elements: panorama container (
#pano
), scene list, title bar, control buttons.
- Initializes Marzipano viewer and loads scenes from
APP_DATA
. - Sets up navigation and info hotspots.
- Handles UI events: scene switching, autorotate, fullscreen, view controls.
- Responsive: switches between desktop and mobile layouts.
- Styles for layout, controls, scene list, hotspots, and responsive design.
marzipano.js
: 360° viewer librarybowser.min.js
: Browser detectionscreenfull.min.js
: Fullscreen APIreset.min.css
: CSS reset
- Contains subfolders for each scene (e.g.,
0-entrance/
), each with preview and tiled images for multiple resolutions and cube faces.
- UI icons for controls and hotspots (e.g., play, pause, fullscreen, info, arrows).
- Marzipano Integration: You can reuse the Marzipano setup (
index.js
) in other projects by providing your owndata.js
and image tiles. - Hotspot Logic: The functions for creating link and info hotspots are modular and can be adapted for other interactive 360° viewers.
- UI Controls: The control logic (autorotate, fullscreen, view movement) is generic and can be ported to similar projects.
To add a new scene:
- Add a new folder in
tiles/
with the required image tiles and apreview.jpg
. - Add a new scene object in
data.js
with the correctid
,name
, and parameters. - Add a new entry in the scene list in
index.html
.
To add a hotspot:
- Add a
linkHotspot
orinfoHotspot
entry in the relevant scene indata.js
.
360°, panorama, virtual tour, Marzipano, JavaScript, web app, interactive, hotspot, fullscreen, responsive, scene navigation, info hotspot, open source
This project is a robust template for building interactive 360° virtual tours on the web. It is easy to extend with new scenes, hotspots, and UI customizations. Perfect for real estate, education, museums, or any scenario requiring immersive navigation.
Happy coding! ✨
Thank you!