Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Velocity motion issues #1185

Merged
merged 4 commits into from
Sep 28, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion layout/_partials/sidebar/site-overview.swig
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
</div>

{%- if theme.site_state %}
<nav class="site-state motion-element">
<div class="site-state-wrap motion-element">
<nav class="site-state">
{%- if config.archive_dir != '/' and site.posts.length > 0 %}
<div class="site-state-item site-state-posts">
{%- if theme.menu.archives %}
Expand Down Expand Up @@ -57,6 +58,7 @@
</div>
{%- endif %}
</nav>
</div>
{%- endif %}

{%- if theme.rss %}
Expand Down
11 changes: 5 additions & 6 deletions layout/_scripts/vendors.swig
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,6 @@
{%- set js_defer_vendors = {} %}
{%- set js_vendors.anime = 'anime.min.js?v=3.1.0' %}

{# Velocity must be loaded before jQuery #}
{%- if theme.motion.enable %}
{%- set js_vendors.velocity = 'velocity/velocity.min.js?v=1.2.1' %}
{%- set js_vendors.velocity_ui = 'velocity/velocity.ui.min.js?v=1.2.1' %}
{%- endif %}

{%- if theme.pjax %}
{%- set js_vendors.pjax = 'pjax/pjax.min.js?v=0.2.8' %}
{%- endif %}
Expand All @@ -29,6 +23,11 @@
{%- set js_vendors.pangu = '//cdn.jsdelivr.net/npm/pangu@4/dist/browser/pangu.min.js' %}
{%- endif %}

{%- if theme.motion.enable %}
{%- set js_vendors.velocity = 'velocity/velocity.min.js?v=1.2.1' %}
{%- set js_vendors.velocity_ui = 'velocity/velocity.ui.min.js?v=1.2.1' %}
{%- endif %}

{%- if theme.three.enable and not theme.three.delay %}
{%- if theme.three.three_waves %}
{%- set js_defer_vendors.three = 'three/three.min.js' %}
Expand Down
4 changes: 2 additions & 2 deletions source/css/_common/components/post/post-collapse.styl
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,7 @@
}

.post-header {
align-items: center;
border-bottom: 1px dashed $grey-light;
display: flex;
margin: 30px 0;
position: relative;
the-transition();
Expand Down Expand Up @@ -87,12 +85,14 @@
}

.post-meta {
display: inline;
font-size: $font-size-smallest;
margin-left: 15px;
margin-right: 10px;
}

.post-title {
display: inline;
font-size: $font-size-medium;
font-weight: normal;
line-height: inherit;
Expand Down
2 changes: 2 additions & 0 deletions source/js/motion.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
/* global NexT, CONFIG, Velocity */

if (window.$ && window.$.Velocity) window.Velocity = window.$.Velocity;

NexT.motion = {};

NexT.motion.integrator = {
Expand Down
7 changes: 1 addition & 6 deletions source/js/schemes/muse.js
Original file line number Diff line number Diff line change
Expand Up @@ -133,15 +133,10 @@ window.addEventListener('DOMContentLoaded', () => {
this.isSidebarVisible = true;
this.sidebarEl.classList.add('sidebar-active');
if (typeof Velocity === 'function') {
Velocity(document.querySelectorAll('.sidebar .motion-element:not(.site-state)'), isRight ? 'transition.slideRightIn' : 'transition.slideLeftIn', {
Velocity(document.querySelectorAll('.sidebar .motion-element'), isRight ? 'transition.slideRightIn' : 'transition.slideLeftIn', {
stagger: 50,
drag : true
});
Velocity(document.querySelector('.site-state'), isRight ? 'transition.slideRightIn' : 'transition.slideLeftIn', {
stagger: 50,
drag : true,
display: 'flex'
});
}

sidebarToggleLines.close();
Expand Down