feat: Subtitle typed animation

This commit is contained in:
shenyu
2020-01-30 14:14:35 +08:00
parent 7fcdbf8722
commit da20d7b3c9
5 changed files with 50 additions and 17 deletions

View File

@@ -6,6 +6,20 @@
<%- js('fancybox/jquery.fancybox.min') %>
<% } %>
<% if (theme.subtitle.enable){ %>
<script src="https://cdn.jsdelivr.net/npm/typed.js@2.0.11/lib/typed.min.js"></script>
<script>
var typed = new Typed("#subtitle", {
strings: ['<%= theme.subtitle.text %>'],
startDelay: <%= theme.subtitle.startDelay %>,
typeSpeed: <%= theme.subtitle.typeSpeed %>,
loop: <%= theme.subtitle.loop %>,
backSpeed: <%= theme.subtitle.backSpeed %>,
showCursor: <%= theme.subtitle.showCursor %>
});
</script>
<% } %>
<% if (theme.toc && is_post()){ %>
<%- js('/js/tocbot.min') %>
<script>

View File

@@ -12,7 +12,13 @@
</div>
<div class="cover-inner text-center text-white">
<h1><a href="<%- url_for() %>"><%= config.title %></a></h1>
<h2><%= config.subtitle %></h2>
<div id="subtitle-box">
<% if (theme.subtitle.enable) { %>
<span id="subtitle"></span>
<% }else{ %>
<span id="subtitle"><%= theme.subtitle.text %></span>
<% } %>
</div>
<div>
<% if (theme.cover.logo) { %>
<img