-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcontent_controls.js
48 lines (44 loc) · 1.58 KB
/
content_controls.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
// Create and inject video player controls
function createControlsOverlay() {
const controlsHTML = `
<div id="video-enhancer-controls" class="video-enhancer-controls">
<button data-action="speed-down">🐌</button>
<button data-action="speed-up">🏃</button>
<button data-action="volume-down">🔉</button>
<button data-action="volume-up">🔊</button>
<button data-action="bass-toggle">🎵</button>
<button data-action="voice-toggle">🗣️</button>
</div>
`;
// Create style element
const style = document.createElement('style');
style.textContent = `
.video-enhancer-controls {
position: fixed;
bottom: 20px;
right: 20px;
background: rgba(0, 0, 0, 0.8);
padding: 10px;
border-radius: 5px;
z-index: 9999;
}
.video-enhancer-controls button {
margin: 0 5px;
padding: 5px 10px;
border: none;
background: rgba(255, 255, 255, 0.2);
color: white;
border-radius: 3px;
cursor: pointer;
}
.video-enhancer-controls button:hover {
background: rgba(255, 255, 255, 0.3);
}
`;
document.head.appendChild(style);
// Create and append controls
const controls = document.createElement('div');
controls.innerHTML = controlsHTML;
document.body.appendChild(controls.firstElementChild);
return document.getElementById('video-enhancer-controls');
}