更新
This commit is contained in:
parent
c1bba334ce
commit
08c9f2fdd4
File diff suppressed because one or more lines are too long
@ -1507,6 +1507,34 @@ html[data-night='night'] {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
&-checkbox {
|
||||||
|
-webkit-appearance: none;
|
||||||
|
position: relative;
|
||||||
|
border-radius: 2px;
|
||||||
|
width: 15px;
|
||||||
|
height: 15px;
|
||||||
|
border: 2px solid var(--theme);
|
||||||
|
vertical-align: -2px;
|
||||||
|
&:disabled {
|
||||||
|
cursor: not-allowed;
|
||||||
|
}
|
||||||
|
&:checked {
|
||||||
|
border: none;
|
||||||
|
background: var(--theme);
|
||||||
|
&::after {
|
||||||
|
content: '';
|
||||||
|
width: 3px;
|
||||||
|
height: 7px;
|
||||||
|
position: absolute;
|
||||||
|
top: 2px;
|
||||||
|
left: 5px;
|
||||||
|
border: 2px solid #fff;
|
||||||
|
border-top: 0;
|
||||||
|
border-left: 0;
|
||||||
|
transform: rotate(45deg);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
&__agree {
|
&__agree {
|
||||||
display: flex;
|
display: flex;
|
||||||
|
1
assets/cursor/cursor1.js
Normal file
1
assets/cursor/cursor1.js
Normal file
@ -0,0 +1 @@
|
|||||||
|
"use strict";$(function(){function t(t,i){if(!(t instanceof i)){throw new TypeError("Cannot call a class as a function")}}var i=Object.assign||function(t){for(var i=1;i<arguments.length;i++){var n=arguments[i];for(var e in n){Object.prototype.hasOwnProperty.call(n,e)&&(t[e]=n[e])}}return t},n=(function(){function t(t,i){for(var n=0;n<i.length;n++){var e=i[n];(e.enumerable=e.enumerable||!1),(e.configurable=!0),"value" in e&&(e.writable=!0),Object.defineProperty(t,e.key,e)}}return function(i,n,e){return n&&t(i.prototype,n),e&&t(i,e),i}})(),e=(function(){function e(n){var o=n.origin,r=n.speed,s=n.color,a=n.angle,h=n.context;t(this,e),(this.origin=o),(this.position=i({},this.origin)),(this.color=s),(this.speed=r),(this.angle=a),(this.context=h),(this.renderCount=0)}return(n(e,[{key:"draw",value:function(){(this.context.fillStyle=this.color),this.context.beginPath(),this.context.arc(this.position.x,this.position.y,2,0,2*Math.PI),this.context.fill()}},{key:"move",value:function(){(this.position.x=Math.sin(this.angle)*this.speed+this.position.x),(this.position.y=Math.cos(this.angle)*this.speed+this.position.y+0.3*this.renderCount),this.renderCount++}}]),e)})(),o=(function(){function i(n){var e=n.origin,o=n.context,r=n.circleCount,s=void 0===r?10:r,a=n.area;t(this,i),(this.origin=e),(this.context=o),(this.circleCount=s),(this.area=a),(this.stop=!1),(this.circles=[])}return(n(i,[{key:"randomArray",value:function(t){var i=t.length;return t[Math.floor(i*Math.random())]}},{key:"randomColor",value:function(){var t=["8","9","A","B","C","D","E","F"];return"#"+this.randomArray(t)+this.randomArray(t)+this.randomArray(t)+this.randomArray(t)+this.randomArray(t)+this.randomArray(t)}},{key:"randomRange",value:function(t,i){return(i-t)*Math.random()+t}},{key:"init",value:function(){for(var t=0;t<this.circleCount;t++){var i=new e({context:this.context,origin:this.origin,color:this.randomColor(),angle:this.randomRange(Math.PI-1,Math.PI+1),speed:this.randomRange(1,6)});this.circles.push(i)}}},{key:"move",value:function(){var t=this;this.circles.forEach(function(i,n){if(i.position.x>t.area.width||i.position.y>t.area.height){return t.circles.splice(n,1)}i.move()}),0==this.circles.length&&(this.stop=!0)}},{key:"draw",value:function(){this.circles.forEach(function(t){return t.draw()})}}]),i)})();new ((function(){function i(){t(this,i),(this.computerCanvas=document.createElement("canvas")),(this.renderCanvas=document.createElement("canvas")),(this.computerContext=this.computerCanvas.getContext("2d")),(this.renderContext=this.renderCanvas.getContext("2d")),(this.globalWidth=window.innerWidth),(this.globalHeight=window.innerHeight),(this.booms=[]),(this.running=!1)}return(n(i,[{key:"handleMouseDown",value:function(t){var i=new o({origin:{x:t.clientX,y:t.clientY},context:this.computerContext,area:{width:this.globalWidth,height:this.globalHeight}});i.init(),this.booms.push(i),this.running||this.run()}},{key:"handlePageHide",value:function(){(this.booms=[]),(this.running=!1)}},{key:"init",value:function(){var t=this.renderCanvas.style;(t.position="fixed"),(t.top=t.left=0),(t.zIndex="5201314"),(t.pointerEvents="none"),(t.width=this.renderCanvas.width=this.computerCanvas.width=this.globalWidth),(t.height=this.renderCanvas.height=this.computerCanvas.height=this.globalHeight),document.body.append(this.renderCanvas),window.addEventListener("mousedown",this.handleMouseDown.bind(this)),window.addEventListener("pagehide",this.handlePageHide.bind(this))}},{key:"run",value:function(){var t=this;if(((this.running=!0),0==this.booms.length)){return(this.running=!1)}requestAnimationFrame(this.run.bind(this)),this.computerContext.clearRect(0,0,this.globalWidth,this.globalHeight),this.renderContext.clearRect(0,0,this.globalWidth,this.globalHeight),this.booms.forEach(function(i,n){if(i.stop){return t.booms.splice(n,1)}i.move(),i.draw()}),this.renderContext.drawImage(this.computerCanvas,0,0,this.globalWidth,this.globalHeight)}}]),i)})())().init()});
|
1
assets/cursor/cursor2.js
Normal file
1
assets/cursor/cursor2.js
Normal file
File diff suppressed because one or more lines are too long
1
assets/cursor/cursor3.js
Normal file
1
assets/cursor/cursor3.js
Normal file
@ -0,0 +1 @@
|
|||||||
|
$(document).ready(function(){var e=0;$("html").click(function(t){var n=new Array("富强","民主","文明","和谐","自由","平等","公正","法治","爱国","敬业","诚信","友善"),o=$("<span/>").text(n[e]);e=(e+1)%n.length;var a=t.pageX,c=t.pageY;o.css({"z-index":5201314,top:c-20,left:a,position:"fixed","font-weight":"bold",color:"var(--theme)","user-select":"none"}),$("body").append(o),o.animate({top:c-180,opacity:0},1500,function(){o.remove()})})});
|
1
assets/cursor/cursor4.js
Normal file
1
assets/cursor/cursor4.js
Normal file
@ -0,0 +1 @@
|
|||||||
|
"use strict";!(function(e,t,a){function r(){for(var e=0;e<i.length;e++){i[e].alpha<=0?(t.body.removeChild(i[e].el),i.splice(e,1)):(i[e].y--,(i[e].scale+=0.004),(i[e].alpha-=0.013),(i[e].el.style.cssText="left:"+i[e].x+"px;top:"+i[e].y+"px;opacity:"+i[e].alpha+";transform:scale("+i[e].scale+","+i[e].scale+") rotate(45deg);background:"+i[e].color+";z-index:5201314"))}requestAnimationFrame(r)}function n(e){var a=t.createElement("div");(a.className="heart"),i.push({el:a,x:e.clientX-5,y:e.clientY-5,scale:1,alpha:1,color:o()}),t.body.appendChild(a)}function o(){return"rgb("+~~(255*Math.random())+","+~~(255*Math.random())+","+~~(255*Math.random())+")"}var i=[];(e.requestAnimationFrame=e.requestAnimationFrame||e.webkitRequestAnimationFrame||e.mozRequestAnimationFrame||e.oRequestAnimationFrame||e.msRequestAnimationFrame||function(e){setTimeout(e,1000/60)}),(function(e){var a=t.createElement("style");a.type="text/css";try{a.appendChild(t.createTextNode(e))}catch(t){a.styleSheet.cssText=e}t.getElementsByTagName("head")[0].appendChild(a)})(".heart{width: 10px;height: 10px;position: fixed;background: #f00;transform: rotate(45deg);-webkit-transform: rotate(45deg);-moz-transform: rotate(45deg);}.heart:after,.heart:before{content: '';width: inherit;height: inherit;background: inherit;border-radius: 50%;-webkit-border-radius: 50%;-moz-border-radius: 50%;position: fixed;}.heart:after{top: -5px;}.heart:before{left: -5px;}"),(function(){var t="function"==typeof e.onclick&&e.onclick;e.onclick=function(e){t&&t(),n(e)}})(),r()})(window,document);
|
@ -35,5 +35,21 @@ function _parseShortCode($content)
|
|||||||
$content
|
$content
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
/* 过滤完成任务勾选 */
|
||||||
|
if (preg_match('/\[x\]/', $content)) {
|
||||||
|
$content = preg_replace(
|
||||||
|
'/\[x\]/',
|
||||||
|
'<input type="checkbox" class="joe_detail__article-checkbox" checked disabled></input>',
|
||||||
|
$content
|
||||||
|
);
|
||||||
|
}
|
||||||
|
/* 过滤未完成任务勾选 */
|
||||||
|
if (preg_match('/\[\s{1}\]/', $content)) {
|
||||||
|
$content = preg_replace(
|
||||||
|
'/\[\s{1}\]/',
|
||||||
|
'<input type="checkbox" class="joe_detail__article-checkbox" disabled></input>',
|
||||||
|
$content
|
||||||
|
);
|
||||||
|
}
|
||||||
return $content;
|
return $content;
|
||||||
}
|
}
|
||||||
|
@ -68,3 +68,4 @@
|
|||||||
<!-- 异步加载的JS -->
|
<!-- 异步加载的JS -->
|
||||||
<script async src="https://apip.weatherdt.com/standard/static/js/weather-standard.js?v=2.0"></script>
|
<script async src="https://apip.weatherdt.com/standard/static/js/weather-standard.js?v=2.0"></script>
|
||||||
<script async src="https://cdn.jsdelivr.net/gh/HaoOuBa/Joe@master/plugin/smooth/joe.smooth.js"></script>
|
<script async src="https://cdn.jsdelivr.net/gh/HaoOuBa/Joe@master/plugin/smooth/joe.smooth.js"></script>
|
||||||
|
<script async src="<?php $this->options->themeUrl('assets/cursor/cursor3.js'); ?>"></script>
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
$(function () {
|
$(function () {
|
||||||
$('#wmd-editarea textarea').attr('placeholder', '请输入文章内容...(支持图片粘贴上传)')
|
$('#wmd-editarea textarea').attr('placeholder', '请输入文章内容...(支持图片粘贴上传)');
|
||||||
$('#wmd-button-bar .wmd-edittab').remove()
|
$('#wmd-button-bar .wmd-edittab').remove();
|
||||||
$('#wmd-button-row .wmd-spacer').remove()
|
$('#wmd-button-row .wmd-spacer').remove();
|
||||||
$('#wmd-button-row #wmd-code-button').remove()
|
$('#wmd-button-row #wmd-code-button').remove();
|
||||||
|
|
||||||
/* 增加自定义功能 */
|
/* 增加自定义功能 */
|
||||||
const items = [
|
const items = [
|
||||||
@ -60,54 +60,62 @@ $(function () {
|
|||||||
title: '行内代码',
|
title: '行内代码',
|
||||||
id: 'wmd-code-button',
|
id: 'wmd-code-button',
|
||||||
svg: '<svg class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg"><path d="M342.677 595.002" p-id="91366" fill="#9b9b9b"></path><path d="M920.887 527.046l-206.45 206.45c-8.142 8.146-21.347 8.146-29.493 0l-29.493-29.493c-8.146-8.142-8.146-21.347 0-29.493l162.213-162.213L655.452 350.089c-8.146-8.146-8.146-21.351 0-29.497l29.493-29.493c8.146-8.146 21.351-8.146 29.493 0l206.45 206.45C929.038 505.695 929.038 518.9 920.887 527.046zM434.759 857.498l-37.643-10.54c-10.394-2.911-16.788-13.193-14.281-22.969l167.635-644.738c2.682-10.01 13.877-15.712 25.001-12.73l40.287 10.794c11.128 2.982 17.973 13.514 15.287 23.528L458.12 845.068C455.609 854.845 445.153 860.409 434.759 857.498zM368.545 704.003l-29.493 29.493c-8.142 8.146-21.347 8.146-29.493 0l-206.45-206.45c-8.146-8.146-8.146-21.351 0-29.497l206.45-206.45c8.146-8.146 21.351-8.146 29.493 0l29.493 29.493c8.146 8.146 8.146 21.351 0 29.497L206.332 512.297 368.545 674.51C376.691 682.656 376.691 695.861 368.545 704.003z" p-id="91367" fill="#9b9b9b"></path></svg>'
|
svg: '<svg class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg"><path d="M342.677 595.002" p-id="91366" fill="#9b9b9b"></path><path d="M920.887 527.046l-206.45 206.45c-8.142 8.146-21.347 8.146-29.493 0l-29.493-29.493c-8.146-8.142-8.146-21.347 0-29.493l162.213-162.213L655.452 350.089c-8.146-8.146-8.146-21.351 0-29.497l29.493-29.493c8.146-8.146 21.351-8.146 29.493 0l206.45 206.45C929.038 505.695 929.038 518.9 920.887 527.046zM434.759 857.498l-37.643-10.54c-10.394-2.911-16.788-13.193-14.281-22.969l167.635-644.738c2.682-10.01 13.877-15.712 25.001-12.73l40.287 10.794c11.128 2.982 17.973 13.514 15.287 23.528L458.12 845.068C455.609 854.845 445.153 860.409 434.759 857.498zM368.545 704.003l-29.493 29.493c-8.142 8.146-21.347 8.146-29.493 0l-206.45-206.45c-8.146-8.146-8.146-21.351 0-29.497l206.45-206.45c8.146-8.146 21.351-8.146 29.493 0l29.493 29.493c8.146 8.146 8.146 21.351 0 29.497L206.332 512.297 368.545 674.51C376.691 682.656 376.691 695.861 368.545 704.003z" p-id="91367" fill="#9b9b9b"></path></svg>'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '任务列表',
|
||||||
|
id: 'wmd-task-button',
|
||||||
|
svg: '<svg class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg"><path d="M593.92 215.04c112.64 0 204.8 92.16 204.8 204.8v204.8c0 112.64-92.16 204.8-204.8 204.8h-204.8c-112.64 0-204.8-92.16-204.8-204.8v-204.8c0-112.64 92.16-204.8 204.8-204.8h204.8m0-51.2h-204.8c-143.36 0-256 112.64-256 256v204.8c0 143.36 112.64 256 256 256h204.8c143.36 0 256-112.64 256-256v-204.8c0-138.24-112.64-256-256-256z" fill="#9b9b9b" p-id="3001"></path><path d="M527.36 762.88L230.4 460.8 307.2 399.36l174.08 133.12c71.68-81.92 230.4-250.88 445.44-384l20.48 40.96c-199.68 184.32-363.52 445.44-419.84 573.44m0 0" fill="#9b9b9b" p-id="3002"></path></svg>'
|
||||||
}
|
}
|
||||||
]
|
];
|
||||||
|
|
||||||
/* 用于设置插入到文章的短代码内容 */
|
/* 用于设置插入到文章的短代码内容 */
|
||||||
function getInsertTextById(id) {
|
function getInsertTextById(id) {
|
||||||
let str = ''
|
let str = '';
|
||||||
switch (id) {
|
switch (id) {
|
||||||
case 'wmd-hide-button':
|
case 'wmd-hide-button':
|
||||||
str = `\n\n[hide]${$('#text').selectionRange() ? $('#text').selectionRange() : '回复可见'}[/hide]\n\n`
|
str = `\n\n[hide]${$('#text').selectionRange() ? $('#text').selectionRange() : '回复可见'}[/hide]\n\n`;
|
||||||
break
|
break;
|
||||||
case 'wmd-mlist-button':
|
case 'wmd-mlist-button':
|
||||||
str = `\n\n[music-list id="网易云歌单ID" /]\n\n`
|
str = `\n\n[music-list id="网易云歌单ID" /]\n\n`;
|
||||||
break
|
break;
|
||||||
case 'wmd-music-button':
|
case 'wmd-music-button':
|
||||||
str = `\n\n[music id="网易云音乐ID" /]\n\n`
|
str = `\n\n[music id="网易云音乐ID" /]\n\n`;
|
||||||
break
|
break;
|
||||||
case 'wmd-bili-button':
|
case 'wmd-bili-button':
|
||||||
str = `\n\n[bilibili bvid="哔哩哔哩的Bvid" /]\n\n`
|
str = `\n\n[bilibili bvid="哔哩哔哩的Bvid" /]\n\n`;
|
||||||
break
|
break;
|
||||||
case 'wmd-dplayer-button':
|
case 'wmd-dplayer-button':
|
||||||
str = `\n\n[dplayer src="M3U8或MP4地址" /]\n\n`
|
str = `\n\n[dplayer src="M3U8或MP4地址" /]\n\n`;
|
||||||
break
|
break;
|
||||||
case 'wmd-html-button':
|
case 'wmd-html-button':
|
||||||
str = `\n\n!!!\n<span class="test">Hello Joe</span>\n<style>\n .test { color: #ff6800 }\n</style>\n!!!\n\n`
|
str = `\n\n!!!\n<span class="test">Hello Joe</span>\n<style>\n .test { color: #ff6800 }\n</style>\n!!!\n\n`;
|
||||||
break
|
break;
|
||||||
case 'wmd-title-button':
|
case 'wmd-title-button':
|
||||||
str = `\n\n# 一级标题\n## 二级标题\n### 三级标题\n#### 四级标题\n##### 五级标题\n###### 六级标题\n\n`
|
str = `\n\n# 一级标题\n## 二级标题\n### 三级标题\n#### 四级标题\n##### 五级标题\n###### 六级标题\n\n`;
|
||||||
break
|
break;
|
||||||
case 'wmd-table-button':
|
case 'wmd-table-button':
|
||||||
str = `\n\n| 左对齐 | 右对齐 | 居中对齐 |\n| :-----| ----: | :----: |\n| 单元格 | 单元格 | 单元格 |\n\n`
|
str = `\n\n| 左对齐 | 右对齐 | 居中对齐 |\n| :-----| ----: | :----: |\n| 单元格 | 单元格 | 单元格 |\n\n`;
|
||||||
break
|
break;
|
||||||
case 'wmd-delete-button':
|
case 'wmd-delete-button':
|
||||||
str = `~~${$('#text').selectionRange() ? $('#text').selectionRange() : '删除线'}~~`
|
str = `~~${$('#text').selectionRange() ? $('#text').selectionRange() : '删除线'}~~`;
|
||||||
break
|
break;
|
||||||
case 'wmd-snippet-button':
|
case 'wmd-snippet-button':
|
||||||
str = `\n\n\`\`\`php\necho 'Hello Joe';\n\`\`\`\n\n`
|
str = `\n\n\`\`\`php\necho 'Hello Joe';\n\`\`\`\n\n`;
|
||||||
break
|
break;
|
||||||
case 'wmd-code-button':
|
case 'wmd-code-button':
|
||||||
str = ` \`${$('#text').selectionRange() ? $('#text').selectionRange() : '行内代码'}\` `
|
str = ` \`${$('#text').selectionRange() ? $('#text').selectionRange() : '行内代码'}\` `;
|
||||||
break
|
break;
|
||||||
|
case 'wmd-task-button':
|
||||||
|
str = `[x] 任务已完成\n[ ] 任务未完成`;
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
return str
|
return str;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* 此处无需修改 */
|
/* 此处无需修改 */
|
||||||
items.forEach(_ => {
|
items.forEach(_ => {
|
||||||
let item = $(`<li class="wmd-button" id="${_.id}" title="${_.title}">${_.svg}</li>`)
|
let item = $(`<li class="wmd-button" id="${_.id}" title="${_.title}">${_.svg}</li>`);
|
||||||
item.on('mousedown touchstart', () => $('#text').insertContent(getInsertTextById(_.id)))
|
item.on('mousedown touchstart', () => $('#text').insertContent(getInsertTextById(_.id)));
|
||||||
$('#wmd-button-row').append(item)
|
$('#wmd-button-row').append(item);
|
||||||
})
|
});
|
||||||
})
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user