-
Notifications
You must be signed in to change notification settings - Fork 0
/
hexo-theme-next+8.20.0.patch
124 lines (119 loc) · 5.24 KB
/
hexo-theme-next+8.20.0.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
diff --git a/node_modules/hexo-theme-next/layout/_partials/footer.njk b/node_modules/hexo-theme-next/layout/_partials/footer.njk
index cffc669..52a6277 100644
--- a/node_modules/hexo-theme-next/layout/_partials/footer.njk
+++ b/node_modules/hexo-theme-next/layout/_partials/footer.njk
@@ -13,7 +13,7 @@
{%- if theme.footer.copyright !== false %}
<div class="copyright">
{%- set copyright_year = date(null, 'YYYY') %}
- © {% if theme.footer.since and theme.footer.since != copyright_year %}{{ theme.footer.since }} – {% endif %}
+ <span class="copyright-to-rotate">©</span> {% if theme.footer.since and theme.footer.since != copyright_year %}{{ theme.footer.since }} – {% endif %}
<span itemprop="copyrightYear">{{ copyright_year }}</span>
<span class="with-love">
<i class="{{ theme.footer.icon.name }}"></i>
diff --git a/node_modules/hexo-theme-next/layout/_partials/widgets.njk b/node_modules/hexo-theme-next/layout/_partials/widgets.njk
index b312d0a..a09eec2 100644
--- a/node_modules/hexo-theme-next/layout/_partials/widgets.njk
+++ b/node_modules/hexo-theme-next/layout/_partials/widgets.njk
@@ -7,12 +7,16 @@
<span class="toggle-line"></span>
</div>
<div class="sidebar-dimmer"></div>
+ <div class="sidebar-hotkey-info">
+ <code>C-d</code>
+ </div>
{%- endif %}
{%- if theme.back2top.enable and not theme.back2top.sidebar %}
<div class="back-to-top" role="button" aria-label="{{ __('accessibility.back_to_top') }}">
<i class="fa fa-arrow-up fa-lg"></i>
<span>0%</span>
+ <span><code>M-a</code></span>
</div>
{%- endif %}
diff --git a/node_modules/hexo-theme-next/source/css/_common/outline/sidebar/sidebar-toggle.styl b/node_modules/hexo-theme-next/source/css/_common/outline/sidebar/sidebar-toggle.styl
index 2b5273d..ef07d06 100644
--- a/node_modules/hexo-theme-next/source/css/_common/outline/sidebar/sidebar-toggle.styl
+++ b/node_modules/hexo-theme-next/source/css/_common/outline/sidebar/sidebar-toggle.styl
@@ -19,3 +19,15 @@
.sidebar-active .sidebar-toggle {
toggle-close($sidebar-toggle-alignment);
}
+
+.sidebar-hotkey-info {
+ display: inline-flex;
+ text-align: center;
+ bottom: 61px;
+ left: 60px;
+ height: 26px;
+ width: 36px;
+ opacity: 0.8;
+ position: fixed;
+ z-index: 30;
+}
diff --git a/node_modules/hexo-theme-next/source/js/sidebar.js b/node_modules/hexo-theme-next/source/js/sidebar.js
index 6ab3c6b..ba5b3dd 100644
--- a/node_modules/hexo-theme-next/source/js/sidebar.js
+++ b/node_modules/hexo-theme-next/source/js/sidebar.js
@@ -11,6 +11,12 @@ document.addEventListener('DOMContentLoaded', () => {
window.addEventListener('mouseup', this.mouseupHandler.bind(this));
document.querySelector('.sidebar-dimmer').addEventListener('click', this.clickHandler.bind(this));
document.querySelector('.sidebar-toggle').addEventListener('click', this.clickHandler.bind(this));
+ document.addEventListener('keydown', (event) => {
+ if (event.ctrlKey && event.key === 'd') {
+ event.preventDefault();
+ this.clickHandler.bind(this)();
+ }
+ });
window.addEventListener('sidebar:show', this.showSidebar);
window.addEventListener('sidebar:hide', this.hideSidebar);
},
diff --git a/node_modules/hexo-theme-next/source/js/third-party/search/local-search.js b/node_modules/hexo-theme-next/source/js/third-party/search/local-search.js
index 92a264d..a04f649 100644
--- a/node_modules/hexo-theme-next/source/js/third-party/search/local-search.js
+++ b/node_modules/hexo-theme-next/source/js/third-party/search/local-search.js
@@ -67,13 +67,20 @@ document.addEventListener('DOMContentLoaded', () => {
window.addEventListener('search:loaded', inputEventFunction);
// Handle and trigger popup window
+ function searchPopupClick() {
+ document.body.classList.add('search-active');
+ // Wait for search-popup animation to complete
+ setTimeout(() => input.focus(), 500);
+ if (!localSearch.isfetched) localSearch.fetchData();
+ }
document.querySelectorAll('.popup-trigger').forEach(element => {
- element.addEventListener('click', () => {
- document.body.classList.add('search-active');
- // Wait for search-popup animation to complete
- setTimeout(() => input.focus(), 500);
- if (!localSearch.isfetched) localSearch.fetchData();
- });
+ element.addEventListener('click', searchPopupClick);
+ });
+ document.addEventListener('keydown', (event) => {
+ if (!document.body.classList.contains('search-active') && event.ctrlKey && event.key === 's') {
+ event.preventDefault();
+ searchPopupClick();
+ }
});
// Monitor main search box
diff --git a/node_modules/hexo-theme-next/source/js/utils.js b/node_modules/hexo-theme-next/source/js/utils.js
index ebd8552..22d9f13 100644
--- a/node_modules/hexo-theme-next/source/js/utils.js
+++ b/node_modules/hexo-theme-next/source/js/utils.js
@@ -199,6 +199,17 @@ NexT.utils = {
scrollTop: 0
});
});
+ document.addEventListener('keydown', (event) => {
+ if (event.altKey && event.key === 'a') {
+ event.preventDefault();
+ window.anime({
+ targets : document.scrollingElement,
+ duration : 200,
+ easing : 'linear',
+ scrollTop: 0
+ });
+ }
+ });
},
/**