Passaggio 6: incorporare il tour in un sito Web

by Space Tour

In questa fase tratteremo le tre domande più comuni e importanti che sorgono dopo la pubblicazione di un tour.


1. Come incorporare rapidamente un tour virtuale su qualsiasi sito web

Il metodo più semplice e universale è  incorporamento di iframe .

Funziona con quasi tutti i siti Web e non richiede competenze di programmazione.

Esamineremo esempi che utilizzano le piattaforme CMS più diffuse:  WordPress, Tilda e Bitrix .

Esempio: WordPress (Gutenberg/Elementor)

  1. Copia il codice iframe del tuo tour dalla pagina di pubblicazione di Space Tour.
  2. Sul tuo sito web, aggiungi un blocco HTML:
    • in  Gutenberg  — utilizza il blocco  HTML personalizzato  ;
    • in  Elementor  : utilizza il widget  HTML  .
  3. Incolla interamente il codice copiato nel blocco HTML.
  4. Salvare la pagina.

Fatto: il tour è incorporato e funziona.

Lo stesso approccio si applica a  Tilda, Bitrix e qualsiasi altro CMS che supporti l’inserimento di codice HTML.


2. Come organizzare un tour sul tuo sito web senza abbonamento

Questa opzione è adatta se desideri un tour completamente autonomo che funzioni  senza un abbonamento attivo .

⚠️  Importante

Questo metodo è  non adatto a Tilda e costruttori di siti Web simili  che non forniscono accesso a un file system.

Passaggi:

  1. Scarica l’archivio ZIP del tour sul tuo dispositivo.⚠️ Nota: il tour non si aprirà localmente sul tuo computer. Per la visualizzazione locale è necessario un ambiente server (localhost). Se non hai esperienza con i server locali, non ti consigliamo di configurarlo separatamente, poiché va oltre l’ambito del generatore di tour.
  2. Carica l’archivio sul tuo hosting/server:
    • tramite un file manager come  ISPmanager  o  cPanel ;
    • o collegandosi tramite  FTP .
  3. Non caricare il tour nella directory principale  se il tuo hosting ha già un sito web attivo. In caso contrario, il tour sovrascriverà i file di sistema e danneggerà il sito. Approccio consigliato:
    • crea una cartella, ad esempio:miosito.com/tour
    • carica l’archivio in questa cartella;
    • estrarre l’archivio.

Successivamente il tour sarà disponibile all’indirizzo corrispondente, ad esempio: https://mysite.com/tour


3. Incorporamento di un tour tramite iframe (Opzione avanzata)

Se ospiti il tour sul tuo server o hai bisogno di un incorporamento personalizzato, puoi utilizzare un codice iframe standard sostituendo il collegamento con il tuo.

Esempio di iframe di base:

<iframe src="YOUR_LINK" width="100%" height="600" frameborder="0" allowfullscreen></iframe>

Sostituisci YOUR_LINK con il link del tuo tour.

Parametri:

  • width="100%": larghezza del blocco.
  • height="600": altezza del blocco, modificabile in base al design del sito.

Incorporamento con immagine di anteprima e pulsante di riproduzione

Per una migliore esperienza utente, puoi utilizzare questo esempio completo:

  • La pagina scorre normalmente finché il tour non viene avviato.
  • Prima dell’avvio, l’iframe non intercetta clic o gesti di scorrimento.
  • Il tour diventa interattivo quando si preme il pulsante di riproduzione.

Il codice funziona sia con tour ospitati su Space Tour sia con tour ospitati sul tuo server. Sostituisci il primo valore src con il link del tour e il src dell’immagine con l’URL dell’anteprima. Non tradurre i nomi di proprietà, funzioni o classi nel codice.

<!--
Space Tour: user-friendly tour embedding with a poster and Play button.

Why this is useful:
1) While the tour is not launched, the iframe does NOT capture scroll/swipe events
   (pointer-events: none), so the page scrolls smoothly.
2) When the user clicks Play, the poster disappears and the tour becomes interactive
   (pointer-events: auto).
-->

<div class="space-pano">
  <!--
  1) UPDATE THE TOUR LINK HERE
     Replace the src value with your tour link (Space Tour hosting or your own hosting).
  -->
  <iframe
    src="https://app.space-tour.com/pano-demo/hong-kong-aero-13"
    width="100%"
    height="600"
    frameborder="0"
    allowfullscreen>
  </iframe>

  <div class="space-pano__overlay">
    <!--
    2) UPDATE THE POSTER IMAGE HERE
       This is the preview image shown before the tour starts.
       You can use any image URL (jpg/png/webp).
       If you leave src empty, the poster will not be displayed.
    -->
    <img
      class="space-pano__overlay-img"
      src="https://space-tour.com/vt-tour.jpg"
      alt="Virtual Tour Preview"
    >

    <!-- Tour start button -->
    <button class="space-pano__play" type="button" aria-label="Start virtual tour">
      <!-- Play icon (no need to change) -->
      <svg class="icon-play" width="120" height="120" viewBox="0 0 120 120" fill="none" xmlns="http://www.w3.org/2000/svg">
        <g opacity="0.75">
          <path d="M105 60C105 65.9095 103.836 71.7611 101.575 77.2208C99.3131 82.6804 95.9984 87.6412 91.8198 91.8198C87.6412 95.9984 82.6804 99.3131 77.2208 101.575C71.7611 103.836 65.9095 105 60 105C54.0905 105 48.2389 103.836 42.7792 101.575C37.3196 99.3131 32.3588 95.9984 28.1802 91.8198C24.0016 87.6412 20.6869 82.6804 18.4254 77.2208C16.164 71.7611 15 65.9095 15 60C15 48.0653 19.7411 36.6193 28.1802 28.1802C36.6193 19.7411 48.0653 15 60 15C71.9347 15 83.3807 19.7411 91.8198 28.1802C100.259 36.6193 105 48.0653 105 60Z" stroke="#FAFAFA" stroke-width="4" stroke-linecap="round" stroke-linejoin="round"/>
          <path d="M79.55 58.36C79.8428 58.5223 80.0868 58.7599 80.2566 59.0483C80.4265 59.3367 80.5161 59.6653 80.5161 60C80.5161 60.3347 80.4265 60.6633 80.2566 60.9517C80.0868 61.2401 79.8428 61.4778 79.55 61.64L51.535 77.205C51.2495 77.3635 50.9276 77.4446 50.6011 77.4405C50.2747 77.4363 49.9549 77.347 49.6736 77.1813C49.3922 77.0156 49.159 76.7794 48.997 76.4959C48.835 76.2124 48.7499 75.8915 48.75 75.565V44.435C48.75 43.005 50.285 42.105 51.535 42.8L79.55 58.36Z" stroke="#FAFAFA" stroke-width="4" stroke-linecap="round" stroke-linejoin="round"/>
        </g>
      </svg>
    </button>
  </div>
</div>

<style>
  /* Wrapper: defines the area where the tour will be displayed */
  .space-pano {
    position: relative;
    width: 100%;
    height: 600px; /* You can change the height, e.g. 500px or 80vh */
    overflow: hidden;
  }

  /* Make the iframe fill the entire wrapper */
  .space-pano iframe {
    width: 100%;
    height: 100%;
    border: 0;

    /* Key point:
       While the tour is not launched, the iframe does NOT capture clicks/scroll
       so the page scrolls normally */
    pointer-events: none;
  }

  /* Overlay (poster + Play button) */
  .space-pano__overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    transition: opacity 0.25s ease, visibility 0.25s ease;
  }

  /* Poster image */
  .space-pano__overlay-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
  }

  /* Play button on top of the poster */
  .space-pano__play {
    position: relative;
    z-index: 2;
    background: transparent;
    border: none;
    padding: 0;
    cursor: pointer;
  }

  /* Hide overlay after launch */
  .space-pano__overlay.is-hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
  }
</style>

<script>
  // Start the tour when the user clicks the Play button:
  // 1) make the iframe clickable (enable pointer-events)
  // 2) remove the poster overlay
  document.addEventListener('click', function (event) {
    const btn = event.target.closest('.space-pano__play');
    if (!btn) return;

    const wrapper = btn.closest('.space-pano');
    if (!wrapper) return;

    const iframe = wrapper.querySelector('iframe');
    const overlay = wrapper.querySelector('.space-pano__overlay');

    if (iframe) iframe.style.pointerEvents = 'auto';

    if (overlay) {
      overlay.classList.add('is-hidden');
      setTimeout(function () {
        overlay.remove();
      }, 300);
    }
  });

  // If the poster is missing or fails to load, remove the image so it doesn't block the UI
  document.addEventListener('DOMContentLoaded', function () {
    document.querySelectorAll('.space-pano__overlay-img').forEach(function (img) {
      const src = img.getAttribute('src');

      if (!src) {
        img.remove();
        return;
      }

      img.addEventListener('error', function () {
        img.remove();
      });
    });
  });
</script>

Riepilogo

Ora sai come:

  • Incorporare un tour in qualsiasi sito web in pochi minuti.
  • Ospitare un tour esportato sul tuo server senza un abbonamento attivo.
  • Utilizzare iframe in versione base oppure con immagine di anteprima e pulsante di riproduzione.

La guida è completa. Ora conosci l’intero processo, dal caricamento dei panorami alla pubblicazione e all’utilizzo del tour virtuale.

Precedente: passaggio 5