mirror of
https://ghfast.top/https://github.com/zsjy/halo-theme-dream2.0-plus.git
synced 2025-03-15 13:09:40 +08:00
定义主题为plus版,发行1.0.0版本
This commit is contained in:
parent
ad43051ccb
commit
8bdfb33a03
@ -14,6 +14,10 @@
|
||||
|
||||
本仓库为 `Halo 2.x` 主题仓库,如果你使用的是 `Halo 1.x` ,请前往:https://github.com/nineya/halo-theme-dream
|
||||
|
||||
## Plus版,包含一些原仓库未合并的功能
|
||||
- https://www.sw0.top/docs/halo-theme-dream2.0
|
||||
- 最低要求:**Halo 2.6.0**
|
||||
|
||||
## 一、预览
|
||||
|
||||

|
||||
@ -21,9 +25,6 @@
|
||||
预览:[主题预览](https://github.com/nineya/halo-theme-dream/discussions/72)
|
||||
> 如果你有计划长期使用 `Dream` 主题,也来[这里](https://github.com/nineya/halo-theme-dream/discussions/72)留下你的博客链接吧。
|
||||
|
||||
## 预览版,独立作者未同意合并的部分功能
|
||||
- https://www.sw0.top/docs/halo-theme-dream2.0
|
||||
|
||||
|
||||
## 二、说明
|
||||
|
||||
@ -44,7 +45,7 @@
|
||||
|
||||
| 主题版本 | 适配Halo版本 | 测试用Halo版本 |
|
||||
| ----------- | --------------------------- | -------------- |
|
||||
| 1.x | 2.0.0+ | 2.3.0 |
|
||||
| x.x | 2.6.0+ | 2.13.1 |
|
||||
|
||||
|
||||
|
||||
|
@ -125,7 +125,7 @@ task('js', () => {
|
||||
task('zip', () => {
|
||||
const target = ['./templates/**', './*.yaml', 'README.md', 'LICENSE']
|
||||
return src(target, {base: '.'})
|
||||
.pipe(zip('halo-theme-dream2.0.zip'))
|
||||
.pipe(zip('halo-theme-dream2.0-plus.zip'))
|
||||
.pipe(dest(distPath))
|
||||
})
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "halo-theme-dream2.0",
|
||||
"version": "1.3.1.4",
|
||||
"name": "halo-theme-dream2.0-plus",
|
||||
"version": "1.0.0",
|
||||
"description": "梦之城,童话梦境,动漫类型博客主题。",
|
||||
"main": "index.js",
|
||||
"author": "nineya",
|
||||
|
@ -77,11 +77,6 @@ const commonContext = {
|
||||
// 配色方案
|
||||
$('html').addClass('color-scheme-light').removeClass('color-scheme-dark').removeClass('night')
|
||||
}
|
||||
// $('.comment-section>div').each(function () {
|
||||
// const shadowDom = this.shadowRoot.querySelectorAll('.halo-comment-widget')[0]
|
||||
// $(shadowDom)[`${isNightValue ? 'add' : 'remove'}Class`]('dark')
|
||||
// $(shadowDom)[`${isNightValue ? 'remove' : 'add'}Class`]('light')
|
||||
// })
|
||||
localStorage.setItem('night', isNightValue)
|
||||
isNight = isNightValue
|
||||
}
|
||||
@ -391,16 +386,15 @@ const commonContext = {
|
||||
return
|
||||
}
|
||||
const websiteDate = document.getElementById('websiteDate')
|
||||
// if (!/^\d{4}\/\d{2}\/\d{2} \d{2}:\d{2}:\d{2}$/.test(DreamConfig.website_time)) {
|
||||
// websiteDate.innerText = DreamConfig.website_time
|
||||
// return
|
||||
// }
|
||||
if (DreamConfig.website_time === '') {
|
||||
return
|
||||
}
|
||||
const now = new Date()
|
||||
const grt = new Date(DreamConfig.website_time)
|
||||
setInterval(function () {
|
||||
if(!websiteTimeTime) {
|
||||
clearInterval(websiteTimeTime)
|
||||
}
|
||||
websiteTimeTime = setInterval(function () {
|
||||
now.setTime(now.getTime() + 1000)
|
||||
let difference = parseInt((now - grt) / 1000)
|
||||
let seconds = difference % 60
|
||||
@ -445,6 +439,9 @@ const commonContext = {
|
||||
if (!$('.timelife').length) {
|
||||
return
|
||||
}
|
||||
if(timeLifeHour === new Date().getHours()) {
|
||||
return
|
||||
}
|
||||
let timelife = [
|
||||
{
|
||||
title: '今日已经过去',
|
||||
@ -475,6 +472,7 @@ const commonContext = {
|
||||
let nowDate = +new Date()
|
||||
let todayStartDate = new Date(new Date().toLocaleDateString()).getTime()
|
||||
let todayPassHours = (nowDate - todayStartDate) / 1000 / 60 / 60
|
||||
timeLifeHour = todayPassHours
|
||||
let todayPassHoursPercent = (todayPassHours / 24) * 100
|
||||
timelife[0].num = parseInt(todayPassHours)
|
||||
timelife[0].percent = parseInt(todayPassHoursPercent) + '%'
|
||||
@ -541,26 +539,6 @@ const commonContext = {
|
||||
}
|
||||
}
|
||||
},
|
||||
// /* 初始化评论区 */
|
||||
// initComment() {
|
||||
// if (!window.CommentWidget) {
|
||||
// return
|
||||
// }
|
||||
// $('.comment-section').each(function (index, item) {
|
||||
// let target = $(this).attr('data-target')
|
||||
// let id = $(this).attr('data-id')
|
||||
// CommentWidget.init(
|
||||
// `.comment-section[data-id='${id}'][data-target='${target}']`,
|
||||
// '/plugins/PluginCommentWidget/assets/static/style.css',
|
||||
// {
|
||||
// group: target === 'Moment' ? 'moment.halo.run' : 'content.halo.run',
|
||||
// kind: target,
|
||||
// name: id,
|
||||
// colorScheme: (localStorage.getItem('night') !== 'true' ? 'light' : 'dark')
|
||||
// }
|
||||
// )
|
||||
// })
|
||||
// },
|
||||
/* 初始化特效,只需要初始化一次,移动端设备不初始化 */
|
||||
initEffects() {
|
||||
if (Utils.isMobile()) return
|
||||
@ -589,19 +567,15 @@ const commonContext = {
|
||||
keep: false //鼠标移出组件后是否继续随鼠标滚动, 取值: false, true(默认) 对应 减速至初速度滚动, 随鼠标滚动
|
||||
})
|
||||
},
|
||||
// /* 加载主动推送、统计脚本等参数 */
|
||||
// loadMaintain() {
|
||||
// DreamConfig.enable_baidu_push && Utils.baiduPush()
|
||||
// DreamConfig.enable_toutiao_push && Utils.toutiaoPush()
|
||||
// },
|
||||
/* 显示主题版本信息 */
|
||||
showThemeVersion() {
|
||||
window.logger(`%c页面加载耗时:${Math.round(performance.now())}ms | Theme By Dream ${DreamConfig.theme_version}`,
|
||||
window.logger(`%c页面加载耗时:${Math.round(performance.now())}ms | Theme By Dream2 Plus ${DreamConfig.theme_version}`,
|
||||
'color:#fff; background: linear-gradient(270deg, #986fee, #8695e6, #68b7dd, #18d7d3); padding: 8px 15px; border-radius: 0 15px 0 15px')
|
||||
}
|
||||
}
|
||||
|
||||
window.commonContext = commonContext
|
||||
let websiteTimeTime, timeLifeHour = -1
|
||||
|
||||
!(function () {
|
||||
const loads = ['initCarousel', 'sparkInput', 'websiteTime']
|
||||
|
@ -138,13 +138,17 @@
|
||||
* @returns {DProgress|*}
|
||||
*/
|
||||
DProgress.done = function() {
|
||||
DProgress.inc(0.3 + 0.5 * Math.random()).set(1)
|
||||
try {
|
||||
DProgress.inc(0.3 + 0.5 * Math.random()).set(1)
|
||||
|
||||
setTimeout(function() {
|
||||
$('#dprogress').hide()
|
||||
DProgress.status = undefined
|
||||
}, Settings.speed)
|
||||
return this
|
||||
setTimeout(function() {
|
||||
$('#dprogress').hide()
|
||||
DProgress.status = undefined
|
||||
}, Settings.speed)
|
||||
return this
|
||||
} catch (e) {
|
||||
return this
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -171,12 +171,12 @@ $(document).on('pjax:success', async function (event, data, status, xhr, options
|
||||
window.journalPjax && window.journalPjax(serialNumber)
|
||||
/* 初始化文章界面 */
|
||||
window.postPjax && window.postPjax(serialNumber)
|
||||
// /* 初始化评论 */
|
||||
// commonContext.initComment()
|
||||
/* 刷新人生倒计时 */
|
||||
commonContext.initTimeCount()
|
||||
/* 刷新建站时间及计时器 */
|
||||
commonContext.websiteTime()
|
||||
/* 初始化轮播 */
|
||||
commonContext.initCarousel()
|
||||
// /* 加载主动推送或统计脚本 */
|
||||
// commonContext.loadMaintain()
|
||||
window.DProgress && DProgress.done()
|
||||
})
|
||||
|
||||
@ -207,6 +207,10 @@ $(document).on('pjax:end', function (event, xhr, options) {
|
||||
initPjax()
|
||||
/* 初始化轮播 */
|
||||
commonContext.initCarousel()
|
||||
/* 刷新人生倒计时 */
|
||||
commonContext.initTimeCount()
|
||||
/* 刷新建站时间及计时器 */
|
||||
commonContext.websiteTime()
|
||||
window.DProgress && DProgress.done()
|
||||
// 应该是由于浏览器缓存失效,有时候浏览器前后退还是会执行pjax:beforeSend
|
||||
$('html').removeClass('pjax-loading')
|
||||
|
@ -76,6 +76,7 @@ window.tagcloud = (function (win, doc) { // ns
|
||||
self.box.style.overflow = 'hidden'
|
||||
self.box.style.margin = '0'
|
||||
self.box.style.padding = '0'
|
||||
self.box.style.whiteSpace = 'nowrap'
|
||||
self.box.style.minHeight = (1.2 * self.size < 220 ? 220 : 1.2 * self.size) + 'px'
|
||||
self.box.style.minWidth = 'auto'
|
||||
for (var j2 = 0, len2 = self.items.length; j2 < len2; j2++) {
|
||||
|
4
templates/assets/js/common.min.js
vendored
4
templates/assets/js/common.min.js
vendored
File diff suppressed because one or more lines are too long
2
templates/assets/js/dprogress.min.js
vendored
2
templates/assets/js/dprogress.min.js
vendored
@ -1 +1 @@
|
||||
!function(){var n={},s=n.settings={minimum:.08,easing:"linear",speed:400,trickle:!0,trickleSpeed:200,parent:"body",template:'<div class="bar"></div>'};function i(t,e,r){return t<e?e:r<t?r:t}n.configure=function(t){var e,r;for(e in t)void 0!==(r=t[e])&&t.hasOwnProperty(e)&&(s[e]=r);return this},n.status=null,n.start=function(){n.status||n.set(0),$("#dprogress").show();var t=function(){setTimeout(function(){n.status&&1!==n.status&&(n.trickle(),t())},s.trickleSpeed)};return s.trickle&&t(),this},n.trickle=function(){return n.inc()},n.inc=function(t){var e=n.status;return e?1<=e?void 0:(e=i(e+(t="number"!=typeof t?0<=e&&e<.2?.1:.2<=e&&e<.5?.04:.5<=e&&e<.8?.02:.8<=e&&e<.98?.005:0:t),0,.98),n.set(e)):n.start()},n.set=function(t){n.status=i(t,s.minimum,1);var e,r=document.getElementById("dprogress");return r||((r=document.createElement("div")).id="dprogress",r.innerHTML=s.template,(e=$(r.querySelector(".bar"))).css("transition",`all ${s.speed}ms `+s.easing),"center"===DreamConfig.load_progress&&e.css("margin","auto"),$(s.parent).prepend(r)),r.querySelector(".bar").style.width=100*t+"%",this},n.isStarted=function(){return"number"==typeof n.status},n.done=function(){return n.inc(.3+.5*Math.random()).set(1),setTimeout(function(){$("#dprogress").hide(),n.status=void 0},s.speed),this},n.isRendered=function(){return!!document.getElementById("dprogress")},window.DProgress=n}();
|
||||
!function(){var n={},s=n.settings={minimum:.08,easing:"linear",speed:400,trickle:!0,trickleSpeed:200,parent:"body",template:'<div class="bar"></div>'};function i(t,e,r){return t<e?e:r<t?r:t}n.configure=function(t){var e,r;for(e in t)void 0!==(r=t[e])&&t.hasOwnProperty(e)&&(s[e]=r);return this},n.status=null,n.start=function(){n.status||n.set(0),$("#dprogress").show();var t=function(){setTimeout(function(){n.status&&1!==n.status&&(n.trickle(),t())},s.trickleSpeed)};return s.trickle&&t(),this},n.trickle=function(){return n.inc()},n.inc=function(t){var e=n.status;return e?1<=e?void 0:(e=i(e+(t="number"!=typeof t?0<=e&&e<.2?.1:.2<=e&&e<.5?.04:.5<=e&&e<.8?.02:.8<=e&&e<.98?.005:0:t),0,.98),n.set(e)):n.start()},n.set=function(t){n.status=i(t,s.minimum,1);var e,r=document.getElementById("dprogress");return r||((r=document.createElement("div")).id="dprogress",r.innerHTML=s.template,(e=$(r.querySelector(".bar"))).css("transition",`all ${s.speed}ms `+s.easing),"center"===DreamConfig.load_progress&&e.css("margin","auto"),$(s.parent).prepend(r)),r.querySelector(".bar").style.width=100*t+"%",this},n.isStarted=function(){return"number"==typeof n.status},n.done=function(){try{return n.inc(.3+.5*Math.random()).set(1),setTimeout(function(){$("#dprogress").hide(),n.status=void 0},s.speed),this}catch(t){return this}},n.isRendered=function(){return!!document.getElementById("dprogress")},window.DProgress=n}();
|
2
templates/assets/js/pjax.min.js
vendored
2
templates/assets/js/pjax.min.js
vendored
@ -1 +1 @@
|
||||
(()=>{const l=new Set($('link[href*=".css"]').map((o,e)=>$(e).attr("href")).get()),c=new Set($('script[src*=".js"]').map((o,e)=>$(e).attr("src")).get()),e=()=>{var o=(new Date).getTime();return window.pjaxSerialNumber=o,console.log("sn = "+o),o},i=(e,n,t)=>{if(n>=e.length)t&&t();else{let o=$(e[n]).attr("src");c.has(o)?i(e,n+1,t):(console.log((t?"同步":"异步")+"顺序加载js "+o),Utils.cachedScript(o).done(function(){console.log((t?"同步":"异步")+"顺序加载js完成 "+o),c.add(o),window.DProgress&&DProgress.inc(),i(e,n+1,t)}).fail(function(){console.log((t?"同步":"异步")+"顺序加载js失败 "+o),i(e,n+1,t)}))}};$(document).on("click","a[target!=_blank][href]:not(data-not-pjax)",o=>{$.pjax.click(o,".column-main",{scrollTo:"/"!==o.currentTarget.pathname&&0!==$(".banner").length?(window.initTop=99999999,window.innerHeight/4):0,fragment:".column-main",serialNumber:e(),timeout:8e3})}),$(document).on("submit","form[data-pjax]",function(o){$.pjax.submit(o,".column-main",{scrollTo:0,fragment:".column-main",serialNumber:e(),timeout:8e3})}),$(document).on("pjax:click",function(o,e){console.log("------------------------"),console.log("pjax:click sn = "+e.serialNumber)}),$(document).on("pjax:beforeSend",function(o,e,n){console.log("pjax:beforeSend sn = "+n.serialNumber),$("html").addClass("pjax-loading")}),$(document).on("pjax:start",function(o,e,n){console.log("pjax:start sn = "+n.serialNumber),window.DProgress&&DProgress.start(),$(".pjax-close").remove()}),$(document).on("pjax:send",function(o,e,n){console.log("pjax:send sn = "+n.serialNumber)}),$(document).on("pjax:clicked",function(o,e){console.log("pjax:clicked sn = "+e.serialNumber)}),$(document).on("pjax:beforeReplace",function(o,e,n){console.log("pjax:beforeReplace sn = "+n.serialNumber),$(".navbar-nav .current,.panel-side-menu .current").removeClass("current"),commonContext.initNavbar(),0<$("html.disable-scroll").length&&$(".navbar-mask").trigger("click")}),$(document).on("pjax:success",async function(o,e,n,t,s){s=s.serialNumber;if(console.log("pjax:success sn = "+s),window.pjaxSerialNumber===s){commonContext.initGallery(),commonContext.initTocAndNotice(),$("html").removeClass("pjax-loading");const a=$($.parseHTML(e,document,!0)),r=$("head");r.find("meta").remove(),r.append(a.filter("meta")),a.filter("link[data-pjax]").each(function(){let o=$(this).attr("href");l.has(o)||(r.append($(this)),console.log("加载css "+$(this).attr("href")),this.onload=function(){l.add(o),window.DProgress&&DProgress.inc(),console.log("加载css完成 "+$(this).attr("href"))})});let o=a.filter("script[data-pjax]");if(0<o.length){o.filter("[async]").each(function(){let o=$(this).attr("src");c.has(o)||(console.log("异步无序加载js "+o),Utils.cachedScript(o).done(function(){console.log("异步无序js完成 "+o),window.DProgress&&DProgress.inc(),c.add(o)}).fail(function(){console.log("异步无序js失败 "+o)}))}),new Promise(()=>{i(o.filter("[defer]"),0)});let e=o.filter(":not([async]):not([defer])");0<e.length&&await new Promise(o=>{i(e,0,o)})}console.log("全部处理完成"),window.pjaxSerialNumber===s&&(window.journalPjax&&window.journalPjax(s),window.postPjax&&window.postPjax(s),commonContext.initCarousel(),window.DProgress)&&DProgress.done()}}),$(document).on("pjax:timeout",function(o,e,n){console.log("pjax:timeout sn = "+n.serialNumber)}),$(document).on("pjax:error",function(o,e,n,t,s){console.log(`pjax:error sn = ${s.serialNumber} error `+t)}),$(document).on("pjax:complete",function(o,e,n,t){console.log("pjax:complete sn = "+t.serialNumber)}),$(document).on("pjax:end",function(o,e,n){console.log("pjax:end sn = "+n.serialNumber),null==e&&(commonContext.initTocAndNotice(),commonContext.initCarousel(),window.DProgress&&DProgress.done(),$("html").removeClass("pjax-loading"))}),$(document).on("pjax:popstate",function(){console.log("pjax:popstate")})})();
|
||||
(()=>{const i=new Set($('link[href*=".css"]').map((o,e)=>$(e).attr("href")).get()),c=new Set($('script[src*=".js"]').map((o,e)=>$(e).attr("src")).get()),e=()=>{var o=(new Date).getTime();return window.pjaxSerialNumber=o,console.log("sn = "+o),o},l=(e,n,t)=>{if(n>=e.length)t&&t();else{let o=$(e[n]).attr("src");c.has(o)?l(e,n+1,t):(console.log((t?"同步":"异步")+"顺序加载js "+o),Utils.cachedScript(o).done(function(){console.log((t?"同步":"异步")+"顺序加载js完成 "+o),c.add(o),window.DProgress&&DProgress.inc(),l(e,n+1,t)}).fail(function(){console.log((t?"同步":"异步")+"顺序加载js失败 "+o),l(e,n+1,t)}))}};$(document).on("click","a[target!=_blank][href]:not(data-not-pjax)",o=>{$.pjax.click(o,".column-main",{scrollTo:"/"!==o.currentTarget.pathname&&0!==$(".banner").length?(window.initTop=99999999,window.innerHeight/4):0,fragment:".column-main",serialNumber:e(),timeout:8e3})}),$(document).on("submit","form[data-pjax]",function(o){$.pjax.submit(o,".column-main",{scrollTo:0,fragment:".column-main",serialNumber:e(),timeout:8e3})}),$(document).on("pjax:click",function(o,e){console.log("------------------------"),console.log("pjax:click sn = "+e.serialNumber)}),$(document).on("pjax:beforeSend",function(o,e,n){console.log("pjax:beforeSend sn = "+n.serialNumber),$("html").addClass("pjax-loading")}),$(document).on("pjax:start",function(o,e,n){console.log("pjax:start sn = "+n.serialNumber),window.DProgress&&DProgress.start(),$(".pjax-close").remove()}),$(document).on("pjax:send",function(o,e,n){console.log("pjax:send sn = "+n.serialNumber)}),$(document).on("pjax:clicked",function(o,e){console.log("pjax:clicked sn = "+e.serialNumber)}),$(document).on("pjax:beforeReplace",function(o,e,n){console.log("pjax:beforeReplace sn = "+n.serialNumber),$(".navbar-nav .current,.panel-side-menu .current").removeClass("current"),commonContext.initNavbar(),0<$("html.disable-scroll").length&&$(".navbar-mask").trigger("click")}),$(document).on("pjax:success",async function(o,e,n,t,s){s=s.serialNumber;if(console.log("pjax:success sn = "+s),window.pjaxSerialNumber===s){commonContext.initGallery(),commonContext.initTocAndNotice(),$("html").removeClass("pjax-loading");const a=$($.parseHTML(e,document,!0)),r=$("head");r.find("meta").remove(),r.append(a.filter("meta")),a.filter("link[data-pjax]").each(function(){let o=$(this).attr("href");i.has(o)||(r.append($(this)),console.log("加载css "+$(this).attr("href")),this.onload=function(){i.add(o),window.DProgress&&DProgress.inc(),console.log("加载css完成 "+$(this).attr("href"))})});let o=a.filter("script[data-pjax]");if(0<o.length){o.filter("[async]").each(function(){let o=$(this).attr("src");c.has(o)||(console.log("异步无序加载js "+o),Utils.cachedScript(o).done(function(){console.log("异步无序js完成 "+o),window.DProgress&&DProgress.inc(),c.add(o)}).fail(function(){console.log("异步无序js失败 "+o)}))}),new Promise(()=>{l(o.filter("[defer]"),0)});let e=o.filter(":not([async]):not([defer])");0<e.length&&await new Promise(o=>{l(e,0,o)})}console.log("全部处理完成"),window.pjaxSerialNumber===s&&(window.journalPjax&&window.journalPjax(s),window.postPjax&&window.postPjax(s),commonContext.initTimeCount(),commonContext.websiteTime(),commonContext.initCarousel(),window.DProgress)&&DProgress.done()}}),$(document).on("pjax:timeout",function(o,e,n){console.log("pjax:timeout sn = "+n.serialNumber)}),$(document).on("pjax:error",function(o,e,n,t,s){console.log(`pjax:error sn = ${s.serialNumber} error `+t)}),$(document).on("pjax:complete",function(o,e,n,t){console.log("pjax:complete sn = "+t.serialNumber)}),$(document).on("pjax:end",function(o,e,n){console.log("pjax:end sn = "+n.serialNumber),null==e&&(commonContext.initTocAndNotice(),commonContext.initCarousel(),commonContext.initTimeCount(),commonContext.websiteTime(),window.DProgress&&DProgress.done(),$("html").removeClass("pjax-loading"))}),$(document).on("pjax:popstate",function(){console.log("pjax:popstate")})})();
|
2
templates/assets/js/tagcloud.min.js
vendored
2
templates/assets/js/tagcloud.min.js
vendored
@ -1 +1 @@
|
||||
window.tagcloud=function(a,l){function u(e){var s=this;s.config=u._getConfig(e),s.box=s.config.element,s.fontsize=s.config.fontsize,s.radius=s.config.radius,s.depth=2*s.radius,s.size=2*s.radius,s.mspeed=u._getMsSpeed(s.config.mspeed),s.ispeed=u._getIsSpeed(s.config.ispeed),s.items=s._getItems(),s.direction=s.config.direction,s.keep=s.config.keep,s.active=!1,s.lasta=1,s.lastb=1,s.mouseX0=s.ispeed*Math.sin(s.direction*Math.PI/180),s.mouseY0=-s.ispeed*Math.cos(s.direction*Math.PI/180),s.mouseX=s.mouseX0,s.mouseY=s.mouseY0,s.index=-1,u._on(s.box,"mouseover",function(){s.active=!0}),u._on(s.box,"mouseout",function(){s.active=!1}),u._on(s.keep?a:s.box,"mousemove",function(e){var e=a.event||e,t=s.box.getBoundingClientRect();s.mouseX=(e.clientX-(t.left+s.box.offsetWidth/2))/5,s.mouseY=(e.clientY-(t.top+s.box.offsetHeight/2))/5});for(var t=0,i=s.items.length;t<i;t++)s.items[t].element.index=t,s.items[t].element.onmouseover=function(){s.index=this.index},s.items[t].element.onmouseout=function(){s.index=-1};u.boxs.push(s.box),s.update(s),s.box.style.visibility="visible",s.box.style.position="relative",s.box.style.overflow="hidden",s.box.style.margin="0",s.box.style.padding="0",s.box.style.minHeight=(1.2*s.size<220?220:1.2*s.size)+"px",s.box.style.minWidth="auto";for(var o=0,n=s.items.length;o<n;o++)s.items[o].element.style.position="absolute",s.items[o].element.style.zIndex=o+1;s.up=setInterval(function(){s.update(s)},30)}return u.boxs=[],u._set=function(e){if(-1===u.boxs.indexOf(e))return!0},Array.prototype.indexOf||(Array.prototype.indexOf=function(e){var t=this.length>>>0,s=Number(arguments[1])||0;for((s=s<0?Math.ceil(s):Math.floor(s))<0&&(s+=t);s<t;s++)if(s in this&&this[s]===e)return s;return-1}),u._getConfig=function(e){var t={fontsize:16,radius:60,mspeed:"normal",ispeed:"normal",direction:135,keep:!0};if("[object Object]"===Object.prototype.toString.call(e))for(var s in e)Object.prototype.hasOwnProperty.call(e,s)&&(t[s]=e[s]);return t},u._getMsSpeed=function(e){return{slow:1.5,normal:3,fast:5}[e]||3},u._getIsSpeed=function(e){return{slow:10,normal:25,fast:50}[e]||25},u._getSc=function(e,t){var s=Math.PI/180;return[Math.sin(e*s),Math.cos(e*s),Math.sin(t*s),Math.cos(t*s)]},u._on=function(e,t,s,i){e.addEventListener?e.addEventListener(t,s,i):e.attachEvent?e.attachEvent("on"+t,s):e["on"+t]=s},u.prototype={constructor:u,update:function(){var e,t,s=this;if(s.active||s.keep||(s.mouseX=Math.abs(s.mouseX-s.mouseX0)<1?s.mouseX0:(s.mouseX+s.mouseX0)/2,s.mouseY=Math.abs(s.mouseY-s.mouseY0)<1?s.mouseY0:(s.mouseY+s.mouseY0)/2),e=-Math.min(Math.max(-s.mouseY,-s.size),s.size)/s.radius*s.mspeed,t=Math.min(Math.max(-s.mouseX,-s.size),s.size)/s.radius*s.mspeed,!(Math.abs(e)<=.01&&Math.abs(t)<=.01)){s.lasta=e,s.lastb=t;for(var i=u._getSc(e,t),o=0,n=s.items.length;o<n;o++){var a=s.items[o].x,l=s.items[o].y*i[1]+s.items[o].z*-i[0],m=s.items[o].y*i[0]+s.items[o].z*i[1],r=a*i[3]+m*i[2],m=m*i[3]-a*i[2];s.index===o?(s.items[o].scale=1,s.items[o].fontsize=16,s.items[o].alpha=1,s.items[o].element.style.zIndex=99):(a=s.depth/(s.depth+m),s.items[o].x=r,s.items[o].y=l,s.items[o].z=m,s.items[o].scale=a,s.items[o].fontsize=Math.ceil(2*a)+s.fontsize-6,s.items[o].alpha=1.5*a-.5,s.items[o].element.style.zIndex=Math.ceil(10*a-5)),s.items[o].element.style.fontSize=s.items[o].fontsize+"px",s.items[o].element.style.left=s.items[o].x+(s.box.offsetWidth-s.items[o].offsetWidth)/2+"px",s.items[o].element.style.top=s.items[o].y+(s.box.offsetHeight-s.items[o].offsetHeight)/2+"px",s.items[o].element.style.filter="alpha(opacity="+100*s.items[o].alpha+")",s.items[o].element.style.opacity=s.items[o].alpha}}},_getItems:function(){for(var e,t=this,s=[],i=t.box.children,o=i.length,n=0;n<o;n++)(e={}).angle={},e.angle.phi=Math.acos((2*n+1)/o-1),e.angle.theta=Math.sqrt((o+1)*Math.PI)*e.angle.phi,e.element=i[n],e.offsetWidth=e.element.offsetWidth,e.offsetHeight=e.element.offsetHeight,e.x=1.5*t.radius*Math.cos(e.angle.theta)*Math.sin(e.angle.phi),e.y=1.5*t.radius*Math.sin(e.angle.theta)*Math.sin(e.angle.phi),e.z=1.5*t.radius*Math.cos(e.angle.phi),e.element.style.left=e.x+(t.box.offsetWidth-e.offsetWidth)/2+"px",e.element.style.top=e.y+(t.box.offsetHeight-e.offsetHeight)/2+"px",s.push(e);return s}},l.querySelectorAll||(l.querySelectorAll=function(e){var t,s=l.createElement("style"),i=[];for(l.documentElement.firstChild.appendChild(s),l._qsa=[],s.styleSheet.cssText=e+"{x-qsa:expression(document._qsa && document._qsa.push(this))}",window.scrollBy(0,0),s.parentNode.removeChild(s);l._qsa.length;)(t=l._qsa.shift()).style.removeAttribute("x-qsa"),i.push(t);return l._qsa=null,i}),function(e){for(var t=(e=e||{}).selector||".tagcloud",s=l.querySelectorAll(t),i=[],o=0,n=s.length;o<n;o++)e.element=s[o],u._set(e.element)&&i.push(new u(e));return i}}(window,document);
|
||||
window.tagcloud=function(a,l){function u(e){var s=this;s.config=u._getConfig(e),s.box=s.config.element,s.fontsize=s.config.fontsize,s.radius=s.config.radius,s.depth=2*s.radius,s.size=2*s.radius,s.mspeed=u._getMsSpeed(s.config.mspeed),s.ispeed=u._getIsSpeed(s.config.ispeed),s.items=s._getItems(),s.direction=s.config.direction,s.keep=s.config.keep,s.active=!1,s.lasta=1,s.lastb=1,s.mouseX0=s.ispeed*Math.sin(s.direction*Math.PI/180),s.mouseY0=-s.ispeed*Math.cos(s.direction*Math.PI/180),s.mouseX=s.mouseX0,s.mouseY=s.mouseY0,s.index=-1,u._on(s.box,"mouseover",function(){s.active=!0}),u._on(s.box,"mouseout",function(){s.active=!1}),u._on(s.keep?a:s.box,"mousemove",function(e){var e=a.event||e,t=s.box.getBoundingClientRect();s.mouseX=(e.clientX-(t.left+s.box.offsetWidth/2))/5,s.mouseY=(e.clientY-(t.top+s.box.offsetHeight/2))/5});for(var t=0,i=s.items.length;t<i;t++)s.items[t].element.index=t,s.items[t].element.onmouseover=function(){s.index=this.index},s.items[t].element.onmouseout=function(){s.index=-1};u.boxs.push(s.box),s.update(s),s.box.style.visibility="visible",s.box.style.position="relative",s.box.style.overflow="hidden",s.box.style.margin="0",s.box.style.padding="0",s.box.style.whiteSpace="nowrap",s.box.style.minHeight=(1.2*s.size<220?220:1.2*s.size)+"px",s.box.style.minWidth="auto";for(var o=0,n=s.items.length;o<n;o++)s.items[o].element.style.position="absolute",s.items[o].element.style.zIndex=o+1;s.up=setInterval(function(){s.update(s)},30)}return u.boxs=[],u._set=function(e){if(-1===u.boxs.indexOf(e))return!0},Array.prototype.indexOf||(Array.prototype.indexOf=function(e){var t=this.length>>>0,s=Number(arguments[1])||0;for((s=s<0?Math.ceil(s):Math.floor(s))<0&&(s+=t);s<t;s++)if(s in this&&this[s]===e)return s;return-1}),u._getConfig=function(e){var t={fontsize:16,radius:60,mspeed:"normal",ispeed:"normal",direction:135,keep:!0};if("[object Object]"===Object.prototype.toString.call(e))for(var s in e)Object.prototype.hasOwnProperty.call(e,s)&&(t[s]=e[s]);return t},u._getMsSpeed=function(e){return{slow:1.5,normal:3,fast:5}[e]||3},u._getIsSpeed=function(e){return{slow:10,normal:25,fast:50}[e]||25},u._getSc=function(e,t){var s=Math.PI/180;return[Math.sin(e*s),Math.cos(e*s),Math.sin(t*s),Math.cos(t*s)]},u._on=function(e,t,s,i){e.addEventListener?e.addEventListener(t,s,i):e.attachEvent?e.attachEvent("on"+t,s):e["on"+t]=s},u.prototype={constructor:u,update:function(){var e,t,s=this;if(s.active||s.keep||(s.mouseX=Math.abs(s.mouseX-s.mouseX0)<1?s.mouseX0:(s.mouseX+s.mouseX0)/2,s.mouseY=Math.abs(s.mouseY-s.mouseY0)<1?s.mouseY0:(s.mouseY+s.mouseY0)/2),e=-Math.min(Math.max(-s.mouseY,-s.size),s.size)/s.radius*s.mspeed,t=Math.min(Math.max(-s.mouseX,-s.size),s.size)/s.radius*s.mspeed,!(Math.abs(e)<=.01&&Math.abs(t)<=.01)){s.lasta=e,s.lastb=t;for(var i=u._getSc(e,t),o=0,n=s.items.length;o<n;o++){var a=s.items[o].x,l=s.items[o].y*i[1]+s.items[o].z*-i[0],m=s.items[o].y*i[0]+s.items[o].z*i[1],r=a*i[3]+m*i[2],m=m*i[3]-a*i[2];s.index===o?(s.items[o].scale=1,s.items[o].fontsize=16,s.items[o].alpha=1,s.items[o].element.style.zIndex=99):(a=s.depth/(s.depth+m),s.items[o].x=r,s.items[o].y=l,s.items[o].z=m,s.items[o].scale=a,s.items[o].fontsize=Math.ceil(2*a)+s.fontsize-6,s.items[o].alpha=1.5*a-.5,s.items[o].element.style.zIndex=Math.ceil(10*a-5)),s.items[o].element.style.fontSize=s.items[o].fontsize+"px",s.items[o].element.style.left=s.items[o].x+(s.box.offsetWidth-s.items[o].offsetWidth)/2+"px",s.items[o].element.style.top=s.items[o].y+(s.box.offsetHeight-s.items[o].offsetHeight)/2+"px",s.items[o].element.style.filter="alpha(opacity="+100*s.items[o].alpha+")",s.items[o].element.style.opacity=s.items[o].alpha}}},_getItems:function(){for(var e,t=this,s=[],i=t.box.children,o=i.length,n=0;n<o;n++)(e={}).angle={},e.angle.phi=Math.acos((2*n+1)/o-1),e.angle.theta=Math.sqrt((o+1)*Math.PI)*e.angle.phi,e.element=i[n],e.offsetWidth=e.element.offsetWidth,e.offsetHeight=e.element.offsetHeight,e.x=1.5*t.radius*Math.cos(e.angle.theta)*Math.sin(e.angle.phi),e.y=1.5*t.radius*Math.sin(e.angle.theta)*Math.sin(e.angle.phi),e.z=1.5*t.radius*Math.cos(e.angle.phi),e.element.style.left=e.x+(t.box.offsetWidth-e.offsetWidth)/2+"px",e.element.style.top=e.y+(t.box.offsetHeight-e.offsetHeight)/2+"px",s.push(e);return s}},l.querySelectorAll||(l.querySelectorAll=function(e){var t,s=l.createElement("style"),i=[];for(l.documentElement.firstChild.appendChild(s),l._qsa=[],s.styleSheet.cssText=e+"{x-qsa:expression(document._qsa && document._qsa.push(this))}",window.scrollBy(0,0),s.parentNode.removeChild(s);l._qsa.length;)(t=l._qsa.shift()).style.removeAttribute("x-qsa"),i.push(t);return l._qsa=null,i}),function(e){for(var t=(e=e||{}).selector||".tagcloud",s=l.querySelectorAll(t),i=[],o=0,n=s.length;o<n;o++)e.element=s[o],u._set(e.element)&&i.push(new u(e));return i}}(window,document);
|
16
theme.yaml
16
theme.yaml
@ -2,26 +2,26 @@ apiVersion: theme.halo.run/v1alpha1
|
||||
kind: Theme
|
||||
metadata:
|
||||
# 主题id,唯一
|
||||
name: theme-dream
|
||||
name: theme-dream2-plus
|
||||
spec:
|
||||
# 主题名称
|
||||
displayName: Dream
|
||||
displayName: Dream2.0 Plus
|
||||
author:
|
||||
# 作者名称
|
||||
name: nineya
|
||||
name: 智识家
|
||||
# 作者网址
|
||||
website: https://blog.nineya.com
|
||||
website: https://www.sw0.top
|
||||
# 主题描述
|
||||
description: '梦之城,童话梦境'
|
||||
# 主题logo地址
|
||||
logo: /themes/theme-dream/assets/img/logo.png
|
||||
# 主题地址
|
||||
website: https://github.com/os-fork-org/halo-theme-dream2.0
|
||||
website: https://github.com/zsjy/halo-theme-dream2.0-plus
|
||||
# 主题github开源地址
|
||||
repo: https://github.com/nineya/halo-theme-dream2.0.git
|
||||
repo: https://github.com/zsjy/halo-theme-dream2.0-plus.git
|
||||
settingName: theme-dream-setting
|
||||
configMapName: theme-dream-configMap
|
||||
# 版本号
|
||||
version: 1.3.1.4
|
||||
version: 1.0.0
|
||||
# 最低支持的 Halo 版本
|
||||
require: ">=2.0.0"
|
||||
require: ">=2.6.0"
|
Loading…
x
Reference in New Issue
Block a user