/
show.html
122 lines (87 loc) · 4.15 KB
/
show.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
<!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 params = (new URL(document.location)).searchParams;
var seriesId = params.get('series_id');
var request = new XMLHttpRequest();
request.open('GET', "https://wfc2-image-api-259809.appspot.com/api/series/" + seriesId + "/", true);
request.responseType = 'json';
request.onload = function () {
var data = this.response;
const book_details = document.getElementById("book_details");
book_details.setAttribute("class", "row");
const book_img = document.createElement("div");
book_img.setAttribute("class", "col-lg-3");
const img = document.createElement("img");
img.setAttribute("src", data.seriesImage);
img.setAttribute("class", "show-img");
book_img.appendChild(img)
const book_details_right = document.createElement("div");
book_details_right.setAttribute("class", "col-lg-9");
const book_title = document.createElement("div");
book_title.setAttribute("class", "book_title_show");
const book_title_text = document.createTextNode( data.title);
book_title.appendChild(book_title_text)
const book_publisher = document.createElement("div");
book_publisher.setAttribute("class", "book_publisher_show");
const book_publisher_text = document.createTextNode( data.publisher);
book_publisher.appendChild(book_publisher_text)
const book_author = document.createElement("div");
book_author.setAttribute("class", "book_author_show");
const book_author_text = document.createTextNode( data.author);
book_author.appendChild(book_author_text)
const book_description = document.createElement("div");
book_description.setAttribute("class", "book_description_show");
const book_description_text = document.createTextNode( data.description );
book_description.appendChild(book_description_text)
book_details.appendChild(book_img)
book_details_right.appendChild(book_title)
book_details_right.appendChild(book_author)
book_details_right.appendChild(book_publisher)
book_details_right.appendChild(book_description)
book_details.appendChild(book_details_right)
const books = data.books
for(let i = 0; i < books.length; i++) {
const div_main = document.getElementById("div_book");
div_main.setAttribute("class", "row");
const inner_box = document.createElement("div");
inner_box.setAttribute("class", "col-lg-3 col-xs-6 comic_outer_box");
const a1 = document.createElement("a");
a1.href = ('comic_main.html?comic_id=' + books[i].id + '&&series_id=' + seriesId)
a1.innerText = "この漫画を読む";
a1.setAttribute("class", "btn btn-primary btn-lg btn-block");
const img = document.createElement("img");
img.setAttribute("src", books[i].image);
img.setAttribute("class", "top-img");
const title = document.createElement("div");
title.setAttribute("class", "title book_title_css");
const book_title = document.createTextNode( books[i].title);
title.appendChild(book_title)
div_main.appendChild(inner_box)
inner_box.appendChild(title)
inner_box.appendChild(img)
inner_box.appendChild(a1)
}
console.log(data);
};
request.send();
</script>
<title>漫画ビューアー</title>
</head>
<div class="header_main">
<div class="header_title">漫画リーダー</div>
</div>
<div class="container">
<div id = "book_details"></div><hr>
<div id="div_book"></div>
<a href="index.html" class="back_button">
<i class="fa fa-home"></i>
</a>
</div>