diff options
Diffstat (limited to 'layouts')
| -rw-r--r-- | layouts/partials/style.html | 23 | ||||
| -rw-r--r-- | layouts/shortcodes/book.html | 10 |
2 files changed, 33 insertions, 0 deletions
diff --git a/layouts/partials/style.html b/layouts/partials/style.html index 0576b88..8685d39 100644 --- a/layouts/partials/style.html +++ b/layouts/partials/style.html @@ -29,6 +29,29 @@ 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05); } + .booklist { + display: grid; + grid-template-columns: repeat(5, 1fr); + gap: 20px; + } + + .booklist-item { + transform: translateZ(0); + transition: + transform 0.25s, + box-shadow 0.25s; + box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1); + } + + .booklist-item img { + height: 100%; + } + + .booklist-item:hover { + transform: translateY(-5px) translateZ(20px); + box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5); + } + .social-icons { display: inline; font-size: 16px; diff --git a/layouts/shortcodes/book.html b/layouts/shortcodes/book.html new file mode 100644 index 0000000..072669b --- /dev/null +++ b/layouts/shortcodes/book.html @@ -0,0 +1,10 @@ + +<div class="booklist-item"> + {{ if .Get "url" }} + <a href="{{ .Get "url" }}"> + <img class="book-cover" src="{{ .Get "cover" }}" alt="图书封面" /> + </a> + {{ else }} + <img class="book-cover" src="{{ .Get "cover" }}" alt="图书封面" /> + {{ end }} +</div> |
