-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathStreams.html
More file actions
170 lines (150 loc) · 5.53 KB
/
Streams.html
File metadata and controls
170 lines (150 loc) · 5.53 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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
<!DOCTYPE html>
<html>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<head>
<link href='https://fonts.googleapis.com/css?family=Oswald' rel='stylesheet'>
<title>HDReport</title>
<link rel="icon" type="image/x-icon" href="https://github.com/pkzstar/HDReport/blob/main/images/logo-main.png?raw=true">
<link rel="stylesheet" href="style.css">
<style>
.pastList {
list-style: none;
padding: 0;
display: flex;
flex-wrap: wrap;
justify-content: space-between;
}
.past-events {
height: calc(25% - 50px);
width: calc(25% - 50px);
margin: 0 20px 20px 20px;
}
.past-events img {
width: 100%;
height: 100%;
}
.past-events div {
display: flex;
flex-direction: column;
align-items: center;
text-align: center;
}
.past-article-text {
margin: 5px;
}
@media only screen and (max-width: 600px) {
.pastList {
list-style: none;
padding: 0;
display: flex;
flex-wrap: wrap;
}
p {
margin: 2px 0 2px 0;
}
.past-events {
margin: 20px 20px 20px 20px;
}
.past-events img {
width: 75%;
height: 75%;
}
.past-events div {
display: flex;
flex-direction: column;
align-items: center;
text-align: center;
}
.past-article-text {
margin: 5px;
}
}
</style>
</head>
<body>
<div class="wallpaper"></div>
<div class="wallpaper2"></div>
<div id="react-nav"></div>
<div class="upcoming-image-parent">
<h1 id="pageHeader" class="textGradient">STREAMS</h1>
</div>
<hr>
<div id="react-container"></div>
<div id="streamsDesktop" class="hidden"></div>
<div id="streamsMobile"></div>
<script>
// Function to conditionally load scripts based on width
function loadScripts() {
const streamsDesktop = document.getElementById('streamsDesktop');
// Check if the window width is less than or equal to 700px
if (window.innerWidth >= 700) {
// Add the "hidden" class to the streamsDesktop div
streamsDesktop.classList.remove('hidden');
}}
// Function to create stream elements
function createStreamElement(name, url, channelId) {
const streamName = document.createElement('p');
streamName.classList.add('streamNames');
const link = document.createElement('a');
link.setAttribute('target', '_blank');
link.setAttribute('href', url);
link.textContent = name;
streamName.appendChild(link);
const streamId = document.createElement('p');
streamId.classList.add('streamNames');
streamId.id = channelId;
const videoContainer = document.createElement('div');
videoContainer.classList.add('video-con');
const iframe = document.createElement('iframe');
iframe.setAttribute('src', `https://player.twitch.tv/?channel=${channelId}&parent=hdr.report`);
iframe.setAttribute('frameborder', '1');
iframe.setAttribute('allowfullscreen', 'true');
iframe.setAttribute('scrolling', 'no');
iframe.setAttribute('height', '378');
iframe.setAttribute('width', '620');
videoContainer.appendChild(iframe);
return [streamName, streamId, videoContainer];
}
// Check if the page width is less than or equal to 700 pixels
if (window.innerWidth <= 700) {
// Get the mobileLinks container
const mobileLinksContainer = document.getElementById('streamsMobile');
// Add streams
const streamsData = [
{ name: 'yachtclubhq', url: 'https://www.twitch.tv/yachtclubhq', channelId: 'ycStream' },
{ name: 'waypoint lounge', url: 'https://www.twitch.tv/waypoint_lounge', channelId: 'wplStream' },
{ name: 'recupid', url: 'https://www.twitch.tv/recupid', channelId: 'rcStream' },
{ name: 'uwbothellsmashclub', url: 'https://www.twitch.tv/uwbothellsmashclub', channelId: 'uwcStream' },
{ name: 'dfw esports', url: 'https://www.twitch.tv/dfw_esportsgg', channelId: 'dfwStream' },
{ name: 'kumatoraam', url: 'https://www.twitch.tv/kumatoraam', channelId: 'kumaStream' },
{ name: 'onhdr', url: 'https://www.twitch.tv/ONHDR', channelId: 'onStream' }
];
streamsData.forEach(stream => {
const [streamName, streamId, videoContainer] = createStreamElement(stream.name, stream.url, stream.channelId);
mobileLinksContainer.appendChild(streamName);
mobileLinksContainer.appendChild(streamId);
mobileLinksContainer.appendChild(videoContainer);
});
// Show/hide mobileLinks container based on window width
window.addEventListener('resize', function () {
let element = document.getElementById('streamsMobile');
let width = window.innerWidth;
if (width <= 700) {
element.classList.remove('hidden');
} else {
element.classList.add('hidden');
}
});
// Check on initial load
window.dispatchEvent(new Event('resize'));
}
// Call loadScripts function after defining it
window.onload = loadScripts;
</script>
<script src="streamsDesktop.js"></script>
<script src="/react-templates\past-events-template\build\static\js\main.c55309bd.js"></script>
<script src="react-templates\nav-bar\build\static\js\main.f5d4c7e5.js"></script>
<script src="/script.js"></script>
</body>
</html>