Skip to content

Commit

Permalink
OHBM talk
Browse files Browse the repository at this point in the history
  • Loading branch information
sergeyplis committed Aug 26, 2024
1 parent a44f756 commit b8e3b78
Showing 1 changed file with 33 additions and 24 deletions.
57 changes: 33 additions & 24 deletions OHBM2024.html
Original file line number Diff line number Diff line change
Expand Up @@ -756,14 +756,23 @@ <h1>Questions?</h1>
openSlideNumber: true,
openButton: false,
},
keyboard: {
32: 'next', // Space bar - next fragment
33: 'prev', // Page Up - previous fragment
34: 'next', // Page Down - next fragment
37: 'left', // Left arrow - previous slide
39: 'right', // Right arrow - next slide
},
keyboard: {
32: 'next', // Space - next fragment
33: 'prev', // Page Up - previous fragment
34: 'next', // Page Down - next fragment
37: 'left', // Left arrow - previous slide
39: 'right', // Right arrow - next slide
70: 'fullscreen', // 'f' key - fullscreen
},

// Add mouseWheel option to handle clicker events
mouseWheel: true,

// Customize mouse button behavior
navigationMode: 'default',

// Override click behavior
previewLinks: false,
// Enable the slide number display
slideNumber: true,

Expand Down Expand Up @@ -828,24 +837,24 @@ <h1>Questions?</h1>
Reveal.prev();
}
});

window.addEventListener("mousedown", handleClick, false);
window.addEventListener("contextmenu", function(e) { e.preventDefault(); }, false);

function handleClick(e) {
let zoneSize = 110;
let x = e.clientX; // get mouse X position
let y = e.clientY; // get mouse Y position
let wx = window.innerWidth; // get window width
let hy = window.innerHeight; // get window height
if (x>(wx-zoneSize) && y>(hy-zoneSize)) {
} else {
// only if not in normal controls zone
e.preventDefault();
if(e.button === 0) Reveal.next();
if(e.button === 2) Reveal.prev();
// Custom configuration for mouse buttons
Reveal.configure({
keyboard: {
// Left mouse click (keyCode 1) - next
1: 'next',
// Right mouse click (keyCode 3) - previous
3: function() {
Reveal.prev();
return false; // Prevent context menu
}
}
}
});

// Prevent context menu on right-click
document.addEventListener('contextmenu', function(e) {
e.preventDefault();
});

Reveal.configure({ fragments: true }); // set false when developing to see everything at once
Reveal.configure({ slideNumber: true });
//Reveal.configure({ history: true });
Expand Down

0 comments on commit b8e3b78

Please sign in to comment.