-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
280 lines (244 loc) · 6.73 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
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta name="viewport" content="width=320, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
<meta name="google-site-verification" content="1kiC4tvdf6sjk9BGi__J6cU2bLCBk5KoXSMgTFNx8V0" />
<title>Old xCreat10n</title>
<link rel="manifest" origin="use-credentials" href="manifest.json" />
<script type="application/javascript">
window.XIO = window.XIO || {};
window.XIO.ENVIRONMENT_MODE = window.XIO.ENVIRONMENT_MODE || "dev";
function onClickEvent(element) {
var url = element.getAttribute("href");
element.addEventListener("click", function() {
gtag("event", "url_clicked", {
"social_name": url
});
});
}
// Google tag (gtag.js)
(function(id) {
if (window.location.protocol.toString() != "https:")
return;
window.XIO = window.XIO || {};
window.XIO.ENVIRONMENT_MODE = "prod";
var scr = document.createElement("script");
scr.setAttribute("src", "https://www.googletagmanager.com/gtag/js?id=" + id);
scr.async = true;
scr.setAttribute("type", "application/javascript");
document.getElementsByTagName('head')[0].appendChild(scr);
window.dataLayer = window.dataLayer || [];
window.gtag = window.gtag || function() {
dataLayer.push(arguments);
};
gtag('js', new Date());
gtag('config', id);
document.addEventListener("DOMContentLoaded", function() {
Array.prototype.forEach.call(document.getElementsByClassName("listen-on-click"), function(element) {
onClickEvent(element);
});
});
}("G-JPJZGW7PW6"));
</script>
<style type="text/css">
body {
display: block;
margin: 1px auto 1px auto;
white-space: nowrap;
padding: 0;
background-color: #fff;
width: 320px;
text-align: center;
font-size: 1em;
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
line-height: 1.42857143;
color: #555555;
}
h4{
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
font-weight: 700;
line-height: 1.1;
color: #317eac;
margin-top: 10px;
margin-bottom: 10px;
font-size: 18px;
}
#item-list, #item-list > div {
width: 100%;
}
#item-list > div > div {
background-color: rgba(250,250,250, 0.6);
width: 85px;
height: 85px;
border: 5px double #f0f0f0;
margin: 5px;
border-radius: 15px;
box-shadow: 4px 4px 5px rgba(153,153,153,0.6);
position: relative;
min-height: 1px;
float: left;
}
#item-list > div > div > div {
width: 100%;
}
#item-list > div > div > div > div {
width: 100%;
overflow: hidden;
height: auto;
line-height: 20px;
}
#item-list > div > div > div > div > h4 {
margin: 0;
padding: 0;
border-top: 1px groove #f5f5f5;
color: #6891ac;
}
#item-list > div > div > div > div > p:last-child {
border-bottom: 1px groove #f0f0f0;
width: 98%;
font-weight: 600;
font-size: 13px;
color: #515151;
margin: 0;
}
#item-list > div > div > div > div > p:nth-child(2) {
text-align: right;
position: inline-block;
vertical-align: bottom;
font-family: monospace;
margin: 0 5px 0 0;
padding: 0;
line-height: 9.5px;
font-size: 8px;
font-weight: bold;
color: #9b1f2a;
}
.dummy {
bottom: -500px;
width: 100%;
height: 20px;
display: block;
position: static;
clear: both;
}
body > div:first-child, body > div:nth-child(2){
text-align: center;
background-color: rgba(200, 240, 245, 0.7);
position: fixed;
width: 310px;
z-index: 99;
display: block;
margin: -1px 4px 7px 4px;
border: 1px solid #eeeeee;
border-radius: 0 0 15px 15px;
}
body > div:nth-child(2){
opacity: 0;
position: static;
width: 20px;
}
#item-list > div > div:hover {
background-color: rgba(65,111,187, 0.5);
color: #fff;
}
table, tr, td {
border: 0;
border-collapse: collapse;
position: fixed;
float:left;
width: 100%;
height: 100%;
}
</style>
</head>
<body>
<div>
<h4 class="">Old xCreat10n</h4>
</div>
<!-- Taking off this one may cause of problem on item list -->
<div>
<h4 class="">p</h4>
</div>
<noscript>JavaScript is Off</noscript>
<div id="item-list" class="container">
<div id="display"></div>
</div>
<div class="dummy"></div>
</body>
<!--Data is here-->
<script src="index.js"></script>
<script type="text/javascript">
'use strict'
document.body.onload = function(){
var index = getData();
render(index);
};
function render(index){
index.map(function(data){
var type = (data["type"]) ? " " + data["type"] : "";
var name = data["title"]
var version = data["version"];
var link = toUrl(data["link"]);
var size = Math.floor(140 / name.length);
size = (size > 16) ? 16 : size;
size = (size < 10) ? 10 : size;
var up = (57 - size) / 2;
var a = document.createElement("div");
var h4 = document.createElement("h4");
h4.setAttribute("style", "font-size:" + size + "px");
h4.appendChild(document.createTextNode(name)); //H4
a.appendChild(h4);
var ap = document.createElement("p");
ap.appendChild(document.createTextNode(version));
a.appendChild(ap);
var bp = document.createElement("p");
bp.appendChild(document.createTextNode(ucfirst(type)));
a.appendChild(bp);
a.setAttribute("style", "margin:" + up + "px auto 0 auto;");
var b = document.createElement("div");
b.appendChild(a);
var c = document.createElement("div");
c.setAttribute("onclick", "run ('" + link + "')");
c.appendChild(b);
document.getElementById('display').appendChild(c);
});
}
function run(str){
document.location.href = document.location.href + str;
}
/**Helpers**/
function urlEncode(str){
return "%" + str.split("").map(function(char) {
return Number(char.charCodeAt(0)).toString(16);
}).join("%");
}
function urlDecode(str){
return str.substr(1).split("%").map(function(hex) {
return String.fromCharCode(parseInt(hex, 16));
}).join("");
}
function ucfirst(str){
str = str.trim();
return str.charAt(0).toUpperCase() + str.substr(1);
}
function dirname(str){
if(typeof str == "object"){
str = str.toString();
}
var len = str.length;
var res = "";
for(var i = len; i > 0; i--){
if(str.charAt(i - 1) == "/"){
return str.replace("/" + res.split("").reverse().join(""), "");
}
res += str.charAt(i - 1);
}
}
function toUrl(str){
var x = str;
while(x.indexOf(" ") != -1){
x = x.replace(" ", "%20");
} return x;
}
/**/</script>
</html>