-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtemplate.html
79 lines (73 loc) · 2.23 KB
/
template.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
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>PROJECT-GRAVITY</title>
<link rel="stylesheet" href="//cdn.bootcss.com/bootstrap/3.3.5/css/bootstrap.min.css">
<script src="//cdn.bootcss.com/jquery/1.11.3/jquery.min.js"></script>
<script src="//cdn.bootcss.com/bootstrap/3.3.5/js/bootstrap.min.js"></script>
<script >
$(function(){
$.get("images/list.json",function(data,status){
var list = data;
var artboards;
//alert(list.length)
var col = 12;
if(list.length > 3){
col = 3;
}else if (list.length == 3) {
col = 4
}else if (list.length == 2) {
col = 6
}
var html = "";
for(var i = 0;i < list.length;i++)
{
html += "<div class='col-md-" + col + " col-sm-" + col +"'>";
html += "<img src='images/"+ list[i] +"' class='img-responsive' >";
html += "</div>";
//artboards[]=list[i]
}
$("#list").html(html);
$("#list .img-responsive").click(function(){
$("#artboard").attr("src",$(this).attr("src"));
$("#artboard_main").show();
$("#list").hide();
});
$("#artboard_main").click(function(){
$("#artboard_main").hide();
$("#list").show();
})
//alert(html);
//alert("Data:" + data + "\nStatus:"+ status);
});
})
</script>
<style>
.container{
max-width: 1400px;
min-width: 1200px;
}
body{
background-color: #f5f5f5;
}
#list > div > img{
background-color: #fff;
}
</style>
</head>
<body>
<div class="container">
<div class="page-header">
<h1>PROJECT-GRAVITY</h1>
</div>
<div class="container" id="artboard_main" style="display:none">
<img src="" id="artboard" class="center-block">
</div>
<div class="row" id="list">
</div>
</div>
</body>
</html>