This commit is contained in:
杜恒 2021-01-25 12:30:39 +08:00
parent fd21fc6a49
commit 6fea990824
7 changed files with 157 additions and 9 deletions

View File

@ -1 +1 @@
!function(){function t(){let t=document.getElementsByTagName("script"),e=t.length,n=t[e-1];return{length:e,z:-1000,opacity:n.getAttribute("opacity")||.5,color:n.getAttribute("color")||"0,0,0",count:n.getAttribute("count")||99}}function e(){W=i.width=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,H=i.height=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight}function n(){o.clearRect(0,0,W,H);var t,e,i=[y].concat(d);d.forEach(function(n){n.x+=n.xa,n.y+=n.ya,n.xa=n.xa*(n.x>W||n.x<0?-1:1),n.ya=n.ya*(n.y>H||n.y<0?-1:1),o.fillRect(n.x-.5,n.y-.5,1,1);for(let c=0;c<i.length;c++)t=i[c],n!==t&&null!==t.x&&null!==t.y&&(x_diff=n.x-t.x,y_diff=n.y-t.y,distance=x_diff*x_diff+y_diff*y_diff,distance<t.max&&(t===y&&distance>t.max/2&&(n.x=n.x-.03*x_diff,n.y=n.y-.03*y_diff),e=(t.max-distance)/t.max,o.beginPath(),o.lineWidth=e/2,o.strokeStyle="rgba("+a.color+","+(e+.2)+")",o.moveTo(n.x,n.y),o.lineTo(t.x,t.y),o.stroke()));i.splice(i.indexOf(n),1)}),r(n)}var i=document.createElement("canvas"),o=i.getContext("2d"),a=t();i.id="c_n"+a.length,i.style.cssText="position:fixed;top:0;left:0;z-index:"+a.z+";opacity:"+a.opacity,document.getElementsByTagName("body")[0].appendChild(i),e(),window.onresize=e;var c=Math.random,d=[];for(let t=0;t<a.count;t++){var l=c()*W,u=c()*H,m=2*c()-1,x=2*c()-1;d.push({x:l,y:u,xa:m,ya:x,max:6e3})}var y={x:null,y:null,max:2e4};window.onmousemove=function(t){t=t||window.event,y.x=t.clientX,y.y=t.clientY},window.onmouseout=function(){y.x=null,y.y=null};var r=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(t){window.setTimeout(t,1e3/45)};setTimeout(function(){n()},100)}();
'use strict';!function(){function f(){W=h.width=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,H=h.height=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight}function g(){j.clearRect(0,0,W,H);var C,D,E=[A].concat(q);q.forEach(function(F){F.x+=F.xa,F.y+=F.ya,F.xa*=F.x>W||0>F.x?-1:1,F.ya*=F.y>H||0>F.y?-1:1,j.fillRect(F.x-0.5,F.y-0.5,1,1);for(var G=0;G<E.length;G++)C=E[G],F!==C&&null!==C.x&&null!==C.y&&(x_diff=F.x-C.x,y_diff=F.y-C.y,distance=x_diff*x_diff+y_diff*y_diff,distance<C.max&&(C===A&&distance>C.max/2&&(F.x-=0.03*x_diff,F.y-=0.03*y_diff),D=(C.max-distance)/C.max,j.beginPath(),j.lineWidth=D/2,j.strokeStyle='rgba('+k.color+','+(D+0.2)+')',j.moveTo(F.x,F.y),j.lineTo(C.x,C.y),j.stroke()));E.splice(E.indexOf(F),1)}),B(g)}var h=document.createElement('canvas'),j=h.getContext('2d'),k=function(){var C=document.getElementsByTagName('script'),D=C.length,E=C[D-1];return{length:D,z:-520,opacity:E.getAttribute('opacity')||0.5,color:E.getAttribute('color')||'0,0,0',count:E.getAttribute('count')||99}}();h.id='c_n'+k.length,h.style.cssText='position:fixed;top:0;left:0;z-index:'+k.z+';opacity:'+k.opacity,document.getElementsByTagName('body')[0].appendChild(h),f(),window.onresize=f;for(var p=Math.random,q=[],C=0;C<k.count;C++){var s=p()*W,v=p()*H,w=2*p()-1,z=2*p()-1;q.push({x:s,y:v,xa:w,ya:z,max:6e3})}var A={x:null,y:null,max:2e4};window.onmousemove=function(C){C=C||window.event,A.x=C.clientX,A.y=C.clientY},window.onmouseout=function(){A.x=null,A.y=null};var B=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(C){window.setTimeout(C,1e3/45)};setTimeout(function(){g()},100)}();

File diff suppressed because one or more lines are too long

View File

@ -1 +1 @@
*{margin:0;padding:0;box-sizing:border-box;outline:none;-webkit-tap-highlight-color:transparent}::-webkit-scrollbar{width:8px}::-webkit-scrollbar-thumb{border-radius:4px;background:var(--seat)}::-webkit-scrollbar-track{background:transparent}body{font-size:14px;font-family:'Helvetica Neue', Helvetica, 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', '微软雅黑', Arial, sans-serif}body::before{content:'';position:fixed;top:0;left:0;right:0;bottom:0;z-index:-520;pointer-events:none}input[type='text']{-webkit-appearance:none;border-radius:0;font-size:13px;font-weight:500}textarea{resize:none;-webkit-appearance:none}li{list-style:none}a{text-decoration:none}h1,h2,h3,h4,h5,h6{font-weight:500}img{border:0;vertical-align:middle}img[src=''],img:not([src]){border:0;opacity:0}svg,canvas{vertical-align:middle}button{cursor:pointer;-webkit-appearance:none;font-size:13px}table{border-collapse:collapse;border-spacing:0}.joe_main{min-width:0;flex:1;padding:15px 0}.joe_container{display:flex;width:100%;margin:0 auto;padding:0 15px}@media (min-width: 576px){.joe_container{max-width:540px}}@media (min-width: 768px){.joe_container{max-width:720px}}@media (min-width: 992px){.joe_container{max-width:960px}}@media (min-width: 1200px){.joe_container{max-width:1140px}}@media (min-width: 1400px){.joe_container{max-width:1320px}}html{--background: #fff;--theme: #f24e4e;--main: #303133;--routine: #606266;--minor: #909399;--seat: #c0c4cc;--classA: #dcdfe6;--classB: #e4e7ed;--classC: #ebeef5;--classD: #f2f6fc;--text-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);--box-shadow: 0px 0px 20px -5px rgba(158, 158, 158, 0.22)}html[data-night='night']{--background: #303133;--box-shadow: none}
*{margin:0;padding:0;box-sizing:border-box;outline:none;-webkit-tap-highlight-color:transparent}::-webkit-scrollbar{width:8px}::-webkit-scrollbar-thumb{border-radius:4px;background:var(--seat)}::-webkit-scrollbar-track{background:transparent}body{font-size:14px;font-family:'Helvetica Neue', Helvetica, 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', '微软雅黑', Arial, sans-serif}body::before{content:'';position:fixed;top:0;left:0;right:0;bottom:0;z-index:-521;pointer-events:none}input[type='text']{-webkit-appearance:none;border-radius:0;font-size:13px;font-weight:500}textarea{resize:none;-webkit-appearance:none}li{list-style:none}a{text-decoration:none}h1,h2,h3,h4,h5,h6{font-weight:500}img{border:0;vertical-align:middle}img[src=''],img:not([src]){border:0;opacity:0}svg,canvas{vertical-align:middle}button{cursor:pointer;-webkit-appearance:none;font-size:13px}table{border-collapse:collapse;border-spacing:0}.joe_main{min-width:0;flex:1;padding:15px 0}.joe_container{display:flex;width:100%;margin:0 auto;padding:0 15px}@media (min-width: 576px){.joe_container{max-width:540px}}@media (min-width: 768px){.joe_container{max-width:720px}}@media (min-width: 992px){.joe_container{max-width:960px}}@media (min-width: 1200px){.joe_container{max-width:1140px}}@media (min-width: 1400px){.joe_container{max-width:1320px}}html{--background: #fff;--theme: #f24e4e;--main: #303133;--routine: #606266;--minor: #909399;--seat: #c0c4cc;--classA: #dcdfe6;--classB: #e4e7ed;--classC: #ebeef5;--classD: #f2f6fc;--text-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);--box-shadow: 0px 0px 20px -5px rgba(158, 158, 158, 0.22)}html[data-night='night']{--background: #303133;--box-shadow: none}

View File

@ -31,7 +31,7 @@ body::before {
left: 0;
right: 0;
bottom: 0;
z-index: -520;
z-index: -521;
pointer-events: none;
}

View File

@ -27,6 +27,15 @@ document.addEventListener('DOMContentLoaded', () => {
});
}
/* 动态背景 */
{
if (!Joe.IS_MOBILE) {
if (Joe.DYNAMIC_BACKGROUND !== 'off' && Joe.DYNAMIC_BACKGROUND && !Joe.WALLPAPER_BACKGROUND_PC) {
$.getScript(`https://cdn.jsdelivr.net/gh/HaoOuBa/Joe@master/assets/backdrop/${Joe.DYNAMIC_BACKGROUND}`);
}
}
}
/* 激活全局下拉框功能 */
{
$('.joe_dropdown').each(function (index, item) {

View File

@ -474,8 +474,8 @@ function themeConfig($form)
),
'off',
'是否开启动态背景图仅限PC',
'介绍用于设置PC端动态背景如果下方填写了PC端静态壁纸则优先显示下方静态壁纸
注意:手机端是不支持此项的'
'介绍用于设置PC端动态背景<br />
注意:如果您填写了下方PC端静态壁纸将优先展示下方静态壁纸如需显示动态壁纸请将PC端静态壁纸设置成空'
);
$JDynamic_Background->setAttribute('class', 'joe_content joe_image');
$form->addInput($JDynamic_Background->multiMode());
@ -487,7 +487,7 @@ function themeConfig($form)
'PC端网站背景图片非必填',
'介绍PC端网站的背景图片不填写时显示默认的灰色。<br />
格式图片URL地址 随机图片api 例如http://api.btstu.cn/sjbz/?lx=dongman <br />
注意:此项设置会优先显示,如果开启上方动态壁纸,会覆盖上方动态壁纸'
注意:如果需要显示上方动态壁纸,请不要填写此项,此项优先级最高'
);
$JWallpaper_Background_PC->setAttribute('class', 'joe_content joe_image');
$form->addInput($JWallpaper_Background_PC);

View File

@ -14,8 +14,7 @@
LIVE2D: '<?php $this->options->JLive2d() ?>', // Live2d
BASE_API: '/index.php/joe/api', // 请求基准URL
DYNAMIC_BACKGROUND: '<?php $this->options->JDynamic_Background() ?>', // 动态背景
WALLPAPER_BACKGROUND_PC: '<?php $this->options->JWallpaper_Background_PC() ?>', // PC端静态背景
WALLPAPER_BACKGROUND_WAP: '<?php $this->options->JWallpaper_Background_WAP() ?>', // WAP端静态背景
WALLPAPER_BACKGROUND_PC: '<?php $this->options->JWallpaper_Background_PC() ?>', // 是否填写了PC端静态壁纸
IS_MOBILE: /windows phone|iphone|android/gi.test(window.navigator.userAgent), // 是否是手机端
encryption: str => window.btoa(unescape(encodeURIComponent(str))), // 加密字符串
decrypt: str => decodeURIComponent(escape(window.atob(str))), // 解密字符串