-
-
Notifications
You must be signed in to change notification settings - Fork 69
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #119 from wleelw/dev
v1.4.2
- Loading branch information
Showing
39 changed files
with
664 additions
and
98 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
- const list = theme.keyboard.list || [] | ||
#keyboard-tips | ||
.keyboardTitle= '博客快捷键' | ||
.keyboardList | ||
each item in list | ||
.keyboardItem | ||
.keyGroup | ||
.key= 'Shift' | ||
.key= item.key | ||
.keyContent | ||
.content= item.name | ||
script. | ||
const keyboard_addKeyup = (e) => { | ||
if (e.key === 'Shift') { | ||
document.getElementById('keyboard-tips').classList.remove('show'); | ||
} | ||
} | ||
|
||
const keyboard_addKeydown = (e) => { | ||
const keyboards = !{JSON.stringify(list)}; | ||
if (e.keyCode === 16) { | ||
document.getElementById('keyboard-tips').classList.add('show'); | ||
} | ||
|
||
for (let i = 0; i < keyboards.length; i++) { | ||
if (keyboards[i].url) { | ||
if (keyboards[i].url.startsWith('http')) { | ||
if (e.key === keyboards[i].key) { | ||
window.open(keyboards[i].url); | ||
} | ||
} else { | ||
if (e.key === keyboards[i].key) { | ||
pjax.loadUrl(keyboards[i].url); | ||
} | ||
} | ||
} else if (keyboards[i].sco) { | ||
if (e.key === keyboards[i].key) { | ||
sco[keyboards[i].sco](); | ||
} | ||
} else if (keyboards[i].func) { | ||
if (e.key === keyboards[i].key) { | ||
window[keyboards[i].func](); | ||
} | ||
} | ||
} | ||
} | ||
|
||
function openKeyboard() { | ||
|
||
window.addEventListener('keyup', keyboard_addKeyup); | ||
|
||
window.addEventListener('keydown', keyboard_addKeydown); | ||
} | ||
function closeKeyboard() { | ||
|
||
window.removeEventListener('keyup', keyboard_addKeyup); | ||
|
||
window.removeEventListener('keydown', keyboard_addKeydown); | ||
} | ||
|
||
var sco_keyboards = localStorage.getItem('keyboard') === 'true' | ||
if (sco_keyboards) { | ||
openKeyboard(); | ||
document.getElementById('consoleKeyboard').classList.add('on'); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
include ../widgets/page/banner | ||
|
||
- var gallery = site.data.gallery.gallery | ||
- var album = gallery.find(item => item.album = page.album) | ||
- var {limit} = theme.album | ||
|
||
if album | ||
#album | ||
#sco-container | ||
if album.json | ||
script. | ||
function initGallery() { | ||
let macy = Macy({ container: '#sco-container', trueOrder: false, waitForImages: true, margin: 5, columns: !{limit}, breakAt: { 1200: 5, 940: 3, 520: 2, 400: 1 }}) | ||
macy.runOnImageLoad(function () { | ||
setTimeout(function () { | ||
GLOBAL_CONFIG.lightbox && utils.lightbox(document.querySelectorAll(".sco-gallery-item img")); | ||
macy.recalculate(true) | ||
}, 500); | ||
}, true) | ||
} | ||
(async function () { | ||
await fetch('!{url_for(album.json)}') | ||
.then(res => res.json()) | ||
.then(data => { | ||
let html = '' | ||
data = data.sort((a, b) => b.date - a.date) | ||
data.forEach(item => { | ||
html += ` | ||
<div class="sco-gallery-item"> | ||
<span class="locate">${item.locate}</span> | ||
<img class="sco-gallery-image" src="${item.image}" alt="${item.content}"> | ||
</div> | ||
` | ||
}) | ||
document.querySelector('#sco-container').innerHTML = html | ||
GLOBAL_CONFIG.lazyload.enable && utils.lazyloadImg(); | ||
initGallery() | ||
}) | ||
})() | ||
|
||
else | ||
each item in album.items.sort((a, b) => b.date - a.date) | ||
.sco-gallery-item | ||
span.locate= item.locate | ||
img.sco-gallery-image(src=item.image, alt=item.content) | ||
script. | ||
function initGallery(){ | ||
let macy = Macy({ container: '#sco-container', trueOrder: false, waitForImages: true, margin: 5, columns: !{limit}, breakAt: { 1200: 5, 940: 3, 520: 2, 400: 1 }}) | ||
macy.runOnImageLoad(function () { | ||
setTimeout(function () { | ||
GLOBAL_CONFIG.lightbox && utils.lightbox(document.querySelectorAll(".sco-gallery-item img")); | ||
macy.recalculate(true) | ||
}, 500); | ||
}, true) | ||
} | ||
document.addEventListener('DOMContentLoaded', initGallery); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
include ../widgets/page/banner | ||
|
||
- var gallery = site.data.gallery.gallery | ||
|
||
if theme.album.enable && gallery | ||
#gallery | ||
each item in gallery | ||
.gallery-item(onclick="pjax.loadUrl('/" + item.album + "/')") | ||
img.cover(src=item.cover) | ||
span.title= item.class_name | ||
span.desc= item.descr |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
include ../widgets/page/banner | ||
if theme.moments.angle | ||
include ../widgets/page/moments/angle | ||
|
||
.title-h2-a | ||
.title-h2-a-left | ||
h2(style="padding-top: 0;margin:0.6rem 0 0.6rem;") 🐟 鱼塘 | ||
.title-h2-a-right | ||
span 以下内容自动生成,未经过审核 | ||
|
||
div#hexo-circle-of-friends-root | ||
script. | ||
let UserConfig = { | ||
// 填写你的api地址 | ||
private_api_url: '!{theme.moments.api}', | ||
// 默认加载文章数 | ||
page_init_number: !{theme.moments.page_init_number}, | ||
// 点击加载更多时,一次最多加载几篇文章,默认10 | ||
page_turning_number: !{theme.moments.page_turning_number}, | ||
// 头像加载失败时,默认头像地址 | ||
error_img: '!{theme.moments.error_img}', | ||
// 进入页面时第一次的排序规则 | ||
sort_rule: '!{theme.moments.sort_rule}', | ||
// 本地文章缓存数据过期时间(天) | ||
expire_days: !{theme.moments.expire_days}, | ||
} | ||
script(src=url_for(theme.moments.appjs)) | ||
script(src=url_for(theme.moments.bundlejs)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
.title-h2-a | ||
.title-h2-a-left | ||
h2(style="padding-top: 0;margin:0.6rem 0 0.6rem;") 🎣 钓鱼 | ||
a#random-post-start(href="javascript:fetchRandomPost();", style="transition-duration: 0.3s; transform: rotate(63000deg); opacity: 1;", data-pjax-state="") | ||
i.scoicon.sco-restart-line | ||
.title-h2-a-right | ||
if page.type !== 'links' | ||
a.random-post-all(href="/links/", data-pjax-state="") 全部友链 | ||
|
||
#random-post | ||
|
||
script. | ||
var fdata = { | ||
apiurl: "#{theme.moments.api}", | ||
defaultFish: 100, | ||
hungryFish: 100, | ||
} | ||
|
||
script(src=url_for(theme.moments.randompostjs)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.