|
1 | 1 | <!DOCTYPE html> |
2 | | -<html lang="en"> |
| 2 | +<html> |
3 | 3 | <head> |
4 | | - <title>My Book Library</title> |
| 4 | + <title> </title> |
| 5 | + <meta |
| 6 | + charset="utf-8" |
| 7 | + name="viewport" |
| 8 | + content="width=device-width, initial-scale=1.0" |
| 9 | + /> |
| 10 | + <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script> |
| 11 | + <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.16.0/umd/popper.min.js"></script> |
| 12 | + <script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.4.1/js/bootstrap.min.js"></script> |
5 | 13 | <link |
6 | | - href="https://unpkg.com/tailwindcss@^2/dist/tailwind.min.css" |
7 | 14 | rel="stylesheet" |
| 15 | + href="https://maxcdn.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css" |
8 | 16 | /> |
| 17 | + <link rel="stylesheet" type="text/css" href="style.css" /> |
9 | 18 | </head> |
10 | 19 |
|
11 | | - <body class="bg-gray-100 p-8 bg-gradient-to-r from-indigo-100"> |
12 | | - <h1 class="text-8xl font-bold mb-4">My Book Library</h1> |
| 20 | + <body> |
| 21 | + <div class="jumbotron text-center"> |
| 22 | + <h1>Library</h1> |
| 23 | + <p>Add books to your virtual library</p> |
| 24 | + </div> |
| 25 | + |
| 26 | + <button data-toggle="collapse" data-target="#demo" class="btn btn-info"> |
| 27 | + Add new book |
| 28 | + </button> |
13 | 29 |
|
14 | | - <form id="add-book" class="bg-white p-4 rounded-lg shadow-md max-w-2xl"> |
15 | | - <div class="mb-4"> |
16 | | - <label for="titleInput" class="block font-bold">Title:</label> |
| 30 | + <div id="demo" class="collapse"> |
| 31 | + <div class="form-group"> |
| 32 | + <label for="title">Title:</label> |
17 | 33 | <input |
18 | | - id="titleInput" |
19 | | - type="text" |
20 | | - name="titleInput" |
21 | | - class="border p-2 w-full" |
| 34 | + type="title" |
| 35 | + class="form-control" |
| 36 | + id="title" |
| 37 | + name="title" |
22 | 38 | required |
23 | 39 | /> |
24 | | - </div> |
25 | | - |
26 | | - <div class="mb-4"> |
27 | | - <label for="authorInput" class="block font-bold">Author:</label> |
| 40 | + <label for="author">Author: </label> |
28 | 41 | <input |
29 | | - id="authorInput" |
30 | | - type="text" |
31 | | - name="authorInput" |
32 | | - class="border p-2 w-full" |
| 42 | + type="author" |
| 43 | + class="form-control" |
| 44 | + id="author" |
| 45 | + name="author" |
33 | 46 | required |
34 | 47 | /> |
35 | | - </div> |
36 | | - |
37 | | - <div class="mb-4"> |
38 | | - <label for="pagesInput" class="block font-bold">Pages:</label> |
| 48 | + <label for="pages">Pages:</label> |
39 | 49 | <input |
40 | | - id="pagesInput" |
41 | 50 | type="number" |
42 | | - name="pagesInput" |
43 | | - class="border p-2 w-full" |
44 | | - min="1" |
| 51 | + class="form-control" |
| 52 | + id="pages" |
| 53 | + name="pages" |
45 | 54 | required |
46 | 55 | /> |
| 56 | + <label class="form-check-label"> |
| 57 | + <input |
| 58 | + type="checkbox" |
| 59 | + class="form-check-input" |
| 60 | + id="check" |
| 61 | + value="" |
| 62 | + />Read |
| 63 | + </label> |
| 64 | + <input |
| 65 | + type="submit" |
| 66 | + value="Submit" |
| 67 | + class="btn btn-primary" |
| 68 | + onclick="submit();" |
| 69 | + /> |
47 | 70 | </div> |
| 71 | + </div> |
48 | 72 |
|
49 | | - <div class="flex items-center mb-4"> |
50 | | - <input id="readInput" name="readInput" type="checkbox" class="mr-2" /> |
51 | | - <label for="readInput">Read</label> |
52 | | - </div> |
53 | | - |
54 | | - <button |
55 | | - type="submit" |
56 | | - class="bg-blue-500 text-white py-2 px-4 rounded-lg hover:bg-blue-600" |
57 | | - > |
58 | | - Add Book |
59 | | - </button> |
60 | | - </form> |
61 | | - |
62 | | - <table class="bg-white rounded-lg shadow-md mt-8 w-full"> |
63 | | - <thead> |
| 73 | + <table class="table" id="display"> |
| 74 | + <thead class="thead-dark"> |
64 | 75 | <tr> |
65 | 76 | <th>Title</th> |
66 | 77 | <th>Author</th> |
67 | | - <th>Pages</th> |
| 78 | + <th>Number of Pages</th> |
68 | 79 | <th>Read</th> |
69 | | - <th>Remove</th> |
| 80 | + <th></th> |
70 | 81 | </tr> |
71 | 82 | </thead> |
72 | | - <template id="book-row" class="max-w-3xl"> |
| 83 | + <tbody> |
73 | 84 | <tr> |
74 | 85 | <td></td> |
75 | 86 | <td></td> |
76 | 87 | <td></td> |
77 | 88 | <td></td> |
78 | 89 | <td></td> |
79 | 90 | </tr> |
80 | | - </template> |
| 91 | + </tbody> |
81 | 92 | </table> |
82 | 93 |
|
83 | | - <script> |
84 | | - const bookRowTemplate = document.getElementById('book-row'); |
85 | | - const bookTable = document.querySelector('table'); |
86 | | - |
87 | | - const addBookForm = document.getElementById('add-book'); |
88 | | - const titleInput = document.getElementById('titleInput'); |
89 | | - const authorInput = document.getElementById('authorInput'); |
90 | | - const pagesInput = document.getElementById('pagesInput'); |
91 | | - const readInput = document.getElementById('readInput'); |
92 | | - |
93 | | - const books = []; |
94 | | - |
95 | | - function addBook(e) { |
96 | | - e.preventDefault(); |
97 | | - |
98 | | - const book = { |
99 | | - title: titleInput.value, |
100 | | - </script> |
| 94 | + <script src="script.js"></script> |
101 | 95 | </body> |
102 | 96 | </html> |
0 commit comments