-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscript.js
More file actions
87 lines (77 loc) · 3.11 KB
/
script.js
File metadata and controls
87 lines (77 loc) · 3.11 KB
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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
function addStream() {
const username = document.getElementById('kickUsername').value;
if (username) {
const streamsContainer = document.getElementById('streamsContainer');
const streamDiv = document.createElement('div');
streamDiv.classList.add('stream');
streamDiv.innerHTML = `
<iframe src="https://player.kick.com/${username}" frameborder="0" scrolling="no" allowfullscreen="true"></iframe>
<button class="remove-button" onclick="removeStream(this, '${username}')">Remove</button>
`;
streamsContainer.appendChild(streamDiv);
document.getElementById('kickUsername').value = '';
//showNotification(`${username} added successfully!`, 'success');
} else {
// showNotification('Please enter a Kick username', 'error');
}
}
function removeStream(button) {
const streamDiv = button.parentElement;
streamDiv.remove();
}
function handleKeyPress(event) {
if (event.key === 'Enter') {
addStream();
}
}
function showNotification(message, type) {
const notification = document.getElementById('notification');
notification.textContent = message;
notification.className = 'notification ' + type;
notification.style.display = 'block';
notification.style.opacity = '1';
setTimeout(() => {
notification.style.opacity = '0';
setTimeout(() => {
notification.style.display = 'none';
}, 500);
}, 3000);
}
function toggleMode() {
const body = document.body;
body.classList.toggle('light-mode');
const settingsPanel = document.getElementById('settingsPanel');
settingsPanel.classList.toggle('light-mode');
const modeText = document.getElementById('modeText');
modeText.textContent = body.classList.contains('light-mode') ? 'Light Mode' : 'Dark Mode';
}
function updateStreamSize() {
const size = document.getElementById('streamSize').value;
const streamsContainer = document.getElementById('streamsContainer');
streamsContainer.style.gridTemplateColumns = `repeat(auto-fit, minmax(${size}, 1fr))`;
}
function removeStream(button, username) {
const streamDiv = button.parentElement;
streamDiv.remove();
showNotification(`${username} removed successfully!`, 'error');
}
function updateStreamQuality() {
const quality = document.getElementById('streamQuality').value;
// Update stream quality logic here
console.log(`Stream quality set to ${quality}`);
}
function updateThemeColor() {
const color = document.getElementById('themeColor').value;
document.documentElement.style.setProperty('--theme-color', color);
}
function updateAutoPlay() {
const autoPlay = document.getElementById('autoPlay').checked;
// Update auto play logic here
console.log(`Auto Play set to ${autoPlay}`);
}
function toggleSettings() {
const settingsPanel = document.getElementById('settingsPanel');
const mainContent = document.querySelector('.main-content');
settingsPanel.classList.toggle('closed');
mainContent.classList.toggle('closed');
}