-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
173 lines (157 loc) · 5.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
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
<!DOCTYPE html>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>KeyHintQR</title>
<style id="css_mode_control">
#mode_intro {
display: none;
}
#mode_key {
display: none;
}
</style>
<style>
html,
body {
font-family: 'SF Pro Text', 'Inter', 'TeX Gyre Heros', system-ui, -apple-system, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Open Sans', 'Helvetica Neue', sans-serif;
}
#global-wrapper {
max-width: 900px;
margin: 0 auto;
}
#mode_key {
text-align: center;
}
.content {
padding: 0 15px;
}
</style>
<style>
h1 {
text-align: center;
}
header,
footer {
padding: 90px 0;
}
footer p {
font-size: 13px;
}
</style>
<style>
/* For key mode */
#js_gamecover {
display: block;
width: 100%;
max-width: 500px;
margin: 0 auto;
border-radius: 10px;
}
#js_keystring {
font-family: 'JetBrains Mono', 'Ubuntu Mono', 'Courier New', Courier, monospace;
font-weight: 600;
font-size: 22px;
text-align: center;
padding: 30px 0;
}
#js_keystring_span {
display: inline-block;
padding: 10px 15px 9px;
border: 1px solid #CCC;
border-radius: 9px;
}
#js_btn_copy {
font-size: 13px;
transform: translateY(-2.5px);
border-radius: 5px;
border: none;
padding: 4px 5px;
}
</style>
<script>
let is_key_mode = false;
let search_params_dict = {};
if (location.search.length > 0) {
const _tmp_params_arr = location.search.slice(1).split('&');
console.log(_tmp_params_arr);
_tmp_params_arr.forEach(function (pair_string) {
const key = pair_string.split('=')[0];
const value = pair_string.split('=').slice(1).join('=');
search_params_dict[key] = value;
});
};
console.log(search_params_dict);
if (Object.keys(search_params_dict).indexOf('s') > -1) {
is_key_mode = true;
document.querySelector('#css_mode_control').innerHTML = `#mode_intro { display: none; }
#mode_key { display: block; }`;
} else {
document.querySelector('#css_mode_control').innerHTML = `#mode_intro { display: block; }
#mode_key { display: none; }`;
}
</script>
</head>
<body>
<div id="global-wrapper">
<div id="mode_intro">
<header>
<h1>KeyHintQR</h1>
</header>
<div class="content" style="text-align: center;">
<p>
See <a href="https://github.com/nekostein/keyhintqr">GitHub</a> for usage.
</p>
</div>
</div>
<div id="mode_key">
<header>
<h1>A Steam Key for You</h1>
</header>
<div class="content">
<img id="js_gamecover" src="" alt="Cover Image">
<div id="js_keystring">
<span id="js_keystring_span">
<span id="js_keystring_span_inner">
</span>
<button id="js_btn_copy" onclick="write_clipboard_keystring();">COPY</button>
</span>
<input type="text" id="js_keystring_hidden_input" style="display: none;" />
</div>
<div>
<!-- <a href="https://help.steampowered.com/en/faqs/view/2A12-9D79-C3D7-F870">How to activate a game on Steam</a> -->
<a href="https://store.steampowered.com/account/redeemwalletcode">Go to redeem →</a>
</div>
</div>
<script>
if (is_key_mode) {
const appid = search_params_dict.s.split(':')[0];
const coverimg_url = `https://shared.cloudflare.steamstatic.com/store_item_assets/steam/apps/${appid}/header.jpg`;
document.querySelector('#js_gamecover').src = coverimg_url;
document.querySelector('#js_keystring_span_inner').innerHTML = search_params_dict.s.split(':')[1];
document.querySelector('#js_keystring_hidden_input').value = search_params_dict.s.split(':')[1];
};
function write_clipboard_keystring() {
var copyText = document.getElementById("js_keystring_hidden_input");
copyText.select();
copyText.setSelectionRange(0, 99999); // For mobile devices
navigator.clipboard.writeText(copyText.value);
};
</script>
</div>
<footer style="text-align: center;">
<p>NOTICE: This site is a web tool that allows arbitrary person to share product activation keys as QR codes and NFC tags.<br />
The maintainer of this site does not endorse the availability of the keys shared on this page.<br />
The party who constructs the URL is responsible for the accuracy of the information presented here.
</p>
<p>
Copyright © 2024 Nekostein.<br />
Nekostein is an unincorporated game development team consisting of Neruthes and MIAO_OAIM.<br />
This web tool is published with the GNU GPL 2.0 license.
</p>
</footer>
</div>
</body>
</html>