Commit 4ad0a0e7 authored by Matt Mascarenhas's avatar Matt Mascarenhas

hmml_to_html.c: Generate keyboard navigation [#24]

With thanks to @insofaras for the onblur functionality
parent 00f6dbed
This diff is collapsed.
......@@ -49,6 +49,7 @@ function Player(htmlContainer, refsCallback) {
this.nextFrame = null;
this.looping = false;
this.markersContainer.addEventListener("wheel", function(ev) {
this.scrollTo = -1;
}.bind(this));
......@@ -302,6 +303,7 @@ Player.prototype.onYoutubeReady = function() {
videoId: this.videoContainer.getAttribute("data-videoId"),
width: this.videoContainer.offsetWidth,
height: this.videoContainer.offsetWidth / 16 * 9,
//playerVars: { disablekb: 1 },
events: {
"onReady": this.onYoutubePlayerReady.bind(this),
"onStateChange": this.onYoutubePlayerStateChange.bind(this),
......@@ -735,7 +737,7 @@ function handleKey(key) {
case "?": {
helpDocumentation.classList.toggle("visible");
}
} break;
case 'N':
case 'D':
......@@ -1078,8 +1080,8 @@ function mouseSkipToTimecode(player, time, ev)
function handleMouseOverMenu(menu, eventType)
{
if(!menu.classList.contains("visible" && eventType == "mouseenter") ||
menu.classList.contains("visible" && eventType == "mouseleave"))
if(!(menu.classList.contains("visible")) && eventType == "mouseenter" ||
menu.classList.contains("visible") && eventType == "mouseleave")
{
if(menu.classList.contains("quotes"))
{
......@@ -1097,9 +1099,9 @@ function handleMouseOverMenu(menu, eventType)
{
toggleMenuVisibility(creditsMenu);
}
else if(menu.classList.contains("help"))
{
helpDocumentation.classList.toggle("visible");
}
}
if(eventType == "click" && menu.classList.contains("help"))
{
helpDocumentation.classList.toggle("visible");
}
}
......@@ -15,7 +15,13 @@
}
.title .episode_name {
flex: 1 1;
flex: 1;
}
.title > #focus-warn {
color: #F00;
flex: 1;
margin: auto;
}
.title > .menu {
......@@ -53,17 +59,24 @@
margin: 2px;
}
.help_key.unavailable,
.help_text.unavailable,
.help_container h2 .unavailable {
opacity: 0.32;
}
.key_block {
display: inline-flex;
align-items: flex-end;
flex-direction: row;
margin-right: 4px;
margin: 8px;
}
.help_text {
margin: 0 8px 0 2px;
}
.help_container h1 {
display: inline;
margin-left: 4px;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment