aboutsummaryrefslogtreecommitdiff
path: root/public
diff options
context:
space:
mode:
Diffstat (limited to 'public')
-rw-r--r--public/index.html2
-rw-r--r--public/main.css11
-rw-r--r--public/main.js19
3 files changed, 10 insertions, 22 deletions
diff --git a/public/index.html b/public/index.html
index 13136da..bbef5ae 100644
--- a/public/index.html
+++ b/public/index.html
@@ -2,5 +2,5 @@
<meta charset="UTF-8">
<link rel="stylesheet" href="main.css">
<body></body>
-<script src="data.js"></script>
+<script src="books.js"></script>
<script src="main.js"></script>
diff --git a/public/main.css b/public/main.css
index 711aaf2..7e7f297 100644
--- a/public/main.css
+++ b/public/main.css
@@ -1,8 +1,15 @@
body {
- margin: 2rem;
+ margin: 0;
+ display: flex;
}
-.g-Books {
+.g-Aside {
+ padding: 1rem;
+ background-color: #333;
+}
+
+.g-Main {
+ padding: 1rem;
display: grid;
grid-template-columns: repeat(7, minmax(0, 1fr));
grid-gap: 1rem;
diff --git a/public/main.js b/public/main.js
deleted file mode 100644
index 29de235..0000000
--- a/public/main.js
+++ /dev/null
@@ -1,19 +0,0 @@
-const sortedBooks = books.sort((a, b) =>
- a.authorsSort == b.authorsSort
- ? a.date > b.date
- : a.authorsSort > b.authorsSort)
-
-const view = h('div',
- { className: 'g-Books' },
- ...sortedBooks.map(book => h('img', { className: 'g-Book', src: book.cover })))
-
-document.body.appendChild(view)
-
-// Helpers
-
-function h(tagName, attrs, ...children) {
- let elem = document.createElement(tagName)
- elem = Object.assign(elem, attrs)
- for (const child of children) elem.append(child)
- return elem
-}