forked from chao-master/TSSSFF-Generator
-
Notifications
You must be signed in to change notification settings - Fork 1
/
browser.html
135 lines (129 loc) · 5.99 KB
/
browser.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
<html>
<head>
<title>TSSSFF Card Generator</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link href="css/bootstrap.min.css" rel="stylesheet">
<link href="css/ripples.min.css" rel="stylesheet">
<link href="css/material-wfont.min.css" rel="stylesheet">
<link href="css/font-awesome.min.css" rel="stylesheet">
<link href="cardStyling.css" rel="stylesheet">
<style>
.icons {
text-align:center;
}
.icons img{
max-height:22px;
}
</style>
</head>
<body>
<div class="container">
<div class="row">
<div class="col-md-12">
<div class="panel">
<div class="panel-body">
<table id="viewTable" class="table table-hover" style="margin: 30px 0;">
<tr>
<th>Name</th>
<th class="icons">Kinds</th>
<th>Attributes</th>
<th>Copyright</th>
<th> </th>
<th> </th>
</tr>
</table>
</div>
</div>
</div>
</div>
</div>
<script src="https://code.jquery.com/jquery-1.11.1.min.js"></script>
<script src="js/bootstrap.min.js"></script>
<script src="js/ripples.min.js"></script>
<script src="js/material.min.js"></script>
<script>
var LAST_KEY = ''
function loadMoreCards(){
$.get("dbInterface.php",{
"view":LAST_KEY,
"amount":50
},function(r){
var d = JSON.parse(r);
$.each(d,function(_,i){
var key = i.viewkey;
//Build the icon sets
var iconCell = $("<td class='icons'>")
var type = i.classes.match(/pony|start|ship|goal/)[0];
var mappings = [{
goal:"resources/symbols/Symbol-Goal.png",
ship:"resources/symbols/Symbol-Ship.png",
}];
if (type == "pony" || type == "start"){
if (i.classes.indexOf("changeling") == -1){
mappings.push({
unicorn:"resources/symbols/Symbol-Unicorn.png",
earthPony:"resources/symbols/Symbol-Earth-Pony.png",
pegasus:"resources/symbols/Symbol-Pegasus.png",
alicorn:"resources/symbols/Symbol-Alicorn.png"
})
} else {
mappings.push({
unicorn:"resources/symbols/Symbol-ChangelingUnicorn.png",
earthPony:"resources/symbols/Symbol-ChangelingEarthPony.png",
pegasus:"resources/symbols/Symbol-ChangelingPegasus.png",
alicorn:"resources/symbols/Symbol-ChangelingAlicorn.png"
})
}
mappings.push({
maleFemale:"resources/symbols/Symbol-MaleFemale.png",
male:"resources/symbols/Symbol-male.png",
female:"resources/symbols/Symbol-Female.png"
})
mappings.push({time:"resources/symbols/symbol-dystopian-future.png"})
} else if (type=="goal") {
mappings.push({
s0:"resources/symbols/symbol-0.png",
s1:"resources/symbols/symbol-1.png",
s2:"resources/symbols/symbol-2.png",
s3:"resources/symbols/symbol-3.png"
})
}
$.each(mappings,function(_,map){
$.each(map,function(k,v){
if (i.classes.indexOf(k) > -1){
iconCell.append($("<img/>").attr("src",v))
return false;
}
})
})
$("<tr>").append(
$("<td>").text(i.name)
).append(iconCell).append(
$("<td>").text(i.attr)
).append(
$("<td>").text(i.copyright)
).append(
$("<td>").append(
$("<i class='fa fa-picture-o'>")
.attr("data-original-title","<img style='max-width:184px;' src='"+i.image.replace(/'/g,"")+"'/>")
.attr("data-html","1")
.attr("data-placement","left")
.tooltip()
)
).append(
$("<td>").append(
$('<a>').attr("href","./#view:"+i.viewkey).append(
$('<i class="fa fa-external-link">')
)
)
).appendTo("#viewTable")
})
})
}
$(document).ready(function() {
$.material.init();
loadMoreCards()
});
</script>
</body>
</html>