-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
142 lines (123 loc) · 4.81 KB
/
index.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
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="https://bootswatch.com/5/superhero/bootstrap.min.css">
<script src="tmi.js"></script>
<script src="twitch.js" type="module"></script>
<script src="bot.js" type="module"></script>
<!-- Additional styles for mobile nav -->
<style>
.navbar-toggler-icon {
color: #fff; /* Change the color of the mobile menu icon */
}
.overlay-chat {
position: fixed;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
width: 300px;
height: 400px;
overflow-y: scroll; /* Change to scroll for vertical scrollbar */
background-color: rgba(0, 0, 0, 0.7);
padding: 10px;
border-radius: 10px;
}
.channel-switcher {
text-align: center;
margin-bottom: 10px;
}
.badge {
width: 20px;
height: 20px;
margin-left: 5px;
}
/* Toast styles */
.toast-container {
position: fixed;
top: 10px;
right: 10px;
z-index: 1000;
}
/* Chat message styles */
.chat-message {
color: white;
margin-bottom: 5px;
}
.emote-image {
width: 20px; /* Adjust the width of emote images as needed */
height: auto;
}
/* Additional style for tracked users */
#tracked-users {
color: white;
margin-top: 10px;
}
</style>
<title>PolyChat</title>
</head>
<body>
<header class="z-depth-1">
<nav class="navbar navbar-expand-lg navbar-dark backer-dark z-depth-0">
<div class="container">
<a class="navbar-brand" href="#">PolyChat</a>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarNav"
aria-controls="navbarNav" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarNav">
<ul class="navbar-nav">
<li class="nav-item"><a class="nav-link" href="https://rebrand.ly/PolyExtended">Home</a></li>
<li class="nav-item"><a class="nav-link" href="https://rebrand.ly/polylive">PolyLive</a></li>
<li class="nav-item"><a class="nav-link" href="https://rebrand.ly/PolyStreamLookup">PolyLookup</a>
</li>
<li class="nav-item"><a class="nav-link" href="https://rebrand.ly/polywyr">Poly - WYR?</a></li>
</ul>
</div>
</div>
</nav>
</header>
<div class="alert alert-dismissible alert-light" id="connectionAlert" style="display: none;">
<button type="button" class="btn-close" data-bs-dismiss="alert"></button>
<strong>Heads up!</strong> You Are Now Connected To Twitch: Channel <span id="connectedChannel"></span>
</div>
<div class="overlay-chat" id="overlayChat">
<div class="channel-switcher">
<label for="channel-select" class="text-white">Switch Channel:</label>
<select id="channel-select" class="form-select" onchange="switchChannel()"></select>
</div>
<div id="tracked-users" class="text-white mt-2"></div>
<div id="chat-messages" class="chat-box"></div>
</div>
<!-- Toast container -->
<div class="toast-container"></div>
<script>
// Fetch GitHub repository information
fetch('https://api.github.com/repos/PolyExtended/PolyChat')
.then(response => response.json())
.then(data => {
const repositoryName = data.name;
const repositoryDescription = data.description;
const repositoryOwner = data.owner.login;
const repositoryUrl = data.html_url;
const repositoryImage = data.owner.avatar_url;
// Update Twitter Card meta tags
document.querySelector('meta[name="twitter:title"]').setAttribute('content', repositoryName);
document.querySelector('meta[name="twitter:description"]').setAttribute('content', repositoryDescription);
document.querySelector('meta[name="twitter:site"]').setAttribute('content', `@${repositoryOwner}`);
document.querySelector('meta[name="twitter:image"]').setAttribute('content', repositoryImage);
// Update Open Graph (OG) meta tags
document.querySelector('meta[property="og:title"]').setAttribute('content', repositoryName);
document.querySelector('meta[property="og:description"]').setAttribute('content', repositoryDescription);
document.querySelector('meta[property="og:url"]').setAttribute('content', repositoryUrl);
document.querySelector('meta[property="og:image"]').setAttribute('content', repositoryImage);
document.querySelector('meta[property="og:site_name"]').setAttribute('content', repositoryName);
})
.catch(error => {
console.error('Error fetching GitHub repository information:', error);
});
// Your existing JavaScript code (if any) can be placed here if needed.
</script>
</body>
</html>