Skip to content

Commit

Permalink
修复:简介少于三行时评论区域样式错乱;
Browse files Browse the repository at this point in the history
修复:使用`bgmv0`源时不显示评分
  • Loading branch information
HCLonely committed Aug 30, 2024
1 parent 86a7752 commit eb567b3
Show file tree
Hide file tree
Showing 7 changed files with 44 additions and 27 deletions.
1 change: 1 addition & 0 deletions lib/get-bgmv0-data.js
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ var getData = /*#__PURE__*/function () {
score: (_bangumi$subject$scor = bangumi === null || bangumi === void 0 || (_bangumi$subject6 = bangumi.subject) === null || _bangumi$subject6 === void 0 ? void 0 : _bangumi$subject6.score) !== null && _bangumi$subject$scor !== void 0 ? _bangumi$subject$scor : '-',
des: "".concat(bangumi === null || bangumi === void 0 || (_bangumi$subject7 = bangumi.subject) === null || _bangumi$subject7 === void 0 || (_bangumi$subject7 = _bangumi$subject7.short_summary) === null || _bangumi$subject7 === void 0 ? void 0 : _bangumi$subject7.trim(), "...") || '-',
collect: (bangumi === null || bangumi === void 0 || (_bangumi$subject8 = bangumi.subject) === null || _bangumi$subject8 === void 0 ? void 0 : _bangumi$subject8.collection_total) || '-',
myStars: bangumi.rate || null,
myComment: bangumi.comment || '-',
progress: Math.round(((bangumi === null || bangumi === void 0 ? void 0 : bangumi.ep_status) || 0) / ((bangumi === null || bangumi === void 0 || (_bangumi$subject9 = bangumi.subject) === null || _bangumi$subject9 === void 0 ? void 0 : _bangumi$subject9.eps) || 1) * 100),
tags: (bangumi === null || bangumi === void 0 || (_bangumi$subject10 = bangumi.subject) === null || _bangumi$subject10 === void 0 || (_bangumi$subject10 = _bangumi$subject10.tags) === null || _bangumi$subject10 === void 0 || (_bangumi$subject10 = _bangumi$subject10[0]) === null || _bangumi$subject10 === void 0 ? void 0 : _bangumi$subject10.name) || '-',
Expand Down
25 changes: 15 additions & 10 deletions lib/templates/bgm-template.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -32,15 +32,20 @@
</div>
<div class="bangumi-comments" <%- color ? `style="color:${color};"` : '' %>>
<p><%= __('summary') %><%= item.des || __('noSummary') %></p>
<% if (showMyComment && item.myComment) { %>
<div class="bangumi-my-comments"><%= __('myScore') %>
<% if (item.myStars) { %>
<span class="bangumi-starstop"><span class="bangumi-starlight stars<%= item.myStars %>"></span></span>
<% } %>
<br>
<%= __('comment') %><%= item.myComment %>
</div>
<% } %>
</div>
</div>
</div><% if (showMyComment && (item.myComment || item.myStars)) { %>
<div class="bangumi-comments" <%- color ? `style="color:${color};" ` : '' %>>
<div class="bangumi-my-comments">
<%= __('myScore') %>
<% if (item.myStars) { %>
<span class="bangumi-starstop"><span
class="bangumi-starlight stars<%= item.myStars %>"></span></span>
<% } else { %>
暂无
<% } %>
<br>
<%= __('comment') %><%= item.myComment %>
</div>
</div>
<% } %>
</div>
29 changes: 18 additions & 11 deletions lib/templates/bgmv0-template.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -36,17 +36,24 @@
<div class="progress-bar" style="width: <%= item.progress > 100 ? 100 : item.progress %>%;"></div>
</div>
<% } %>
<div class="bangumi-comments" style="margin-top: 10px;<%- color ? `color:${color};` : '' %>">
<p><%= __('summary') %><%= item.des || __('noSummary') %></p>
<% if (showMyComment && item.myComment) { %>
<div class="bangumi-my-comments">
<% if (item.myStars) { %>
<%= __('myScore') %><span class="bangumi-starstop"><span class="bangumi-starlight stars<%= item.myStars %>"></span></span>
<br>
<% } %>
<%= __('comment') %><%= item.myComment %>
</div>
<% } %>
<div class="bangumi-summary" <%- color ? `style="color:${color};" ` : '' %>>
<p>
<%= __('summary') %><%= item.des || __('noSummary') %>
</p>
</div>
</div>
<% if (showMyComment && (item.myComment || item.myStars)) { %>
<div class="bangumi-comments" <%- color ? `style="color:${color};" ` : '' %>>
<div class="bangumi-my-comments">
<%= __('myScore') %>
<% if (item.myStars) { %>
<span class="bangumi-starstop"><span
class="bangumi-starlight stars<%= item.myStars %>"></span></span>
<% } else { %>
暂无
<% } %>
<br>
<%= __('comment') %><%= item.myComment %>
</div>
</div><% } %>
</div>
2 changes: 1 addition & 1 deletion lib/templates/index.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "hexo-bilibili-bangumi",
"version": "1.10.3",
"version": "1.10.4",
"description": "hexo bilibili番剧页",
"main": "index.js",
"scripts": {
Expand Down
1 change: 1 addition & 0 deletions src/lib/get-bgmv0-data.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ const getData = async (vmid, status, typeNum, pn, coverMirror) => {
score: bangumi?.subject?.score ?? '-',
des: `${bangumi?.subject?.short_summary?.trim()}...` || '-',
collect: bangumi?.subject?.collection_total || '-',
myStars: bangumi.rate || null,
myComment: bangumi.comment || '-',
progress: Math.round(((bangumi?.ep_status || 0) / (bangumi?.subject?.eps || 1)) * 100),
tags: bangumi?.subject?.tags?.[0]?.name || '-',
Expand Down
11 changes: 7 additions & 4 deletions src/lib/templates/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -53,12 +53,12 @@ a.bangumi-tab {
height: 45px;
}

.bangumi-comments {
.bangumi-summary {
font-size: 12px;
margin-top: 10px
margin-top: 10px;
}

.bangumi-comments>p {
.bangumi-summary>p {
word-break: break-all;
text-overflow: ellipsis;
overflow: hidden;
Expand All @@ -69,6 +69,10 @@ a.bangumi-tab {
-webkit-line-clamp: 3;
}

.bangumi-comments {
font-size: 12px;
}

.bangumi-pagination {
margin-top: 15px;
text-align: center;
Expand Down Expand Up @@ -214,7 +218,6 @@ a.bangumi-tab {
border: 1px dashed #8f8f8f;
padding: 3px;
border-radius: 5px;
margin-left: -120px;
}

.bangumi-starstop {
Expand Down

0 comments on commit eb567b3

Please sign in to comment.