-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
183 lines (162 loc) · 5.03 KB
/
index.html
File metadata and controls
183 lines (162 loc) · 5.03 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
171
172
173
174
175
176
177
178
179
180
181
182
183
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>TCGStreamShop </title>
<meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1,user-scalable=0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<meta name="title" content="TCGStreamShop">
<meta name="description" content="A Twitch Integration for the game TCG Card Shop Simulator on Steam">
<meta name="keywords" content="TCG, Card, Shop, Simulator, Twitch, custom, Integration, streaming, letsiii, letsi">
<meta name="author" content="letsi">
<meta name="og:image" content="https://bilder.letsi.de/extension/github/TCG%20Card%20Shop%20Simulator%20Background.png">
<meta name="og:url" content="https://letsi.github.io/TCGStreamShop">
<style>
@import url("https://fonts.cdnfonts.com/css/typo-square-demo");
body {
display: flex;
justify-content: center;
font-family: "Typo Square Bold Demo", sans-serif;
font-size: 16px;
background-image: url("https://bilder.letsi.de/extension/github/TCG%20Card%20Shop%20Simulator%20Background.png");
background-repeat: no-repeat;
background-size: cover;
background-attachment: fixed;
background-position: center;
}
main {
padding: 1rem 1.5rem;
border: 1px solid #000;
border-radius: 6px;
margin-top: 2rem;
color: #dcdee0;
width: 50%;
min-width: 330px;
background-color: rgba(0, 0, 0, 65%);
backdrop-filter: blur(3px);
}
h1,
h2 {
margin: 0;
text-align: center;
}
header {
margin-bottom: 2rem;
}
ol {
list-style: none;
counter-reset: steps;
}
ol li {
margin: 1rem 0;
position: relative;
counter-increment: steps;
}
ol li::before {
position: absolute;
left: -2.25rem;
content: counter(steps);
width: 1.5rem;
height: 1.5rem;
border: 2px solid #ffffff;
border-radius: 50px;
display: inline-block;
text-align: center;
margin-right: 1rem;
}
#card-footer {
margin-top: 2rem;
display: flex;
justify-content: center;
}
.btn {
font-size: 1rem;
padding: 0.5rem 1rem;
background-color: #9147ff;
color: #fff;
text-decoration: none;
border: 0;
cursor: pointer;
}
.btn:hover {
background-color: #772ce8;
}
.hidden {
display: none;
}
.input-grp {
padding: 1rem 1.5rem;
display: flex;
}
input {
width: 100%;
box-sizing: border-box;
padding: 0.5rem 1rem;
border: 2px solid #aa74f9;
}
b {
color: rgb(255, 162, 162);
}
</style>
</head>
<body>
<main>
<header>
<h1>TCGStreamShop</h1>
<h2>TCG Card Shop Simulator - Twitch Integration</h2>
</header>
<div id="intro">
<p>Please follow the steps below to configure the mod correctly:</p>
<ol>
<li>
Click on the button below to allow the mod to fetch viewers from
your Twitch chat<br />
<small
>After authorization is complete, you will be redirected back to
this page</small
>
</li>
<li>
Copy the secret into the config
<br /><small
>Please <b>DO NOT SHARE</b> this secret with anyone!</small
>
</li>
<li>Now your viewers can visit your TCG Card Shop!</li>
</ol>
<div id="card-footer">
<a
class="btn"
href="https://id.twitch.tv/oauth2/authorize?response_type=token&client_id=3ufjbjd40kpb0maff76rhdttas15lc&redirect_uri=https://letsi.github.io/TCGStreamShop/&scope=moderator%3Aread%3Achatters+chat%3Aread+chat%3Aedit"
>
Authorize now
</a>
</div>
</div>
<div id="complete" class="hidden">
<p>
Copy the secret below into the config<br /><small
>Please <b>DO NOT SHARE</b> this secret with anyone!</small
>
</p>
<div class="input-grp">
<input type="text" id="client-secret" readonly />
<button class="btn" id="copy-token">Copy</button>
</div>
</div>
</main>
<script type="text/javascript">
const hash = document.location.hash;
if (!!hash) {
document.getElementById("intro").classList.add("hidden");
document.getElementById("complete").classList.remove("hidden");
const client_secret = hash.match(/access_token=([^&]+)/)[1];
document.getElementById("client-secret").value = `oauth:${client_secret}`;
document.getElementById("copy-token").addEventListener("click", (e) => {
e.preventDefault();
navigator.clipboard.writeText(`oauth:${client_secret}`);
});
}
</script>
</body>
</html>