-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
51 lines (46 loc) · 1.91 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Book Recommender</title>
<link rel="stylesheet" href="https://pyscript.net/releases/2024.6.2/core.css">
<link rel="stylesheet" href="styles.css">
<script type="module" src="https://pyscript.net/releases/2024.6.2/core.js"></script>
<script type="module">
const loading = document.getElementById('loading');
addEventListener('py:ready', () => loading.close());
loading.showModal();
</script>
</head>
<body>
<dialog id="loading">
<h2 class="loading-text">Loading PyScript, please wait (1-2 min)...</h2>
<div class="loader_wrapper">
<div class="loader" id="load_throbber"></div>
</div>
</dialog>
<div class="container">
<h1>Book Recommender</h1>
<div class="input-group">
<input type="text" id="book_name" name="book_name" required placeholder="Enter your favorite book...">
</div>
<div class="button-group">
<button type="submit" py-click="button_pressed">Get Recommendations</button>
</div>
<div class="message" id="result_message"></div>
<div id="recommendations-list">
<template id = "recommendation-template">
<div class="query-main recommendation">
<img class="query-image" alt="Book Image">
<div>
<h3 class="query-title">Placeholder Title</h3>
<p><strong>Author:</strong> <span class="query-author">Placeholder Author</span></p>
<p><strong>Published:</strong> <span class="query-published">Placeholder Published</span></p>
</div>
</div>
</template>
</div>
<py-script src="main.py" config='{"packages":["numpy", "pandas", "scikit-learn"]}'></py-script>
</body>
</html>