MediaWiki:Common.js

From Haven Homes
Revision as of 13:07, 6 November 2023 by Chris (talk | contribs)

Note: After publishing, you may have to bypass your browser's cache to see the changes.

  • Firefox / Safari: Hold Shift while clicking Reload, or press either Ctrl-F5 or Ctrl-R (⌘-R on a Mac)
  • Google Chrome: Press Ctrl-Shift-R (⌘-Shift-R on a Mac)
  • Internet Explorer / Edge: Hold Ctrl while clicking Refresh, or press Ctrl-F5
  • Opera: Press Ctrl-F5.
/* 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', {
    video: 'https://i.ibb.co/Qb5N8b6/IMG-20230801-165141-00-merged.jpg',
    is_stereo: true
  });
}


/*
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.