-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
174 lines (151 loc) · 5.46 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
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
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link href="{{ url_for('static', path='/stylecode.css') }}" rel="stylesheet">
<title>Book</title>
</head>
<body>
<header>
<h1>Welcome to our Library!</h1>
<form action="/search" method="get">
<input type="text" name="q" placeholder="Search for a book..." />
<button type="submit">Search</button>
</form>
</header>
<main>
<button class="scroll-down-button" onclick="scrollToBottom()">Scroll Down</button>
<h3> Recommended for reading:</h3>
<div class="book-shelf">
<div class="book"><img src="static/images/horor_1.jpg" alt="Book 1" /></div>
<div class="book"><img src="static/images/horor_2.jpg" alt="Book 2" /></div>
<div class="book">
<img src="static/images/comedy_1.jpeg" alt="Book 3" />
</div>
<div class="book">
<img src="static/images/book_4.webp" alt="Book 4" />
</div>
<div class="book">
<img src="static/images/horor_1.jpg" alt="Book 5" />
</div>
<div class="book">
<img src="static/images/horor_2.jpg" alt="Book 6" />
</div>
<div class="book">
<img src="static/images/comedy_1.jpeg" alt="Book 7" />
</div>
<div class="book">
<img src="static/images/book_4.webp" alt="Book 8" />
</div>
<div class="book">
<img src="static/images/horor_1.jpg" alt="Book 9" />
</div>
<div class="book">
<img src="static/images/horor_2.jpg" alt="Book 10" />
</div>
<div class="book">
<img src="static/images/comedy_1.jpeg" alt="Book 11" />
</div>
<div class="book">
<img src="static/images/book_4.webp" alt="Book 12" />
</div>
</div>
<script src="moving.js"></script>
{% if search_results %}
<h2>Search Results:</h2>
<ul>
{% for book in search_results %}
<li>{{ book.name }} by {{ book.author }}</li>
{% endfor %}
</ul>
{% endif %}
<h2>All Books:</h2>
<ul>
{% for book in books %}
<li>
{{ book.name }} by {{ book.author }} ({{ book.year }}) - {{ book.pages }} pages
{% if book.genre %}
<ul>
{% for genre in book.genre %}
<li>{{ genre }}</li>
{% endfor %}
</ul>
{% endif %}
</li>
{% endfor %}
</ul>
<h2>Add a new book:</h2>
<form action="/add_book" method="post">
<label for="name">Name:</label>
<input type="text" name="name" required>
<br>
<label for="author">Author:</label>
<input type="text" name="author" required>
<br>
<label for="genre">Genre (comma-separated):</label>
<input type="text" name="genre" required>
<br>
<label for="year">Year:</label>
<input type="number" name="year" required>
<br>
<label for="pages">Pages:</label>
<input type="number" name="pages" required>
<br>
<button type="submit">Add Book</button>
</form>
<h2>Remove a book:</h2>
<form action="/remove" method="delete">
<label for="name">Name:</label>
<input type="text" name="name" required>
<br>
<button type="submit">Remove Book</button>
</form>
</main>
<footer>
<p>© Read what you want and what wants you.</p>
</footer>
</body>
<!-- <div class="quates">
<h1>Read what you want!</h1>
</div>
<div class="search-bar">
<input type="text" id="searchInput" placeholder="Search for a book...">
<button onclick="searchBooks()">Search</button>
</div>
<div class="book-shelf">
<div class="book"><img src="static/images/horor_1.jpg" alt="Book 1" /></div>
<div class="book"><img src="static/images/horor_2.jpg" alt="Book 2" /></div>
<div class="book">
<img src="static/images/comedy_1.jpeg" alt="Book 3" />
</div>
<div class="book">
<img src="static/images/book_4.webp" alt="Book 4" />
</div>
<div class="book">
<img src="static/images/horor_1.jpg" alt="Book 5" />
</div>
<div class="book">
<img src="static/images/horor_2.jpg" alt="Book 6" />
</div>
<div class="book">
<img src="static/images/comedy_1.jpeg" alt="Book 7" />
</div>
<div class="book">
<img src="static/images/book_4.webp" alt="Book 8" />
</div>
<div class="book">
<img src="static/images/horor_1.jpg" alt="Book 9" />
</div>
<div class="book">
<img src="static/images/horor_2.jpg" alt="Book 10" />
</div>
<div class="book">
<img src="static/images/comedy_1.jpeg" alt="Book 11" />
</div>
<div class="book">
<img src="static/images/book_4.webp" alt="Book 12" />
</div>
</div>
</html>