Skip to content

Commit

Permalink
Update index.html
Browse files Browse the repository at this point in the history
  • Loading branch information
Bacon_Space authored Oct 7, 2023
1 parent ee6e5e4 commit 21e1c94
Showing 1 changed file with 13 additions and 30 deletions.
43 changes: 13 additions & 30 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,10 @@
<meta name="og:image" content="default-image-url.png" id="og-image">
<meta name="twitter:image" content="default-image-url.png" id="twitter-image">
<!-- Include Bootstrap CSS -->
<link rel="stylesheet" href="https://streamstats.github.io/TwitchStats/css/main.css">
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-T3c6CoIi6uLrA9TneNEoa7RxnatzjcDSCmG1MXxSR1GAsXEV/Dwwykc2MPK8M2HN" crossorigin="anonymous">

<link rel="stylesheet" href="https://cdn.rawgit.com/needim/noty/77268c46/lib/noty.css">
<link rel="stylesheet" href="https://thecursedgroup.github.io/css/gtatheme.css">
<script type="text/javascript" src="https://streamstats.github.io/TwitchStats/js/bootstrap.js"></script>
<script type="text/javascript" src="meta.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.29.1/moment.min.js"></script>
Expand All @@ -17,7 +20,10 @@
<div class="container">
<h1>Twitch Stats</h1>
<div id="login-section">
<button class="btn btn-primary" id="login-button">Login with Twitch</button>
<div class="d-grid gap-2 col-6 mx-auto">
<!-- Change the button to a link pointing to redirect.html -->
<a class="btn btn-primary" id="login-button" href="redirect.html">Login with Twitch</a>
</div>
</div>
<div id="user-info" style="display: none;">
<h2>User Information</h2>
Expand All @@ -31,7 +37,8 @@ <h2>User Information</h2>
</div>
</div>
<div id="redirect-section" style="display: none;">
<button class="btn btn-primary" id="redirect-button">Redirect to Twitch</button>
<!-- Change the button to an anchor element -->
<a class="btn btn-primary" id="redirect-button" href="#">Redirect to Twitch</a>
</div>
</div>
<footer>
Expand All @@ -40,13 +47,14 @@ <h2>User Information</h2>
<!-- Include Bootstrap and Twitch SDK JS scripts -->
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/js/bootstrap.min.js"></script>
<script src="https://embed.twitch.tv/embed/v1.js"></script>
<script src="https://cdn.jsdelivr.net/gh/needim/noty@77268c46/lib/noty.min.js"></script>
<script>
// Replace with your Twitch Client ID
const clientId = "5i1dxwe52zbj0tra8evwmm4m1b7clz1";
let bannedUsers = [];

// Fetch the banned user list from the given URL
fetch('https://polyextended.github.io/lookup/banned.json')
fetch('banned.json')
.then(response => response.json())
.then(data => {
bannedUsers = data.users;
Expand Down Expand Up @@ -97,29 +105,4 @@ <h2>User Information</h2>
.then(response => response.json())
.then(data => {
const user = data.data[0];
document.getElementById("username").textContent = user.display_name;
// You can fetch and display more user data here if needed
document.getElementById("followers").textContent = user.followers_count;

// Check if the user is banned
if (bannedUsers.includes(user.display_name.toLowerCase())) {
document.getElementById("alert-section").style.display = "block";
document.getElementById("login-section").style.display = "none";
} else {
// Show the user information section
document.getElementById("user-info").style.display = "block";
document.getElementById("login-section").style.display = "none";
}
})
.catch(error => console.error("Error fetching user data:", error));
}
}

// Check if the page was loaded after a redirect
if (window.location.hash.includes("access_token")) {
handleRedirect();
}
</script>

</body>
</html>
document.getElementById

0 comments on commit 21e1c94

Please sign in to comment.