Skip to content

Commit

Permalink
Add margin offset
Browse files Browse the repository at this point in the history
  • Loading branch information
mmdjiji committed Aug 24, 2022
1 parent 661db2e commit b8e6629
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ bangumis:
bgmtv_uid: mmdjiji # bgm.tv的uid
download_image: true # 下载图片并使用本地图片,否则使用bgm.tv提供的网络图源
lazyload: true # 是否开启懒加载
margin: 20px # 封面图的偏移量微调
```
## 使用
Expand Down
4 changes: 2 additions & 2 deletions dist/templates/bgm-template.ejs
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<div class="bangumi-item">
<div class="bangumi-picture">
<% if(download_image) { %>
<img src="<%= lazyload ? ("/images/loading.gif") : `/images/${item.image}` %>" <%- lazyload ? ` data-src="/images/${item.image}"` : '' %> referrerPolicy="no-referrer" width="110" style="width:110px;margin:20px auto;" />
<img src="<%= lazyload ? ("/images/loading.gif") : `/images/${item.image}` %>" <%- lazyload ? ` data-src="/images/${item.image}"` : '' %> referrerPolicy="no-referrer" width="110" style="width:110px;margin:<%= margin %> auto;" />
<% } else { %>
<img src="<%= lazyload ? ("/images/loading.gif") : `https://lain.bgm.tv/pic/cover/c/${item.image}` %>" <%- lazyload ? ` data-src="https://lain.bgm.tv/pic/cover/c/${item.image}"` : '' %> referrerPolicy="no-referrer" width="110" style="width:110px;margin:20px auto;" />
<img src="<%= lazyload ? ("/images/loading.gif") : `https://lain.bgm.tv/pic/cover/c/${item.image}` %>" <%- lazyload ? ` data-src="https://lain.bgm.tv/pic/cover/c/${item.image}"` : '' %> referrerPolicy="no-referrer" width="110" style="width:110px;margin:<%= margin %> auto;" />
<% } %>
</div>
<div class="bangumi-info">
Expand Down
1 change: 1 addition & 0 deletions src/lib/bangumi-generator.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ module.exports = async function (locals) {
color_meta: config.bangumis.color_meta ? `style="color:${config.bangumis.color_meta}"` : '',
color: config.bangumis.color ? `style="color:${config.bangumis.color}"` : '',
lazyload: config.bangumis.lazyload ?? true,
margin: config.bangumis.margin ?? '20px',
download_image: config.bangumis.download_image ?? false,
wantWatch,
watched,
Expand Down

0 comments on commit b8e6629

Please sign in to comment.