scrollreveal

master
xaoxuu 4 years ago
parent b62a8bce11
commit f0aae76bd6
  1. 9
      _config.yml
  2. 2
      layout/_partial/article.ejs
  3. 14
      layout/_partial/scripts.ejs
  4. 2
      layout/_third-party/comments.ejs
  5. 2
      layout/archive.ejs
  6. 2
      layout/category.ejs
  7. 2
      layout/links.ejs
  8. 2
      layout/tag.ejs
  9. 4
      source/css/_layout/main.styl

@ -408,8 +408,13 @@ plugins:
css: https://cdn.jsdelivr.net/npm/@fancyapps/fancybox@3.5.7/dist/jquery.fancybox.min.css css: https://cdn.jsdelivr.net/npm/@fancyapps/fancybox@3.5.7/dist/jquery.fancybox.min.css
js: https://cdn.jsdelivr.net/gh/fancyapps/fancybox@3.5.7/dist/jquery.fancybox.min.js js: https://cdn.jsdelivr.net/gh/fancyapps/fancybox@3.5.7/dist/jquery.fancybox.min.js
# Page Scrolling Animation # https://scrollrevealjs.org/api/reveal.html
scrollreveal: #https://cdn.jsdelivr.net/npm/scrollreveal@4.0.5/dist/scrollreveal.min.js scrollreveal:
js: https://cdn.jsdelivr.net/npm/scrollreveal@4.0.6/dist/scrollreveal.min.js
distance: 8px
duration: 800 # ms
interval: 100 # ms
scale: 1 # 0.1~1
# Codeblock Copy Button # Codeblock Copy Button
clipboard: https://cdn.jsdelivr.net/npm/clipboard@2/dist/clipboard.min.js clipboard: https://cdn.jsdelivr.net/npm/clipboard@2/dist/clipboard.min.js

@ -1,7 +1,7 @@
<% var sections = page.body ? page.body : theme.layout.on_page.body; %> <% var sections = page.body ? page.body : theme.layout.on_page.body; %>
<% sections.forEach(function(widget_id){ %> <% sections.forEach(function(widget_id){ %>
<% if (widget_id == 'article') { %> <% if (widget_id == 'article') { %>
<article id="<%= post.layout %>" class="post white-box <%- theme.style.body.effect.join(' ') %> article-type-<%= post.layout %>" itemscope itemprop="blogPost"> <article id="<%= post.layout %>" class="post white-box reveal <%- theme.style.body.effect.join(' ') %> article-type-<%= post.layout %>" itemscope itemprop="blogPost">
<%- partial('meta', {post: post, position: 'header'}) %> <%- partial('meta', {post: post, position: 'header'}) %>
<section class="article typo"> <section class="article typo">
<div class="article-entry" itemprop="articleBody"> <div class="article-entry" itemprop="articleBody">

@ -23,14 +23,16 @@
<% if (theme.plugins.instant_page) { %> <% if (theme.plugins.instant_page) { %>
<script async src="<%- theme.plugins.instant_page %>" type="module" defer integrity="sha384-OeDn4XE77tdHo8pGtE1apMPmAipjoxUQ++eeJa6EtJCfHlvijigWiJpD7VDPWXV1"></script> <script async src="<%- theme.plugins.instant_page %>" type="module" defer integrity="sha384-OeDn4XE77tdHo8pGtE1apMPmAipjoxUQ++eeJa6EtJCfHlvijigWiJpD7VDPWXV1"></script>
<% } %> <% } %>
<% if (theme.plugins.scrollreveal) { %> <% if (theme.plugins.scrollreveal && theme.plugins.scrollreveal.js) { %>
<script src="<%- theme.plugins.scrollreveal %>"></script> <script src="<%- theme.plugins.scrollreveal.js %>"></script>
<script type="text/javascript"> <script type="text/javascript">
$(function() { $(function() {
const $reveal = $('.reveal'); ScrollReveal().reveal('.l_main .reveal', {
if ($reveal.length === 0) return; distance: '<%- theme.plugins.scrollreveal.distance %>',
const sr = ScrollReveal({ distance: 0 }); duration: '<%- theme.plugins.scrollreveal.duration %>',
sr.reveal('.reveal'); interval: '<%- theme.plugins.scrollreveal.interval %>',
scale: '<%- theme.plugins.scrollreveal.scale %>'
});
}); });
</script> </script>
<% } %> <% } %>

@ -25,7 +25,7 @@
%> %>
<% if (enableDisqus || enableLivere || enableGitalk || enableValine || enableMiniValine) { %> <% if (enableDisqus || enableLivere || enableGitalk || enableValine || enableMiniValine) { %>
<article class="post white-box comments <%- theme.style.body.effect.join(' ') %>"> <article class="post white-box reveal comments <%- theme.style.body.effect.join(' ') %>">
<section class="article typo"> <section class="article typo">
<p ct><%- theme.comments && theme.comments.title %></p> <p ct><%- theme.comments && theme.comments.title %></p>
<% if (theme.comments && theme.comments.subtitle) { %> <% if (theme.comments && theme.comments.subtitle) { %>

@ -3,7 +3,7 @@
<% if (page.year || page.month) { %> <% if (page.year || page.month) { %>
<%- partial('_partial/archive') %> <%- partial('_partial/archive') %>
<% } else { %> <% } else { %>
<article id="archive-page" class="post article white-box <%- theme.style.body.effect.join(' ') %>"> <article id="archive-page" class="post article white-box reveal <%- theme.style.body.effect.join(' ') %>">
<section class="archive"> <section class="archive">
<% <%
var year = -1, postid = -1; var year = -1, postid = -1;

@ -5,7 +5,7 @@
<% if (page.layout == 'category') { %> <% if (page.layout == 'category') { %>
<section class="post-list <%- theme.layout.multiple_columns ? 'multiple-columns' : '' %>"> <section class="post-list <%- theme.layout.multiple_columns ? 'multiple-columns' : '' %>">
<div class='post-wrapper'> <div class='post-wrapper'>
<article id="archive-page" class="post article white-box <%- theme.style.body.effect.join(' ') %>"> <article id="archive-page" class="post article white-box reveal <%- theme.style.body.effect.join(' ') %>">
<section class="archive"> <section class="archive">
<div class="archive-item archive-year mark"> <div class="archive-item archive-year mark">
<h2><%- page.title %></h2> <h2><%- page.title %></h2>

@ -1,6 +1,6 @@
<%- partial('_pre') %> <%- partial('_pre') %>
<div class='l_main<%- page.sidebar == false ? ' no_sidebar' : '' %>'> <div class='l_main<%- page.sidebar == false ? ' no_sidebar' : '' %>'>
<article id="<%= page.layout %>" class="post white-box <%- theme.style.body.effect.join(' ') %> article-type-<%= page.layout %>" itemscope itemprop="blogPost"> <article id="<%= page.layout %>" class="post white-box reveal <%- theme.style.body.effect.join(' ') %> article-type-<%= page.layout %>" itemscope itemprop="blogPost">
<%- partial('_partial/meta',{post:page, position:'header'}) %> <%- partial('_partial/meta',{post:page, position:'header'}) %>
<section class="article article-entry l_friends"> <section class="article article-entry l_friends">
<%- page.excerpt %> <%- page.excerpt %>

@ -5,7 +5,7 @@
<% if (page.layout == 'tag') { %> <% if (page.layout == 'tag') { %>
<section class="post-list <%- theme.layout.multiple_columns ? 'multiple-columns' : '' %>"> <section class="post-list <%- theme.layout.multiple_columns ? 'multiple-columns' : '' %>">
<div class='post-wrapper'> <div class='post-wrapper'>
<article id="archive-page" class="post article white-box <%- theme.style.body.effect.join(' ') %>"> <article id="archive-page" class="post article white-box reveal <%- theme.style.body.effect.join(' ') %>">
<section class="archive"> <section class="archive">
<div class="archive-item archive-year mark"> <div class="archive-item archive-year mark">
<h2><%- page.title %></h2> <h2><%- page.title %></h2>

@ -366,3 +366,7 @@ div.hoverbox
.white-box .white-box
background: $color-card background: $color-card
if hexo-config('plugins.scrollreveal.js')
.reveal
visibility: hidden

Loading…
Cancel
Save