-
Notifications
You must be signed in to change notification settings - Fork 26
/
theme.html
66 lines (63 loc) · 1.5 KB
/
theme.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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Theme builder</title>
<meta name="viewport" content="initial-scale=1,user-scalable=no,maximum-scale=1,width=device-width">
<style>
#octocard,
#octocard2,
#octocard3 {
margin-right: 1em !important;
margin-bottom: 1em !important;
float: left;
}
#octocard {
width: 180px;
}
#octocard2 {
width: 240px;
}
#octocard3 {
width: 480px;
}
</style>
</head>
<body>
<div id="octocard"></div>
<div id="octocard2"></div>
<div id="octocard3"></div>
<script src="bin/octocard.js"></script>
<script>
var uname = /name=([^$&]+)/.exec(location.search);
var theme = /theme=([^$&]+)/.exec(location.search);
uname = uname ? uname[1] : 'zmmbreeze';
theme = theme ? theme[1] : 'default';
var xhr = new XMLHttpRequest();
xhr.onload = function (e) {
var css = xhr.responseText;
if (!css) {
alert('Theme file not found!');
return;
}
octocard({
name: uname,
themeCSS: css,
element: 'octocard'
});
octocard({
name: uname,
themeCSS: css,
element: 'octocard2'
});
octocard({
name: uname,
themeCSS: css,
element: 'octocard3'
});
};
xhr.open('GET', './bin/themes/' + theme + '.css');
xhr.send();
</script>
</body>
</html>