-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathjoey.html
90 lines (85 loc) · 2.48 KB
/
joey.html
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
88
89
<!DOCTYPE html>
<html>
<head>
<style>
body, html {
margin: 0;
padding: 0;
height: 100%;
overflow: hidden;
}
.container {
display: flex;
height: 100%;
}
#video-container {
flex: 8;
overflow: hidden;
}
#chat-container {
flex: 2;
overflow: hidden;
}
#resize-button {
position: absolute;
top: 15px;
right: 10px;
cursor: pointer;
}
#resize-button img {
width: 35px;
height: 35px;
}
#chat-size-input-container {
position: absolute;
top: 20px;
right: 50px;
display: none;
}
#chat-size-input {
width: 70px;
height: 25px;
}
</style>
</head>
<body>
<div class="container">
<div id="video-container">
<iframe src="https://player.kick.com/atmos" frameborder="0" allowfullscreen="true" scrolling="no" height="100%" width="100%"></iframe>
</div>
<div id="chat-container">
<iframe frameborder="0" scrolling="yes" id="chat_embed" src="https://www.twitch.tv/embed/a_t_m_0_s/chat?darkpopout&enableExtensions=true&parent=atmos.lol" height="100%" width="100%"></iframe>
</div>
<div id="resize-button">
<img src="./images/chat.png" alt="Chat Icon">
</div>
<div id="chat-size-input-container">
<input type="number" id="chat-size-input" placeholder="Chat Size (%)" min="0" max="100">
</div>
</div>
<script>
const container = document.querySelector('.container');
const chatContainer = document.querySelector('#chat-container');
const resizeButton = document.querySelector('#resize-button');
const chatSizeInputContainer = document.querySelector('#chat-size-input-container');
const chatSizeInput = document.querySelector('#chat-size-input');
resizeButton.addEventListener('click', () => {
chatSizeInputContainer.style.display = 'block';
chatSizeInput.focus();
});
chatSizeInput.addEventListener('blur', () => {
chatSizeInputContainer.style.display = 'none';
});
chatSizeInput.addEventListener('input', () => {
const chatSize = parseInt(chatSizeInput.value);
if (!isNaN(chatSize)) {
const containerWidth = container.offsetWidth;
const chatWidth = (chatSize / 100) * containerWidth;
chatContainer.style.flexBasis = chatWidth + 'px';
} else {
chatContainer.style.flexBasis = ''; // Reset the resize behavior
}
});
</script>
</body>
</html>