parent
816e5972e2
commit
c5a9c9eb9b
4 changed files with 70 additions and 19 deletions
@ -1,14 +1,59 @@ |
||||
<section class='m_widget' id='music'> |
||||
<header class='header <%= theme.style %>'> |
||||
<div><i class="<%= theme.widgets.music.icon %> fa-fw" aria-hidden="true"></i> <%= theme.widgets.music.title %></div> |
||||
<a class="rightBtn" target="_blank" rel="external nofollow noopener noreferrer" href="<%= theme.widgets.music.link %>"><i class="far fa-heart fa-fw"></i></a> |
||||
</header> |
||||
<div class='content <%= theme.style %>'> |
||||
<div class="aplayer" data-theme="<%= theme.widgets.music.color %>" |
||||
data-mode="<%= theme.widgets.music.mode %>" |
||||
data-server="<%= theme.widgets.music.server %>" |
||||
data-type="<%= theme.widgets.music.type %>" |
||||
data-id="<%= theme.widgets.music.id %>" |
||||
data-volume="<%= theme.widgets.music.volume %>"></div> |
||||
</div> |
||||
</section> |
||||
<% |
||||
var needDisplay = false; |
||||
if (theme.widgets.music && theme.widgets.music.display) { |
||||
let display = theme.widgets.music.display; |
||||
if (page.layout == 'page') { |
||||
if (display.page != false) { |
||||
needDisplay = true; |
||||
} |
||||
} else if (page.layout == 'post') { |
||||
if (display.post != false && (!page.music || page.music.enable == false)) { |
||||
needDisplay = true; |
||||
} |
||||
} else if (page.layout == 'links') { |
||||
if (display.links != false) { |
||||
needDisplay = true; |
||||
} |
||||
} else { |
||||
if (is_home()) { |
||||
if (display.home != false) { |
||||
needDisplay = true; |
||||
} |
||||
} else if (is_tag()) { |
||||
if (display.tag != false) { |
||||
needDisplay = true; |
||||
} |
||||
} else if (is_category()) { |
||||
if (display.category != false) { |
||||
needDisplay = true; |
||||
} |
||||
} else if (is_archive()) { |
||||
if (display.archive != false) { |
||||
needDisplay = true; |
||||
} |
||||
} else { |
||||
needDisplay = true; |
||||
} |
||||
} |
||||
} |
||||
%> |
||||
|
||||
<% if (needDisplay == true) { %> |
||||
<section class='m_widget' id='music'> |
||||
<header class='header <%= theme.style %>'> |
||||
<div><i class="<%= theme.widgets.music.icon %> fa-fw" aria-hidden="true"></i> <%= theme.widgets.music.title %></div> |
||||
<a class="rightBtn" target="_blank" rel="external nofollow noopener noreferrer" href="<%= theme.widgets.music.link %>"><i class="far fa-heart fa-fw"></i></a> |
||||
</header> |
||||
<div class='content <%= theme.style %>'> |
||||
<div class="aplayer" data-theme="<%= theme.widgets.music.color %>" |
||||
data-mode="<%= theme.widgets.music.mode %>" |
||||
data-server="<%= theme.widgets.music.server %>" |
||||
data-type="<%= theme.widgets.music.type %>" |
||||
data-id="<%= theme.widgets.music.id %>" |
||||
data-volume="<%= theme.widgets.music.volume %>"></div> |
||||
</div> |
||||
</section> |
||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/aplayer@1.7.0/dist/APlayer.min.css"> |
||||
<script src="https://cdn.jsdelivr.net/npm/aplayer@1.7.0/dist/APlayer.min.js"></script> |
||||
<script src="https://cdn.jsdelivr.net/npm/meting@1.1.0/dist/Meting.min.js"></script> |
||||
<% } %> |
||||
|
Loading…
Reference in new issue