Skip to content

Commit f9ab499

Browse files
committed
fixed twitch page
1 parent 046f30e commit f9ab499

File tree

8 files changed

+68
-35
lines changed

8 files changed

+68
-35
lines changed

_includes/head.html

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<head>
2+
<meta charset="utf-8">
3+
<meta http-equiv="X-UA-Compatible" content="IE=edge">
4+
<meta name="viewport" content="width=device-width, initial-scale=1">
5+
{%- seo -%}
6+
<link rel="stylesheet" href="{{ "/assets/main.css" | relative_url }}">
7+
<link rel="shortcut icon" type="image/png" href="favicon.png">
8+
{%- feed_meta -%}
9+
{%- if jekyll.environment == 'production' and site.google_analytics -%}
10+
{%- include google-analytics.html -%}
11+
{%- endif -%}
12+
</head>

_includes/twitch_head.html

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<head>
2+
<meta charset="utf-8">
3+
<meta http-equiv="X-UA-Compatible" content="IE=edge">
4+
<meta name="viewport" content="width=device-width, initial-scale=1">
5+
{%- seo -%}
6+
<link href='http://fonts.googleapis.com/css?family=Roboto:400,700,300' rel='stylesheet' type='text/css'>
7+
<link href="https://fonts.googleapis.com/css?family=Montserrat&display=swap" rel="stylesheet" type='text/css'>
8+
<link href="twitch.css" rel="stylesheet" type="text/css">
9+
10+
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
11+
<script src="https://gitcdn.xyz/repo/tmijs/cdn/master/latest/1.x/tmi.min.js"></script>
12+
{%- feed_meta -%}
13+
{%- if jekyll.environment == 'production' and site.google_analytics -%}
14+
{%- include google-analytics.html -%}
15+
{%- endif -%}
16+
</head>

_layouts/twitch_layout.html

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<!DOCTYPE html>
2+
<html lang="{{ page.lang | default: site.lang | default: "en" }}">
3+
4+
{%- include twitch_head.html -%}
5+
6+
<body>
7+
8+
<main class="page-content" aria-label="Content">
9+
<div class="wrapper">
10+
{{ content }}
11+
</div>
12+
</main>
13+
14+
</body>
15+
16+
</html>

favicon.png

26.1 KB
Loading

twitch.html

Lines changed: 0 additions & 34 deletions
This file was deleted.

bot.js renamed to twitchbot/bot.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,6 @@ function badges(channel, user, isBot) {
9191

9292
if(!isBot) {
9393
if (user.badges) {
94-
console.log(`Has badges`)
9594
if (user.badges.admin) {
9695
chatBadges.appendChild(createBadge('admin'));
9796
}
File renamed without changes.

twitchbot/twitch.html

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
---
2+
layout: twitch_layout
3+
title: Twitch
4+
permalink: /twitch
5+
---
6+
7+
<div class="channel-form">
8+
<input class="channel-text" type="text" id="channelText" name="channelText" placeholder="Enter a Twitch channel name">
9+
<button class="connect-btn">Connect to chat</button>
10+
</div>
11+
<div id="chat"></div>
12+
13+
<script src="bot.js"></script>
14+
<script>
15+
$(document).ready(function(){
16+
chatClient = new chatClient (opts);
17+
chatClient.open();
18+
$('.connect-btn').click(function(){
19+
opts['channels'] = [channelText.value];
20+
chatClient.reset(opts);
21+
});
22+
});
23+
</script>
24+

0 commit comments

Comments
 (0)