MediaWiki:Common.js: Difference between revisions

From Haven Homes
mNo edit summary
mNo edit summary
Line 8: Line 8:
   var vrView = new VRView.Player('#vrview', {
   var vrView = new VRView.Player('#vrview', {
     image: 'https://i.ibb.co/Qb5N8b6/IMG-20230801-165141-00-merged.jpg',
     image: 'https://i.ibb.co/Qb5N8b6/IMG-20230801-165141-00-merged.jpg',
     is_stereo: false
     is_stereo: false,
    width: 400,
    height: 300
   });
   });
}
}

Revision as of 14:10, 6 November 2023

/* Any JavaScript here will be loaded for all users on every page load. */


window.addEventListener('load', onVrViewLoad);

function onVrViewLoad() {
  // Selector '#vrview' finds element with id 'vrview'.
  var vrView = new VRView.Player('#vrview', {
    image: 'https://i.ibb.co/Qb5N8b6/IMG-20230801-165141-00-merged.jpg',
    is_stereo: false,
    width: 400,
    height: 300
  });
}


/*
var panoContainer = document.getElementById('panorama');
var panoImage = document.getElementById('panoImage');

// Duplicate the panoImage to allow for continuous scrolling.
// The actual implementation might need adjustment depending on your HTML and CSS.
panoImage.innerHTML += panoImage.innerHTML;

var isPanning = false;
var startX = 0;
var scrollLeft = 0;

panoContainer.addEventListener('mousedown', function(e) {
  isPanning = true;
  startX = e.pageX - panoContainer.offsetLeft;
  scrollLeft = panoContainer.scrollLeft;
  panoContainer.style.cursor = 'grabbing';
});

panoContainer.addEventListener('mouseleave', function() {
  isPanning = false;
  panoContainer.style.cursor = 'grab';
});

panoContainer.addEventListener('mouseup', function() {
  isPanning = false;
  panoContainer.style.cursor = 'grab';
});

panoContainer.addEventListener('mousemove', function(e) {
  if (!isPanning) return;
  e.preventDefault();
  var x = e.pageX - panoContainer.offsetLeft;
  var walk = (x - startX) * 2; // Increase the scroll speed
  var newScrollLeft = scrollLeft - walk;

  // Adjust the scroll position when reaching the end/start of the content
  if (newScrollLeft <= 0) {
    newScrollLeft += panoImage.offsetWidth / 2;
  } else if (newScrollLeft >= panoImage.offsetWidth / 2) {
    newScrollLeft -= panoImage.offsetWidth / 2;
  }

  panoContainer.scrollLeft = newScrollLeft;
});

*/
This site is in the process of being built; content may not be accurate or complete. Please contact us if you see an error.
No AI or LLM tools were used to generate any text or images on this site. If they had been, the site would be complete and look better.