-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
103 lines (99 loc) · 4.2 KB
/
index.html
File metadata and controls
103 lines (99 loc) · 4.2 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Check online twitch streamers</title>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css">
<!--animate -->
<!--jQuery-->
<script src="https://code.jquery.com/jquery-3.1.1.min.js"></script>
<!--Load Bootstrap js after jquery-->
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/handlebars.js/4.0.6/handlebars.min.js"></script>
<link rel="stylesheet" href="styling.css">
<script src="main.js"></script>
</head>
<body>
<div class="container">
<div class="jumbotron">
<h1>Twitch Streamers</h1>
<hr>
<p>This page makes it easy to check which of your favourite <a href="https://www.twitch.tv/" target="_blank">TwitchTV</a> streamers are currently live.</p>
<p>Simply type to search to add streamers.</p>
<p>Your favourite streamers will be saved in your browser, so it will remember your personalised list.</p>
<hr>
<div class="input-group">
<input type="text" id="searchTxt" class="form-control search-form" placeholder="Follow channel / Search">
<span class="input-group-btn">
<button class="btn btn-primary search-btn">
<i class="fa fa-search"></i>
</button>
</span>
</div>
<div class="row">
<div class="center-block col-md-4 btn-group" data-toggle="buttons" style="float: none">
<label class="btn btn-info" onclick="delayRedraw()">
<input type="radio" name="options" id="On"/>Both</label>
<label class="btn btn-info" onclick="delayRedraw()">
<input type="radio" name="options" id="online"/>Online</label>
<label class="btn btn-info" onclick="delayRedraw()">
<input type="radio" name="options" id="offline"/>Offline</label>
</div>
</div>
<div id="content">
<div class="text-center">
<i class="fa fa-5x fa-spin fa-cog"></i>
</div>
</div>
</div>
<footer class="jumbotron" style="padding: 3px; margin: 0; opacity: 0.6">
<hr style="margin-bottom: 2px">
No personal details are collected. This page aims to be lightweight and privacy conscious.
<span class="pull-right">Created for a <a href="https://www.freecodecamp.com" target="_blank">FreeCodeCamp</a> challenge - <a href="https://github.com/TimLehner/CheckTwitchTV" target="_blank">view the source</a>.</span>
</footer>
</div>
<script>
jQuery('#searchTxt').on('input', function() {
redraw();
});
</script>
<script id="entry-template" type="text/x-handlebars-template">
{{#valid}}
<table class="table table-striped table-hover table-responsive">
<tbody>
{{#channels}}
<tr>
<td>
<img class="img thumbnail-sm img-rounded img-responsive" src="{{logo}}">
</td>
<td>
<a href="{{url}}" target="_blank">{{name}}</a>
<p style="font-size: 10px">(Opens in new tab)</p>
</td>
<td>
{{#hasPreview}}<img class="img thumbnail thumbnail-md img-responsive" src="{{preview}}">{{/hasPreview}}
</td>
<td>
{{#hasMessage}}{{message}}{{/hasMessage}}{{^hasMessage}}<i>Offline</i>{{/hasMessage}}
</td>
<td>
<button class="btn btn-sm btn-danger" onclick="remove('{{name}}')">X</button>
</td>
</tr>
{{/channels}}
</tbody>
</table>
{{/valid}}
{{^valid}}
<div class="row">
<div class="alert-warning text-center" style="padding: 10px">
<p>Warning: {{searchName}} does not match any of your followed Twitch streams.</p>
<br>
<button class="btn btn-primary" onclick="add('{{searchName}}')">Click here to follow {{searchName}}</button>
</div>
</div>
{{/valid}}
</script>
</body>
</html>