sirx: und weg damit :D

This commit is contained in:
Flummi
2021-05-25 14:44:35 +02:00
parent 83fbc557e8
commit f3e357d8a4
17 changed files with 577 additions and 54 deletions

View File

@ -2,7 +2,7 @@
if(elem = document.querySelector("#my-video")) {
const video = new v0ck(elem);
document.addEventListener("keydown", e => {
if(e.key === " ") {
if(e.key === " " && e.target.tagName !== "INPUT") {
video[video.paused ? 'play' : 'pause']();
document.querySelector('.v0ck_overlay').classList[video.paused ? 'remove' : 'add']('v0ck_hidden');
}
@ -26,7 +26,7 @@
"r": clickOnElementBinding("#random")
};
document.addEventListener("keydown", e => {
if(e.key in keybindings) {
if(e.key in keybindings && e.target.tagName !== "INPUT") {
e.preventDefault();
keybindings[e.key]();
}
@ -144,19 +144,6 @@
analyser.getByteFrequencyData(data);
draw(data);
}
/*function draw(data) {
data = [ ...data ];
ctx.clearRect(0, 0, canvas.width, canvas.height);
const space = canvas.width / data.length;
const sstyle = getComputedStyle(document.body).getPropertyValue("--accent");
data.forEach((value, i) => {
ctx.beginPath();
ctx.moveTo(space * i, canvas.height);
ctx.lineTo(space * i, canvas.height - value);
ctx.strokeStyle = sstyle;
ctx.stroke();
});
}*/
function draw(data) {
data = [ ...data ];
ctx.clearRect(0, 0, canvas.width, canvas.height);