/
index.html
93 lines (68 loc) · 3.04 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
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
<link rel="stylesheet" href="small.css" media="screen and (max-width:480px)">
<link rel="stylesheet" href="example.css" media="screen and (min-width:481px)">
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css" integrity="sha384-Vkoo8x4CGsO3+Hhxv8T/Q5PaXtkKtu6ug5TOeNV6gBiFeWPGFN9MuhOf23Q9Ifjh" crossorigin="anonymous">
<link href="https://use.fontawesome.com/releases/v5.6.1/css/all.css" rel="stylesheet">
<script type="text/javascript">
var request = new XMLHttpRequest();
request.open('GET', 'https://wfc2-image-api-259809.appspot.com/api/series/', true);
request.responseType = 'json';
request.onload = function () {
var data = this.response;
for(let i = 0; i < data.data.length; i++) {
const div_main = document.getElementById("div_main");
div_main.setAttribute("class", "row");
const div_main_card = document.createElement("div");
div_main_card.setAttribute("class", "col-lg-3 col-xs-6 comic_outer_box");
const div_title = document.createElement("div");
div_title.setAttribute("class", "volumes");
const title = document.createTextNode(data.data[i].title);
div_title.appendChild(title);
const div_publish = document.createElement("div");
const publisher = document.createTextNode('出版社:' + data.data[i].publisher);
div_publish.appendChild(publisher);
const div_volumes = document.createElement("div");
const volumes = document.createTextNode('全' + data.data[i].volumes + '巻');
div_volumes.appendChild(volumes);
const div_desc = document.createElement("div");
if(data.data[i].description.length <= 43){
str = data.data[i].description
} else {
str = data.data[i].description.substring(0, 43) + '.....';
}
const description = document.createTextNode(str);
div_desc.appendChild(description);
const img = document.createElement("img");
img.setAttribute("src", data.data[i].seriesImage);
img.setAttribute("class", "top-img");
const a1 = document.createElement("a");
a1.href = ('show.html?series_id=' + data.data[i].seriesId)
a1.innerText = "この漫画の全巻を見る";
a1.setAttribute("class", "btn btn-primary btn-lg btn-block");
div_main_card.appendChild(div_title);
div_main_card.appendChild(div_publish);
div_main_card.appendChild(div_volumes);
div_main_card.appendChild(img);
div_main_card.appendChild(div_desc);
div_main_card.appendChild(a1);
div_main.appendChild(div_main_card)
}
console.log(data);
};
request.send();
</script>
<title>漫画ビューアー</title>
</head>
<div class="header_main">
<div class="header_title">漫画リーダー</div>
</div>
<div class="container">
<div id="div_main"></div>
<a href="index.html" class="back_button">
<i class="fa fa-home"></i>
</a>
</div>