").html(e).find(t.opts.filter))),t.$slide.one("onReset",function(){n(this).find("video,audio").trigger("pause"),t.$placeholder&&(t.$placeholder.after(e.removeClass("fancybox-content").hide()).remove(),t.$placeholder=null),t.$smallBtn&&(t.$smallBtn.remove(),t.$smallBtn=null),t.hasError||(n(this).empty(),t.isLoaded=!1,t.isRevealed=!1)}),n(e).appendTo(t.$slide),n(e).is("video,audio")&&(n(e).addClass("fancybox-video"),n(e).wrap("
"),t.contentType="video",t.opts.width=t.opts.width||n(e).attr("width"),t.opts.height=t.opts.height||n(e).attr("height")),t.$content=t.$slide.children().filter("div,form,main,video,audio,article,.fancybox-content").first(),t.$content.siblings().hide(),t.$content.length||(t.$content=t.$slide.wrapInner("
").children().first()),t.$content.addClass("fancybox-content"),t.$slide.addClass("fancybox-slide--"+t.contentType),o.afterLoad(t))},setError:function(t){t.hasError=!0,t.$slide.trigger("onReset").removeClass("fancybox-slide--"+t.contentType).addClass("fancybox-slide--error"),t.contentType="html",this.setContent(t,this.translate(t,t.opts.errorTpl)),t.pos===this.currPos&&(this.isAnimating=!1)},showLoading:function(t){var e=this;(t=t||e.current)&&!t.$spinner&&(t.$spinner=n(e.translate(e,e.opts.spinnerTpl)).appendTo(t.$slide).hide().fadeIn("fast"))},hideLoading:function(t){var e=this;(t=t||e.current)&&t.$spinner&&(t.$spinner.stop().remove(),delete t.$spinner)},afterLoad:function(t){var e=this;e.isClosing||(t.isLoading=!1,t.isLoaded=!0,e.trigger("afterLoad",t),e.hideLoading(t),!t.opts.smallBtn||t.$smallBtn&&t.$smallBtn.length||(t.$smallBtn=n(e.translate(t,t.opts.btnTpl.smallBtn)).appendTo(t.$content)),t.opts.protect&&t.$content&&!t.hasError&&(t.$content.on("contextmenu.fb",function(t){return 2==t.button&&t.preventDefault(),!0}),"image"===t.type&&n('
').appendTo(t.$content)),e.adjustCaption(t),e.adjustLayout(t),t.pos===e.currPos&&e.updateCursor(),e.revealContent(t))},adjustCaption:function(t){var e,n=this,o=t||n.current,i=o.opts.caption,a=o.opts.preventCaptionOverlap,s=n.$refs.caption,r=!1;s.toggleClass("fancybox-caption--separate",a),a&&i&&i.length&&(o.pos!==n.currPos?(e=s.clone().appendTo(s.parent()),e.children().eq(0).empty().html(i),r=e.outerHeight(!0),e.empty().remove()):n.$caption&&(r=n.$caption.outerHeight(!0)),o.$slide.css("padding-bottom",r||""))},adjustLayout:function(t){var e,n,o,i,a=this,s=t||a.current;s.isLoaded&&!0!==s.opts.disableLayoutFix&&(s.$content.css("margin-bottom",""),s.$content.outerHeight()>s.$slide.height()+.5&&(o=s.$slide[0].style["padding-bottom"],i=s.$slide.css("padding-bottom"),parseFloat(i)>0&&(e=s.$slide[0].scrollHeight,s.$slide.css("padding-bottom",0),Math.abs(e-s.$slide[0].scrollHeight)<1&&(n=i),s.$slide.css("padding-bottom",o))),s.$content.css("margin-bottom",n))},revealContent:function(t){var e,o,i,a,s=this,r=t.$slide,c=!1,l=!1,d=s.isMoved(t),u=t.isRevealed;return t.isRevealed=!0,e=t.opts[s.firstRun?"animationEffect":"transitionEffect"],i=t.opts[s.firstRun?"animationDuration":"transitionDuration"],i=parseInt(void 0===t.forcedDuration?i:t.forcedDuration,10),!d&&t.pos===s.currPos&&i||(e=!1),"zoom"===e&&(t.pos===s.currPos&&i&&"image"===t.type&&!t.hasError&&(l=s.getThumbPos(t))?c=s.getFitPos(t):e="fade"),"zoom"===e?(s.isAnimating=!0,c.scaleX=c.width/l.width,c.scaleY=c.height/l.height,a=t.opts.zoomOpacity,"auto"==a&&(a=Math.abs(t.width/t.height-l.width/l.height)>.1),a&&(l.opacity=.1,c.opacity=1),n.fancybox.setTranslate(t.$content.removeClass("fancybox-is-hidden"),l),p(t.$content),void n.fancybox.animate(t.$content,c,i,function(){s.isAnimating=!1,s.complete()})):(s.updateSlide(t),e?(n.fancybox.stop(r),o="fancybox-slide--"+(t.pos>=s.prevPos?"next":"previous")+" fancybox-animated fancybox-fx-"+e,r.addClass(o).removeClass("fancybox-slide--current"),t.$content.removeClass("fancybox-is-hidden"),p(r),"image"!==t.type&&t.$content.hide().show(0),void n.fancybox.animate(r,"fancybox-slide--current",i,function(){r.removeClass(o).css({transform:"",opacity:""}),t.pos===s.currPos&&s.complete()},!0)):(t.$content.removeClass("fancybox-is-hidden"),u||!d||"image"!==t.type||t.hasError||t.$content.hide().fadeIn("fast"),void(t.pos===s.currPos&&s.complete())))},getThumbPos:function(t){var e,o,i,a,s,r=!1,c=t.$thumb;return!(!c||!g(c[0]))&&(e=n.fancybox.getTranslate(c),o=parseFloat(c.css("border-top-width")||0),i=parseFloat(c.css("border-right-width")||0),a=parseFloat(c.css("border-bottom-width")||0),s=parseFloat(c.css("border-left-width")||0),r={top:e.top+o,left:e.left+s,width:e.width-i-s,height:e.height-o-a,scaleX:1,scaleY:1},e.width>0&&e.height>0&&r)},complete:function(){var t,e=this,o=e.current,i={};!e.isMoved()&&o.isLoaded&&(o.isComplete||(o.isComplete=!0,o.$slide.siblings().trigger("onReset"),e.preload("inline"),p(o.$slide),o.$slide.addClass("fancybox-slide--complete"),n.each(e.slides,function(t,o){o.pos>=e.currPos-1&&o.pos<=e.currPos+1?i[o.pos]=o:o&&(n.fancybox.stop(o.$slide),o.$slide.off().remove())}),e.slides=i),e.isAnimating=!1,e.updateCursor(),e.trigger("afterShow"),o.opts.video.autoStart&&o.$slide.find("video,audio").filter(":visible:first").trigger("play").one("ended",function(){Document.exitFullscreen?Document.exitFullscreen():this.webkitExitFullscreen&&this.webkitExitFullscreen(),e.next()}),o.opts.autoFocus&&"html"===o.contentType&&(t=o.$content.find("input[autofocus]:enabled:visible:first"),t.length?t.trigger("focus"):e.focus(null,!0)),o.$slide.scrollTop(0).scrollLeft(0))},preload:function(t){var e,n,o=this;o.group.length<2||(n=o.slides[o.currPos+1],e=o.slides[o.currPos-1],e&&e.type===t&&o.loadSlide(e),n&&n.type===t&&o.loadSlide(n))},focus:function(t,o){var i,a,s=this,r=["a[href]","area[href]",'input:not([disabled]):not([type="hidden"]):not([aria-hidden])',"select:not([disabled]):not([aria-hidden])","textarea:not([disabled]):not([aria-hidden])","button:not([disabled]):not([aria-hidden])","iframe","object","embed","video","audio","[contenteditable]",'[tabindex]:not([tabindex^="-"])'].join(",");s.isClosing||(i=!t&&s.current&&s.current.isComplete?s.current.$slide.find("*:visible"+(o?":not(.fancybox-close-small)":"")):s.$refs.container.find("*:visible"),i=i.filter(r).filter(function(){return"hidden"!==n(this).css("visibility")&&!n(this).hasClass("disabled")}),i.length?(a=i.index(e.activeElement),t&&t.shiftKey?(a<0||0==a)&&(t.preventDefault(),i.eq(i.length-1).trigger("focus")):(a<0||a==i.length-1)&&(t&&t.preventDefault(),i.eq(0).trigger("focus"))):s.$refs.container.trigger("focus"))},activate:function(){var t=this;n(".fancybox-container").each(function(){var e=n(this).data("FancyBox");e&&e.id!==t.id&&!e.isClosing&&(e.trigger("onDeactivate"),e.removeEvents(),e.isVisible=!1)}),t.isVisible=!0,(t.current||t.isIdle)&&(t.update(),t.updateControls()),t.trigger("onActivate"),t.addEvents()},close:function(t,e){var o,i,a,s,r,c,l,u=this,f=u.current,h=function(){u.cleanUp(t)};return!u.isClosing&&(u.isClosing=!0,!1===u.trigger("beforeClose",t)?(u.isClosing=!1,d(function(){u.update()}),!1):(u.removeEvents(),a=f.$content,o=f.opts.animationEffect,i=n.isNumeric(e)?e:o?f.opts.animationDuration:0,f.$slide.removeClass("fancybox-slide--complete fancybox-slide--next fancybox-slide--previous fancybox-animated"),!0!==t?n.fancybox.stop(f.$slide):o=!1,f.$slide.siblings().trigger("onReset").remove(),i&&u.$refs.container.removeClass("fancybox-is-open").addClass("fancybox-is-closing").css("transition-duration",i+"ms"),u.hideLoading(f),u.hideControls(!0),u.updateCursor(),"zoom"!==o||a&&i&&"image"===f.type&&!u.isMoved()&&!f.hasError&&(l=u.getThumbPos(f))||(o="fade"),"zoom"===o?(n.fancybox.stop(a),s=n.fancybox.getTranslate(a),c={top:s.top,left:s.left,scaleX:s.width/l.width,scaleY:s.height/l.height,width:l.width,height:l.height},r=f.opts.zoomOpacity,
+"auto"==r&&(r=Math.abs(f.width/f.height-l.width/l.height)>.1),r&&(l.opacity=0),n.fancybox.setTranslate(a,c),p(a),n.fancybox.animate(a,l,i,h),!0):(o&&i?n.fancybox.animate(f.$slide.addClass("fancybox-slide--previous").removeClass("fancybox-slide--current"),"fancybox-animated fancybox-fx-"+o,i,h):!0===t?setTimeout(h,i):h(),!0)))},cleanUp:function(e){var o,i,a,s=this,r=s.current.opts.$orig;s.current.$slide.trigger("onReset"),s.$refs.container.empty().remove(),s.trigger("afterClose",e),s.current.opts.backFocus&&(r&&r.length&&r.is(":visible")||(r=s.$trigger),r&&r.length&&(i=t.scrollX,a=t.scrollY,r.trigger("focus"),n("html, body").scrollTop(a).scrollLeft(i))),s.current=null,o=n.fancybox.getInstance(),o?o.activate():(n("body").removeClass("fancybox-active compensate-for-scrollbar"),n("#fancybox-style-noscroll").remove())},trigger:function(t,e){var o,i=Array.prototype.slice.call(arguments,1),a=this,s=e&&e.opts?e:a.current;if(s?i.unshift(s):s=a,i.unshift(a),n.isFunction(s.opts[t])&&(o=s.opts[t].apply(s,i)),!1===o)return o;"afterClose"!==t&&a.$refs?a.$refs.container.trigger(t+".fb",i):r.trigger(t+".fb",i)},updateControls:function(){var t=this,o=t.current,i=o.index,a=t.$refs.container,s=t.$refs.caption,r=o.opts.caption;o.$slide.trigger("refresh"),r&&r.length?(t.$caption=s,s.children().eq(0).html(r)):t.$caption=null,t.hasHiddenControls||t.isIdle||t.showControls(),a.find("[data-fancybox-count]").html(t.group.length),a.find("[data-fancybox-index]").html(i+1),a.find("[data-fancybox-prev]").prop("disabled",!o.opts.loop&&i<=0),a.find("[data-fancybox-next]").prop("disabled",!o.opts.loop&&i>=t.group.length-1),"image"===o.type?a.find("[data-fancybox-zoom]").show().end().find("[data-fancybox-download]").attr("href",o.opts.image.src||o.src).show():o.opts.toolbar&&a.find("[data-fancybox-download],[data-fancybox-zoom]").hide(),n(e.activeElement).is(":hidden,[disabled]")&&t.$refs.container.trigger("focus")},hideControls:function(t){var e=this,n=["infobar","toolbar","nav"];!t&&e.current.opts.preventCaptionOverlap||n.push("caption"),this.$refs.container.removeClass(n.map(function(t){return"fancybox-show-"+t}).join(" ")),this.hasHiddenControls=!0},showControls:function(){var t=this,e=t.current?t.current.opts:t.opts,n=t.$refs.container;t.hasHiddenControls=!1,t.idleSecondsCounter=0,n.toggleClass("fancybox-show-toolbar",!(!e.toolbar||!e.buttons)).toggleClass("fancybox-show-infobar",!!(e.infobar&&t.group.length>1)).toggleClass("fancybox-show-caption",!!t.$caption).toggleClass("fancybox-show-nav",!!(e.arrows&&t.group.length>1)).toggleClass("fancybox-is-modal",!!e.modal)},toggleControls:function(){this.hasHiddenControls?this.showControls():this.hideControls()}}),n.fancybox={version:"3.5.7",defaults:a,getInstance:function(t){var e=n('.fancybox-container:not(".fancybox-is-closing"):last').data("FancyBox"),o=Array.prototype.slice.call(arguments,1);return e instanceof b&&("string"===n.type(t)?e[t].apply(e,o):"function"===n.type(t)&&t.apply(e,o),e)},open:function(t,e,n){return new b(t,e,n)},close:function(t){var e=this.getInstance();e&&(e.close(),!0===t&&this.close(t))},destroy:function(){this.close(!0),r.add("body").off("click.fb-start","**")},isMobile:/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent),use3d:function(){var n=e.createElement("div");return t.getComputedStyle&&t.getComputedStyle(n)&&t.getComputedStyle(n).getPropertyValue("transform")&&!(e.documentMode&&e.documentMode<11)}(),getTranslate:function(t){var e;return!(!t||!t.length)&&(e=t[0].getBoundingClientRect(),{top:e.top||0,left:e.left||0,width:e.width,height:e.height,opacity:parseFloat(t.css("opacity"))})},setTranslate:function(t,e){var n="",o={};if(t&&e)return void 0===e.left&&void 0===e.top||(n=(void 0===e.left?t.position().left:e.left)+"px, "+(void 0===e.top?t.position().top:e.top)+"px",n=this.use3d?"translate3d("+n+", 0px)":"translate("+n+")"),void 0!==e.scaleX&&void 0!==e.scaleY?n+=" scale("+e.scaleX+", "+e.scaleY+")":void 0!==e.scaleX&&(n+=" scaleX("+e.scaleX+")"),n.length&&(o.transform=n),void 0!==e.opacity&&(o.opacity=e.opacity),void 0!==e.width&&(o.width=e.width),void 0!==e.height&&(o.height=e.height),t.css(o)},animate:function(t,e,o,i,a){var s,r=this;n.isFunction(o)&&(i=o,o=null),r.stop(t),s=r.getTranslate(t),t.on(f,function(c){(!c||!c.originalEvent||t.is(c.originalEvent.target)&&"z-index"!=c.originalEvent.propertyName)&&(r.stop(t),n.isNumeric(o)&&t.css("transition-duration",""),n.isPlainObject(e)?void 0!==e.scaleX&&void 0!==e.scaleY&&r.setTranslate(t,{top:e.top,left:e.left,width:s.width*e.scaleX,height:s.height*e.scaleY,scaleX:1,scaleY:1}):!0!==a&&t.removeClass(e),n.isFunction(i)&&i(c))}),n.isNumeric(o)&&t.css("transition-duration",o+"ms"),n.isPlainObject(e)?(void 0!==e.scaleX&&void 0!==e.scaleY&&(delete e.width,delete e.height,t.parent().hasClass("fancybox-slide--image")&&t.parent().addClass("fancybox-is-scaling")),n.fancybox.setTranslate(t,e)):t.addClass(e),t.data("timer",setTimeout(function(){t.trigger(f)},o+33))},stop:function(t,e){t&&t.length&&(clearTimeout(t.data("timer")),e&&t.trigger(f),t.off(f).css("transition-duration",""),t.parent().removeClass("fancybox-is-scaling"))}},n.fn.fancybox=function(t){var e;return t=t||{},e=t.selector||!1,e?n("body").off("click.fb-start",e).on("click.fb-start",e,{options:t},i):this.off("click.fb-start").on("click.fb-start",{items:this,options:t},i),this},r.on("click.fb-start","[data-fancybox]",i),r.on("click.fb-start","[data-fancybox-trigger]",function(t){n('[data-fancybox="'+n(this).attr("data-fancybox-trigger")+'"]').eq(n(this).attr("data-fancybox-index")||0).trigger("click.fb-start",{$trigger:n(this)})}),function(){var t=null;r.on("mousedown mouseup focus blur",".fancybox-button",function(e){switch(e.type){case"mousedown":t=n(this);break;case"mouseup":t=null;break;case"focusin":n(".fancybox-button").removeClass("fancybox-focus"),n(this).is(t)||n(this).is("[disabled]")||n(this).addClass("fancybox-focus");break;case"focusout":n(".fancybox-button").removeClass("fancybox-focus")}})}()}}(window,document,jQuery),function(t){"use strict";var e={youtube:{matcher:/(youtube\.com|youtu\.be|youtube\-nocookie\.com)\/(watch\?(.*&)?v=|v\/|u\/|embed\/?)?(videoseries\?list=(.*)|[\w-]{11}|\?listType=(.*)&list=(.*))(.*)/i,params:{autoplay:1,autohide:1,fs:1,rel:0,hd:1,wmode:"transparent",enablejsapi:1,html5:1},paramPlace:8,type:"iframe",url:"https://www.youtube-nocookie.com/embed/$4",thumb:"https://img.youtube.com/vi/$4/hqdefault.jpg"},vimeo:{matcher:/^.+vimeo.com\/(.*\/)?([\d]+)(.*)?/,params:{autoplay:1,hd:1,show_title:1,show_byline:1,show_portrait:0,fullscreen:1},paramPlace:3,type:"iframe",url:"//player.vimeo.com/video/$2"},instagram:{matcher:/(instagr\.am|instagram\.com)\/p\/([a-zA-Z0-9_\-]+)\/?/i,type:"image",url:"//$1/p/$2/media/?size=l"},gmap_place:{matcher:/(maps\.)?google\.([a-z]{2,3}(\.[a-z]{2})?)\/(((maps\/(place\/(.*)\/)?\@(.*),(\d+.?\d+?)z))|(\?ll=))(.*)?/i,type:"iframe",url:function(t){return"//maps.google."+t[2]+"/?ll="+(t[9]?t[9]+"&z="+Math.floor(t[10])+(t[12]?t[12].replace(/^\//,"&"):""):t[12]+"").replace(/\?/,"&")+"&output="+(t[12]&&t[12].indexOf("layer=c")>0?"svembed":"embed")}},gmap_search:{matcher:/(maps\.)?google\.([a-z]{2,3}(\.[a-z]{2})?)\/(maps\/search\/)(.*)/i,type:"iframe",url:function(t){return"//maps.google."+t[2]+"/maps?q="+t[5].replace("query=","q=").replace("api=1","")+"&output=embed"}}},n=function(e,n,o){if(e)return o=o||"","object"===t.type(o)&&(o=t.param(o,!0)),t.each(n,function(t,n){e=e.replace("$"+t,n||"")}),o.length&&(e+=(e.indexOf("?")>0?"&":"?")+o),e};t(document).on("objectNeedsType.fb",function(o,i,a){var s,r,c,l,d,u,f,p=a.src||"",h=!1;s=t.extend(!0,{},e,a.opts.media),t.each(s,function(e,o){if(c=p.match(o.matcher)){if(h=o.type,f=e,u={},o.paramPlace&&c[o.paramPlace]){d=c[o.paramPlace],"?"==d[0]&&(d=d.substring(1)),d=d.split("&");for(var i=0;i
1&&("youtube"===n.contentSource||"vimeo"===n.contentSource)&&o.load(n.contentSource)}})}(jQuery),function(t,e,n){"use strict";var o=function(){return t.requestAnimationFrame||t.webkitRequestAnimationFrame||t.mozRequestAnimationFrame||t.oRequestAnimationFrame||function(e){return t.setTimeout(e,1e3/60)}}(),i=function(){return t.cancelAnimationFrame||t.webkitCancelAnimationFrame||t.mozCancelAnimationFrame||t.oCancelAnimationFrame||function(e){t.clearTimeout(e)}}(),a=function(e){var n=[];e=e.originalEvent||e||t.e,e=e.touches&&e.touches.length?e.touches:e.changedTouches&&e.changedTouches.length?e.changedTouches:[e];for(var o in e)e[o].pageX?n.push({x:e[o].pageX,y:e[o].pageY}):e[o].clientX&&n.push({x:e[o].clientX,y:e[o].clientY});return n},s=function(t,e,n){return e&&t?"x"===n?t.x-e.x:"y"===n?t.y-e.y:Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2)):0},r=function(t){if(t.is('a,area,button,[role="button"],input,label,select,summary,textarea,video,audio,iframe')||n.isFunction(t.get(0).onclick)||t.data("selectable"))return!0;for(var e=0,o=t[0].attributes,i=o.length;ee.clientHeight,a=("scroll"===o||"auto"===o)&&e.scrollWidth>e.clientWidth;return i||a},l=function(t){for(var e=!1;;){if(e=c(t.get(0)))break;if(t=t.parent(),!t.length||t.hasClass("fancybox-stage")||t.is("body"))break}return e},d=function(t){var e=this;e.instance=t,e.$bg=t.$refs.bg,e.$stage=t.$refs.stage,e.$container=t.$refs.container,e.destroy(),e.$container.on("touchstart.fb.touch mousedown.fb.touch",n.proxy(e,"ontouchstart"))};d.prototype.destroy=function(){var t=this;t.$container.off(".fb.touch"),n(e).off(".fb.touch"),t.requestId&&(i(t.requestId),t.requestId=null),t.tapped&&(clearTimeout(t.tapped),t.tapped=null)},d.prototype.ontouchstart=function(o){var i=this,c=n(o.target),d=i.instance,u=d.current,f=u.$slide,p=u.$content,h="touchstart"==o.type;if(h&&i.$container.off("mousedown.fb.touch"),(!o.originalEvent||2!=o.originalEvent.button)&&f.length&&c.length&&!r(c)&&!r(c.parent())&&(c.is("img")||!(o.originalEvent.clientX>c[0].clientWidth+c.offset().left))){if(!u||d.isAnimating||u.$slide.hasClass("fancybox-animated"))return o.stopPropagation(),void o.preventDefault();i.realPoints=i.startPoints=a(o),i.startPoints.length&&(u.touch&&o.stopPropagation(),i.startEvent=o,i.canTap=!0,i.$target=c,i.$content=p,i.opts=u.opts.touch,i.isPanning=!1,i.isSwiping=!1,i.isZooming=!1,i.isScrolling=!1,i.canPan=d.canPan(),i.startTime=(new Date).getTime(),i.distanceX=i.distanceY=i.distance=0,i.canvasWidth=Math.round(f[0].clientWidth),i.canvasHeight=Math.round(f[0].clientHeight),i.contentLastPos=null,i.contentStartPos=n.fancybox.getTranslate(i.$content)||{top:0,left:0},i.sliderStartPos=n.fancybox.getTranslate(f),i.stagePos=n.fancybox.getTranslate(d.$refs.stage),i.sliderStartPos.top-=i.stagePos.top,i.sliderStartPos.left-=i.stagePos.left,i.contentStartPos.top-=i.stagePos.top,i.contentStartPos.left-=i.stagePos.left,n(e).off(".fb.touch").on(h?"touchend.fb.touch touchcancel.fb.touch":"mouseup.fb.touch mouseleave.fb.touch",n.proxy(i,"ontouchend")).on(h?"touchmove.fb.touch":"mousemove.fb.touch",n.proxy(i,"ontouchmove")),n.fancybox.isMobile&&e.addEventListener("scroll",i.onscroll,!0),((i.opts||i.canPan)&&(c.is(i.$stage)||i.$stage.find(c).length)||(c.is(".fancybox-image")&&o.preventDefault(),n.fancybox.isMobile&&c.parents(".fancybox-caption").length))&&(i.isScrollable=l(c)||l(c.parent()),n.fancybox.isMobile&&i.isScrollable||o.preventDefault(),(1===i.startPoints.length||u.hasError)&&(i.canPan?(n.fancybox.stop(i.$content),i.isPanning=!0):i.isSwiping=!0,i.$container.addClass("fancybox-is-grabbing")),2===i.startPoints.length&&"image"===u.type&&(u.isLoaded||u.$ghost)&&(i.canTap=!1,i.isSwiping=!1,i.isPanning=!1,i.isZooming=!0,n.fancybox.stop(i.$content),i.centerPointStartX=.5*(i.startPoints[0].x+i.startPoints[1].x)-n(t).scrollLeft(),i.centerPointStartY=.5*(i.startPoints[0].y+i.startPoints[1].y)-n(t).scrollTop(),i.percentageOfImageAtPinchPointX=(i.centerPointStartX-i.contentStartPos.left)/i.contentStartPos.width,i.percentageOfImageAtPinchPointY=(i.centerPointStartY-i.contentStartPos.top)/i.contentStartPos.height,i.startDistanceBetweenFingers=s(i.startPoints[0],i.startPoints[1]))))}},d.prototype.onscroll=function(t){var n=this;n.isScrolling=!0,e.removeEventListener("scroll",n.onscroll,!0)},d.prototype.ontouchmove=function(t){var e=this;return void 0!==t.originalEvent.buttons&&0===t.originalEvent.buttons?void e.ontouchend(t):e.isScrolling?void(e.canTap=!1):(e.newPoints=a(t),void((e.opts||e.canPan)&&e.newPoints.length&&e.newPoints.length&&(e.isSwiping&&!0===e.isSwiping||t.preventDefault(),e.distanceX=s(e.newPoints[0],e.startPoints[0],"x"),e.distanceY=s(e.newPoints[0],e.startPoints[0],"y"),e.distance=s(e.newPoints[0],e.startPoints[0]),e.distance>0&&(e.isSwiping?e.onSwipe(t):e.isPanning?e.onPan():e.isZooming&&e.onZoom()))))},d.prototype.onSwipe=function(e){var a,s=this,r=s.instance,c=s.isSwiping,l=s.sliderStartPos.left||0;if(!0!==c)"x"==c&&(s.distanceX>0&&(s.instance.group.length<2||0===s.instance.current.index&&!s.instance.current.opts.loop)?l+=Math.pow(s.distanceX,.8):s.distanceX<0&&(s.instance.group.length<2||s.instance.current.index===s.instance.group.length-1&&!s.instance.current.opts.loop)?l-=Math.pow(-s.distanceX,.8):l+=s.distanceX),s.sliderLastPos={top:"x"==c?0:s.sliderStartPos.top+s.distanceY,left:l},s.requestId&&(i(s.requestId),s.requestId=null),s.requestId=o(function(){s.sliderLastPos&&(n.each(s.instance.slides,function(t,e){var o=e.pos-s.instance.currPos;n.fancybox.setTranslate(e.$slide,{top:s.sliderLastPos.top,left:s.sliderLastPos.left+o*s.canvasWidth+o*e.opts.gutter})}),s.$container.addClass("fancybox-is-sliding"))});else if(Math.abs(s.distance)>10){if(s.canTap=!1,r.group.length<2&&s.opts.vertical?s.isSwiping="y":r.isDragging||!1===s.opts.vertical||"auto"===s.opts.vertical&&n(t).width()>800?s.isSwiping="x":(a=Math.abs(180*Math.atan2(s.distanceY,s.distanceX)/Math.PI),s.isSwiping=a>45&&a<135?"y":"x"),"y"===s.isSwiping&&n.fancybox.isMobile&&s.isScrollable)return void(s.isScrolling=!0);r.isDragging=s.isSwiping,s.startPoints=s.newPoints,n.each(r.slides,function(t,e){var o,i;n.fancybox.stop(e.$slide),o=n.fancybox.getTranslate(e.$slide),i=n.fancybox.getTranslate(r.$refs.stage),e.$slide.css({transform:"",opacity:"","transition-duration":""}).removeClass("fancybox-animated").removeClass(function(t,e){return(e.match(/(^|\s)fancybox-fx-\S+/g)||[]).join(" ")}),e.pos===r.current.pos&&(s.sliderStartPos.top=o.top-i.top,s.sliderStartPos.left=o.left-i.left),n.fancybox.setTranslate(e.$slide,{top:o.top-i.top,left:o.left-i.left})}),r.SlideShow&&r.SlideShow.isActive&&r.SlideShow.stop()}},d.prototype.onPan=function(){var t=this;if(s(t.newPoints[0],t.realPoints[0])<(n.fancybox.isMobile?10:5))return void(t.startPoints=t.newPoints);t.canTap=!1,t.contentLastPos=t.limitMovement(),t.requestId&&i(t.requestId),t.requestId=o(function(){n.fancybox.setTranslate(t.$content,t.contentLastPos)})},d.prototype.limitMovement=function(){var t,e,n,o,i,a,s=this,r=s.canvasWidth,c=s.canvasHeight,l=s.distanceX,d=s.distanceY,u=s.contentStartPos,f=u.left,p=u.top,h=u.width,g=u.height;return i=h>r?f+l:f,a=p+d,t=Math.max(0,.5*r-.5*h),e=Math.max(0,.5*c-.5*g),n=Math.min(r-h,.5*r-.5*h),o=Math.min(c-g,.5*c-.5*g),l>0&&i>t&&(i=t-1+Math.pow(-t+f+l,.8)||0),l<0&&i0&&a>e&&(a=e-1+Math.pow(-e+p+d,.8)||0),d<0&&aa?(t=t>0?0:t,t=ts?(e=e>0?0:e,e=e1&&(o.dMs>130&&s>10||s>50);o.sliderLastPos=null,"y"==t&&!e&&Math.abs(o.distanceY)>50?(n.fancybox.animate(o.instance.current.$slide,{top:o.sliderStartPos.top+o.distanceY+150*o.velocityY,opacity:0},200),i=o.instance.close(!0,250)):r&&o.distanceX>0?i=o.instance.previous(300):r&&o.distanceX<0&&(i=o.instance.next(300)),!1!==i||"x"!=t&&"y"!=t||o.instance.centerSlide(200),o.$container.removeClass("fancybox-is-sliding")},d.prototype.endPanning=function(){var t,e,o,i=this;i.contentLastPos&&(!1===i.opts.momentum||i.dMs>350?(t=i.contentLastPos.left,e=i.contentLastPos.top):(t=i.contentLastPos.left+500*i.velocityX,e=i.contentLastPos.top+500*i.velocityY),o=i.limitPosition(t,e,i.contentStartPos.width,i.contentStartPos.height),o.width=i.contentStartPos.width,o.height=i.contentStartPos.height,n.fancybox.animate(i.$content,o,366))},d.prototype.endZooming=function(){var t,e,o,i,a=this,s=a.instance.current,r=a.newWidth,c=a.newHeight;a.contentLastPos&&(t=a.contentLastPos.left,e=a.contentLastPos.top,i={top:e,left:t,width:r,height:c,scaleX:1,scaleY:1},n.fancybox.setTranslate(a.$content,i),rs.width||c>s.height?a.instance.scaleToActual(a.centerPointStartX,a.centerPointStartY,150):(o=a.limitPosition(t,e,r,c),n.fancybox.animate(a.$content,o,150)))},d.prototype.onTap=function(e){var o,i=this,s=n(e.target),r=i.instance,c=r.current,l=e&&a(e)||i.startPoints,d=l[0]?l[0].x-n(t).scrollLeft()-i.stagePos.left:0,u=l[0]?l[0].y-n(t).scrollTop()-i.stagePos.top:0,f=function(t){var o=c.opts[t];if(n.isFunction(o)&&(o=o.apply(r,[c,e])),o)switch(o){case"close":r.close(i.startEvent);break;case"toggleControls":r.toggleControls();break;case"next":r.next();break;case"nextOrClose":r.group.length>1?r.next():r.close(i.startEvent);break;case"zoom":"image"==c.type&&(c.isLoaded||c.$ghost)&&(r.canPan()?r.scaleToFit():r.isScaledDown()?r.scaleToActual(d,u):r.group.length<2&&r.close(i.startEvent))}};if((!e.originalEvent||2!=e.originalEvent.button)&&(s.is("img")||!(d>s[0].clientWidth+s.offset().left))){if(s.is(".fancybox-bg,.fancybox-inner,.fancybox-outer,.fancybox-container"))o="Outside";else if(s.is(".fancybox-slide"))o="Slide";else{if(!r.current.$content||!r.current.$content.find(s).addBack().filter(s).length)return;o="Content"}if(i.tapped){if(clearTimeout(i.tapped),i.tapped=null,Math.abs(d-i.tapX)>50||Math.abs(u-i.tapY)>50)return this;f("dblclick"+o)}else i.tapX=d,i.tapY=u,c.opts["dblclick"+o]&&c.opts["dblclick"+o]!==c.opts["click"+o]?i.tapped=setTimeout(function(){i.tapped=null,r.isAnimating||f("click"+o)},500):f("click"+o);return this}},n(e).on("onActivate.fb",function(t,e){e&&!e.Guestures&&(e.Guestures=new d(e))}).on("beforeClose.fb",function(t,e){e&&e.Guestures&&e.Guestures.destroy()})}(window,document,jQuery),function(t,e){"use strict";e.extend(!0,e.fancybox.defaults,{btnTpl:{slideShow:' '},slideShow:{autoStart:!1,speed:3e3,progress:!0}});var n=function(t){this.instance=t,this.init()};e.extend(n.prototype,{timer:null,isActive:!1,$button:null,init:function(){var t=this,n=t.instance,o=n.group[n.currIndex].opts.slideShow;t.$button=n.$refs.toolbar.find("[data-fancybox-play]").on("click",function(){t.toggle()}),n.group.length<2||!o?t.$button.hide():o.progress&&(t.$progress=e('
').appendTo(n.$refs.inner))},set:function(t){var n=this,o=n.instance,i=o.current;i&&(!0===t||i.opts.loop||o.currIndex '},fullScreen:{autoStart:!1}}),e(t).on(n.fullscreenchange,function(){var t=o.isFullscreen(),n=e.fancybox.getInstance();n&&(n.current&&"image"===n.current.type&&n.isAnimating&&(n.isAnimating=!1,n.update(!0,!0,0),n.isComplete||n.complete()),n.trigger("onFullscreenChange",t),n.$refs.container.toggleClass("fancybox-is-fullscreen",t),n.$refs.toolbar.find("[data-fancybox-fullscreen]").toggleClass("fancybox-button--fsenter",!t).toggleClass("fancybox-button--fsexit",t))})}e(t).on({"onInit.fb":function(t,e){var i;if(!n)return void e.$refs.toolbar.find("[data-fancybox-fullscreen]").remove();e&&e.group[e.currIndex].opts.fullScreen?(i=e.$refs.container,i.on("click.fb-fullscreen","[data-fancybox-fullscreen]",function(t){t.stopPropagation(),t.preventDefault(),o.toggle()}),e.opts.fullScreen&&!0===e.opts.fullScreen.autoStart&&o.request(),e.FullScreen=o):e&&e.$refs.toolbar.find("[data-fancybox-fullscreen]").hide()},"afterKeydown.fb":function(t,e,n,o,i){e&&e.FullScreen&&70===i&&(o.preventDefault(),e.FullScreen.toggle())},"beforeClose.fb":function(t,e){e&&e.FullScreen&&e.$refs.container.hasClass("fancybox-is-fullscreen")&&o.exit()}})}(document,jQuery),function(t,e){"use strict";var n="fancybox-thumbs";e.fancybox.defaults=e.extend(!0,{btnTpl:{thumbs:' '},thumbs:{autoStart:!1,hideOnClose:!0,parentEl:".fancybox-container",axis:"y"}},e.fancybox.defaults);var o=function(t){this.init(t)};e.extend(o.prototype,{$button:null,$grid:null,$list:null,isVisible:!1,isActive:!1,init:function(t){var e=this,n=t.group,o=0;e.instance=t,e.opts=n[t.currIndex].opts.thumbs,t.Thumbs=e,e.$button=t.$refs.toolbar.find("[data-fancybox-thumbs]");for(var i=0,a=n.length;i1));i++);o>1&&e.opts?(e.$button.removeAttr("style").on("click",function(){e.toggle()}),e.isActive=!0):e.$button.hide()},create:function(){var t,o=this,i=o.instance,a=o.opts.parentEl,s=[];o.$grid||(o.$grid=e('
').appendTo(i.$refs.container.find(a).addBack().filter(a)),o.$grid.on("click","a",function(){i.jumpTo(e(this).attr("data-index"))})),o.$list||(o.$list=e('').appendTo(o.$grid)),e.each(i.group,function(e,n){t=n.thumb,t||"image"!==n.type||(t=n.src),s.push('
")}),o.$list[0].innerHTML=s.join(""),"x"===o.opts.axis&&o.$list.width(parseInt(o.$grid.css("padding-right"),10)+i.group.length*o.$list.children().eq(0).outerWidth(!0))},focus:function(t){var e,n,o=this,i=o.$list,a=o.$grid;o.instance.current&&(e=i.children().removeClass("fancybox-thumbs-active").filter('[data-index="'+o.instance.current.index+'"]').addClass("fancybox-thumbs-active"),n=e.position(),"y"===o.opts.axis&&(n.top<0||n.top>i.height()-e.outerHeight())?i.stop().animate({scrollTop:i.scrollTop()+n.top},t):"x"===o.opts.axis&&(n.left
a.scrollLeft()+(a.width()-e.outerWidth()))&&i.parent().stop().animate({scrollLeft:n.left},t))},update:function(){var t=this;t.instance.$refs.container.toggleClass("fancybox-show-thumbs",this.isVisible),t.isVisible?(t.$grid||t.create(),t.instance.trigger("onThumbsShow"),t.focus(0)):t.$grid&&t.instance.trigger("onThumbsHide"),t.instance.update()},hide:function(){this.isVisible=!1,this.update()},show:function(){this.isVisible=!0,this.update()},toggle:function(){this.isVisible=!this.isVisible,this.update()}}),e(t).on({"onInit.fb":function(t,e){var n;e&&!e.Thumbs&&(n=new o(e),n.isActive&&!0===n.opts.autoStart&&n.show())},"beforeShow.fb":function(t,e,n,o){var i=e&&e.Thumbs;i&&i.isVisible&&i.focus(o?0:250)},"afterKeydown.fb":function(t,e,n,o,i){var a=e&&e.Thumbs;a&&a.isActive&&71===i&&(o.preventDefault(),a.toggle())},"beforeClose.fb":function(t,e){var n=e&&e.Thumbs;n&&n.isVisible&&!1!==n.opts.hideOnClose&&n.$grid.hide()}})}(document,jQuery),function(t,e){"use strict";function n(t){var e={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/","`":"`","=":"="};return String(t).replace(/[&<>"'`=\/]/g,function(t){return e[t]})}e.extend(!0,e.fancybox.defaults,{btnTpl:{share:' '},share:{url:function(t,e){return!t.currentHash&&"inline"!==e.type&&"html"!==e.type&&(e.origSrc||e.src)||window.location},
+tpl:''}}),e(t).on("click","[data-fancybox-share]",function(){var t,o,i=e.fancybox.getInstance(),a=i.current||null;a&&("function"===e.type(a.opts.share.url)&&(t=a.opts.share.url.apply(a,[i,a])),o=a.opts.share.tpl.replace(/\{\{media\}\}/g,"image"===a.type?encodeURIComponent(a.src):"").replace(/\{\{url\}\}/g,encodeURIComponent(t)).replace(/\{\{url_raw\}\}/g,n(t)).replace(/\{\{descr\}\}/g,i.$caption?encodeURIComponent(i.$caption.text()):""),e.fancybox.open({src:i.translate(i,o),type:"html",opts:{touch:!1,animationEffect:!1,afterLoad:function(t,e){i.$refs.container.one("beforeClose.fb",function(){t.close(null,0)}),e.$content.find(".fancybox-share__button").click(function(){return window.open(this.href,"Share","width=550, height=450"),!1})},mobile:{autoFocus:!1}}}))})}(document,jQuery),function(t,e,n){"use strict";function o(){var e=t.location.hash.substr(1),n=e.split("-"),o=n.length>1&&/^\+?\d+$/.test(n[n.length-1])?parseInt(n.pop(-1),10)||1:1,i=n.join("-");return{hash:e,index:o<1?1:o,gallery:i}}function i(t){""!==t.gallery&&n("[data-fancybox='"+n.escapeSelector(t.gallery)+"']").eq(t.index-1).focus().trigger("click.fb-start")}function a(t){var e,n;return!!t&&(e=t.current?t.current.opts:t.opts,""!==(n=e.hash||(e.$orig?e.$orig.data("fancybox")||e.$orig.data("fancybox-trigger"):""))&&n)}n.escapeSelector||(n.escapeSelector=function(t){return(t+"").replace(/([\0-\x1f\x7f]|^-?\d)|^-$|[^\x80-\uFFFF\w-]/g,function(t,e){return e?"\0"===t?"�":t.slice(0,-1)+"\\"+t.charCodeAt(t.length-1).toString(16)+" ":"\\"+t})}),n(function(){!1!==n.fancybox.defaults.hash&&(n(e).on({"onInit.fb":function(t,e){var n,i;!1!==e.group[e.currIndex].opts.hash&&(n=o(),(i=a(e))&&n.gallery&&i==n.gallery&&(e.currIndex=n.index-1))},"beforeShow.fb":function(n,o,i,s){var r;i&&!1!==i.opts.hash&&(r=a(o))&&(o.currentHash=r+(o.group.length>1?"-"+(i.index+1):""),t.location.hash!=="#"+o.currentHash&&(s&&!o.origHash&&(o.origHash=t.location.hash),o.hashTimer&&clearTimeout(o.hashTimer),o.hashTimer=setTimeout(function(){"replaceState"in t.history?(t.history[s?"pushState":"replaceState"]({},e.title,t.location.pathname+t.location.search+"#"+o.currentHash),s&&(o.hasCreatedHistory=!0)):t.location.hash=o.currentHash,o.hashTimer=null},300)))},"beforeClose.fb":function(n,o,i){i&&!1!==i.opts.hash&&(clearTimeout(o.hashTimer),o.currentHash&&o.hasCreatedHistory?t.history.back():o.currentHash&&("replaceState"in t.history?t.history.replaceState({},e.title,t.location.pathname+t.location.search+(o.origHash||"")):t.location.hash=o.origHash),o.currentHash=null)}}),n(t).on("hashchange.fb",function(){var t=o(),e=null;n.each(n(".fancybox-container").get().reverse(),function(t,o){var i=n(o).data("FancyBox");if(i&&i.currentHash)return e=i,!1}),e?e.currentHash===t.gallery+"-"+t.index||1===t.index&&e.currentHash==t.gallery||(e.currentHash=null,e.close()):""!==t.gallery&&i(t)}),setTimeout(function(){n.fancybox.getInstance()||i(o())},50))})}(window,document,jQuery),function(t,e){"use strict";var n=(new Date).getTime();e(t).on({"onInit.fb":function(t,e,o){e.$refs.stage.on("mousewheel DOMMouseScroll wheel MozMousePixelScroll",function(t){var o=e.current,i=(new Date).getTime();e.group.length<2||!1===o.opts.wheel||"auto"===o.opts.wheel&&"image"!==o.type||(t.preventDefault(),t.stopPropagation(),o.$slide.hasClass("fancybox-animated")||(t=t.originalEvent||t,i-n<250||(n=i,e[(-t.deltaY||-t.deltaX||t.wheelDelta||-t.detail)<0?"next":"previous"]())))})}})}(document,jQuery);
\ No newline at end of file
diff --git a/public/img/404.avif b/public/img/404.avif
new file mode 100644
index 0000000..4906e12
Binary files /dev/null and b/public/img/404.avif differ
diff --git a/public/img/KR.png b/public/img/KR.png
new file mode 100644
index 0000000..4471193
Binary files /dev/null and b/public/img/KR.png differ
diff --git a/public/img/avatar.avif b/public/img/avatar.avif
new file mode 100644
index 0000000..7c56376
Binary files /dev/null and b/public/img/avatar.avif differ
diff --git a/public/img/default.avif b/public/img/default.avif
new file mode 100644
index 0000000..551dcf1
Binary files /dev/null and b/public/img/default.avif differ
diff --git a/public/img/error_load.avif b/public/img/error_load.avif
new file mode 100644
index 0000000..7be8d4d
Binary files /dev/null and b/public/img/error_load.avif differ
diff --git a/public/img/flower.gif b/public/img/flower.gif
new file mode 100644
index 0000000..43559d7
Binary files /dev/null and b/public/img/flower.gif differ
diff --git a/public/img/happy-sticker.avif b/public/img/happy-sticker.avif
new file mode 100644
index 0000000..622a90d
Binary files /dev/null and b/public/img/happy-sticker.avif differ
diff --git a/public/img/loading.avif b/public/img/loading.avif
new file mode 100644
index 0000000..81039f4
Binary files /dev/null and b/public/img/loading.avif differ
diff --git a/public/img/logo.png b/public/img/logo.png
new file mode 100644
index 0000000..34ba403
Binary files /dev/null and b/public/img/logo.png differ
diff --git a/public/img/pwa/KR.png b/public/img/pwa/KR.png
new file mode 100644
index 0000000..81390c1
Binary files /dev/null and b/public/img/pwa/KR.png differ
diff --git a/public/img/pwa/favicon.ico b/public/img/pwa/favicon.ico
new file mode 100644
index 0000000..b06b5be
Binary files /dev/null and b/public/img/pwa/favicon.ico differ
diff --git a/public/img/pwa/favicon_16.ico b/public/img/pwa/favicon_16.ico
new file mode 100644
index 0000000..e25d23e
Binary files /dev/null and b/public/img/pwa/favicon_16.ico differ
diff --git a/public/img/pwa/favicon_32.ico b/public/img/pwa/favicon_32.ico
new file mode 100644
index 0000000..0bdf3bb
Binary files /dev/null and b/public/img/pwa/favicon_32.ico differ
diff --git a/public/img/recent_c.avif b/public/img/recent_c.avif
new file mode 100644
index 0000000..281a57b
Binary files /dev/null and b/public/img/recent_c.avif differ
diff --git a/public/index.html b/public/index.html
new file mode 100644
index 0000000..6826725
--- /dev/null
+++ b/public/index.html
@@ -0,0 +1,172 @@
+基沃托斯铁道公团 KivotosRailway 开启JavaScript才能访问本站哦~
\ No newline at end of file
diff --git a/public/js/covercolor/api.js b/public/js/covercolor/api.js
new file mode 100644
index 0000000..bada6df
--- /dev/null
+++ b/public/js/covercolor/api.js
@@ -0,0 +1,59 @@
+const coverColor = () => {
+ const path = document.getElementById("post-cover")?.src;
+ path ? handleApiColor(path) : setDefaultThemeColors();
+}
+
+function handleApiColor(path) {
+ const cacheGroup = JSON.parse(localStorage.getItem('Solitude')) || {};
+ cacheGroup.postcolor && cacheGroup.postcolor[path] ? setThemeColors(cacheGroup.postcolor[path].value) : img2color(path);
+}
+
+function img2color(src) {
+ fetch(coverColorConfig.api + encodeURIComponent(src))
+ .then(response => response.json())
+ .then(data => {
+ setThemeColors(data.RGB);
+ cacheColor(src, data.RGB);
+ })
+ .catch(console.error);
+}
+
+function setThemeColors(value) {
+ if (value) {
+ const [r, g, b] = value.match(/\w\w/g).map(x => parseInt(x, 16));
+ document.documentElement.style.setProperty('--efu-main', value);
+ document.documentElement.style.setProperty('--efu-main-op', value + '23');
+ document.documentElement.style.setProperty('--efu-main-op-deep', value + 'dd');
+ document.documentElement.style.setProperty('--efu-main-none', value + '00');
+ adjustBrightness(r, g, b);
+ document.getElementById("coverdiv").classList.add("loaded");
+ initThemeColor();
+ } else {
+ setDefaultThemeColors();
+ }
+}
+
+function setDefaultThemeColors() {
+ document.documentElement.style.setProperty('--efu-main', 'var(--efu-theme)');
+ document.documentElement.style.setProperty('--efu-main-op', 'var(--efu-theme-op)');
+ document.documentElement.style.setProperty('--efu-main-op-deep', 'var(--efu-theme-op-deep)');
+ document.documentElement.style.setProperty('--efu-main-none', 'var(--efu-theme-none)');
+ initThemeColor();
+}
+
+function cacheColor(src, color) {
+ const cacheGroup = JSON.parse(localStorage.getItem('Solitude')) || {};
+ cacheGroup.postcolor = cacheGroup.postcolor || {};
+ cacheGroup.postcolor[src] = {value: color, expiration: Date.now() + coverColorConfig.time};
+ localStorage.setItem('Solitude', JSON.stringify(cacheGroup));
+}
+
+function adjustBrightness(r, g, b) {
+ if (Math.round(((r * 299) + (g * 587) + (b * 114)) / 1000) < 125) {
+ [...document.getElementsByClassName('card-content')].forEach(item => item.style.setProperty('--efu-card-bg', 'var(--efu-white)'));
+ [...document.getElementsByClassName('author-info__sayhi')].forEach(item => {
+ item.style.setProperty('background', 'var(--efu-white-op)');
+ item.style.setProperty('color', 'var(--efu-white)');
+ });
+ }
+}
\ No newline at end of file
diff --git a/public/js/covercolor/local.js b/public/js/covercolor/local.js
new file mode 100644
index 0000000..760f2d7
--- /dev/null
+++ b/public/js/covercolor/local.js
@@ -0,0 +1,136 @@
+const coverColor = () => {
+ const path = document.getElementById("post-cover")?.src;
+ path ? localColor(path) : setDefaultThemeColors();
+}
+
+function setDefaultThemeColors() {
+ document.documentElement.style.setProperty('--efu-main', 'var(--efu-theme)');
+ document.documentElement.style.setProperty('--efu-main-op', 'var(--efu-theme-op)');
+ document.documentElement.style.setProperty('--efu-main-op-deep', 'var(--efu-theme-op-deep)');
+ document.documentElement.style.setProperty('--efu-main-none', 'var(--efu-theme-none)');
+ initThemeColor();
+}
+
+const localColor = path => {
+ const img = new Image();
+ img.crossOrigin = "Anonymous";
+ img.onload = () => setThemeColors(calculateColor(img));
+ img.onerror = () => console.error('Image Error');
+ img.src = path;
+}
+
+const calculateColor = img => {
+ const canvas = document.createElement("canvas");
+ const ctx = canvas.getContext("2d");
+ ctx.drawImage(img, 0, 0);
+ const data = ctx.getImageData(0, 0, img.width, img.height).data;
+ const {r, g, b} = calculateRGB(data);
+ let value = rgbToHex(r, g, b);
+ return getContrastYIQ(value) === "light" ? LightenDarkenColor(value, -50) : value;
+}
+
+function calculateRGB(data) {
+ let r = 0, g = 0, b = 0;
+ const step = 5;
+ for (let i = 0; i < data.length; i += 4 * step) {
+ r += data[i];
+ g += data[i + 1];
+ b += data[i + 2];
+ }
+ r = Math.floor(r / (data.length / 4 / step));
+ g = Math.floor(g / (data.length / 4 / step));
+ b = Math.floor(b / (data.length / 4 / step));
+ return {r, g, b};
+}
+
+function rgbToHex(r, g, b) {
+ return "#" + [r, g, b].map(x => x.toString(16).padStart(2, '0')).join('');
+}
+
+function LightenDarkenColor(col, amt) {
+ let usePound = false;
+
+ if (col[0] === "#") {
+ col = col.slice(1);
+ usePound = true;
+ }
+
+ const num = parseInt(col, 16);
+ const r = Math.min(255, Math.max(0, (num >> 16) + amt));
+ const b = Math.min(255, Math.max(0, ((num >> 8) & 0xff) + amt));
+ const g = Math.min(255, Math.max(0, (num & 0xff) + amt));
+
+ return `${usePound ? "#" : ""}${(g | (b << 8) | (r << 16)).toString(16).padStart(6, "0")}`;
+}
+
+function getContrastYIQ(hexcolor) {
+ let colorrgb = colorRgb(hexcolor);
+ let colors = colorrgb.match(/^rgb\((\d+),\s*(\d+),\s*(\d+)\)$/);
+ let red = colors[1];
+ let green = colors[2];
+ let blue = colors[3];
+ let brightness = (red * 299) + (green * 587) + (blue * 114);
+ brightness = brightness / 255000;
+ return brightness >= 0.5 ? "light" : "dark";
+}
+
+function colorRgb(str) {
+ const HEX_SHORT_REGEX = /^#([0-9a-fA-f]{3})$/;
+ const HEX_LONG_REGEX = /^#([0-9a-fA-f]{6})$/;
+ const HEX_SHORT_LENGTH = 4;
+
+ if (!str || typeof str !== 'string') {
+ return str;
+ }
+
+ const sColor = str.toLowerCase();
+ let hexValue = "";
+
+ if (sColor && (HEX_SHORT_REGEX.test(sColor) || HEX_LONG_REGEX.test(sColor))) {
+ hexValue = sColor.length === HEX_SHORT_LENGTH ?
+ sColor.replace(/^#(.)/g, "#$1$1") :
+ sColor;
+
+ const rgbValue = hexValue.slice(1)
+ .match(/.{2}/g)
+ .map(val => parseInt(val, 16));
+
+ return `rgb(${rgbValue[0]}, ${rgbValue[1]}, ${rgbValue[2]})`;
+ } else {
+ return sColor;
+ }
+}
+
+function setThemeColors(value, r = null, g = null, b = null) {
+ if (value) {
+ document.documentElement.style.setProperty('--efu-main', value);
+ document.documentElement.style.setProperty('--efu-main-op', value + '23');
+ document.documentElement.style.setProperty('--efu-main-op-deep', value + 'dd');
+ document.documentElement.style.setProperty('--efu-main-none', value + '00');
+
+ if (r && g && b) {
+ let brightness = Math.round(((parseInt(r) * 299) + (parseInt(g) * 587) + (parseInt(b) * 114)) / 1000);
+ if (brightness < 125) {
+ let cardContents = document.getElementsByClassName('card-content');
+ for (let i = 0; i < cardContents.length; i++) {
+ cardContents[i].style.setProperty('--efu-card-bg', 'var(--efu-white)');
+ }
+
+ let authorInfo = document.getElementsByClassName('author-info__sayhi');
+ for (let i = 0; i < authorInfo.length; i++) {
+ authorInfo[i].style.setProperty('background', 'var(--efu-white-op)');
+ authorInfo[i].style.setProperty('color', 'var(--efu-white)');
+ }
+ }
+ }
+
+ document.getElementById("coverdiv").classList.add("loaded");
+ initThemeColor();
+ } else {
+ document.documentElement.style.setProperty('--efu-main', 'var(--efu-theme)');
+ document.documentElement.style.setProperty('--efu-main-op', 'var(--efu-theme-op)');
+ document.documentElement.style.setProperty('--efu-main-op-deep', 'var(--efu-theme-op-deep)');
+ document.documentElement.style.setProperty('--efu-main-none', 'var(--efu-theme-none)');
+ initThemeColor();
+ }
+}
\ No newline at end of file
diff --git a/public/js/jquery-3.6.4.min.js b/public/js/jquery-3.6.4.min.js
new file mode 100644
index 0000000..0de648e
--- /dev/null
+++ b/public/js/jquery-3.6.4.min.js
@@ -0,0 +1,2 @@
+/*! jQuery v3.6.4 | (c) OpenJS Foundation and other contributors | jquery.org/license */
+!function(e,t){"use strict";"object"==typeof module&&"object"==typeof module.exports?module.exports=e.document?t(e,!0):function(e){if(!e.document)throw new Error("jQuery requires a window with a document");return t(e)}:t(e)}("undefined"!=typeof window?window:this,function(C,e){"use strict";var t=[],r=Object.getPrototypeOf,s=t.slice,g=t.flat?function(e){return t.flat.call(e)}:function(e){return t.concat.apply([],e)},u=t.push,i=t.indexOf,n={},o=n.toString,y=n.hasOwnProperty,a=y.toString,l=a.call(Object),v={},m=function(e){return"function"==typeof e&&"number"!=typeof e.nodeType&&"function"!=typeof e.item},x=function(e){return null!=e&&e===e.window},E=C.document,c={type:!0,src:!0,nonce:!0,noModule:!0};function b(e,t,n){var r,i,o=(n=n||E).createElement("script");if(o.text=e,t)for(r in c)(i=t[r]||t.getAttribute&&t.getAttribute(r))&&o.setAttribute(r,i);n.head.appendChild(o).parentNode.removeChild(o)}function w(e){return null==e?e+"":"object"==typeof e||"function"==typeof e?n[o.call(e)]||"object":typeof e}var f="3.6.4",S=function(e,t){return new S.fn.init(e,t)};function p(e){var t=!!e&&"length"in e&&e.length,n=w(e);return!m(e)&&!x(e)&&("array"===n||0===t||"number"==typeof t&&0+~]|"+M+")"+M+"*"),U=new RegExp(M+"|>"),X=new RegExp(F),V=new RegExp("^"+I+"$"),G={ID:new RegExp("^#("+I+")"),CLASS:new RegExp("^\\.("+I+")"),TAG:new RegExp("^("+I+"|[*])"),ATTR:new RegExp("^"+W),PSEUDO:new RegExp("^"+F),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+M+"*(even|odd|(([+-]|)(\\d*)n|)"+M+"*(?:([+-]|)"+M+"*(\\d+)|))"+M+"*\\)|)","i"),bool:new RegExp("^(?:"+R+")$","i"),needsContext:new RegExp("^"+M+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+M+"*((?:-\\d)?\\d*)"+M+"*\\)|)(?=[^-]|$)","i")},Y=/HTML$/i,Q=/^(?:input|select|textarea|button)$/i,J=/^h\d$/i,K=/^[^{]+\{\s*\[native \w/,Z=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,ee=/[+~]/,te=new RegExp("\\\\[\\da-fA-F]{1,6}"+M+"?|\\\\([^\\r\\n\\f])","g"),ne=function(e,t){var n="0x"+e.slice(1)-65536;return t||(n<0?String.fromCharCode(n+65536):String.fromCharCode(n>>10|55296,1023&n|56320))},re=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g,ie=function(e,t){return t?"\0"===e?"\ufffd":e.slice(0,-1)+"\\"+e.charCodeAt(e.length-1).toString(16)+" ":"\\"+e},oe=function(){T()},ae=be(function(e){return!0===e.disabled&&"fieldset"===e.nodeName.toLowerCase()},{dir:"parentNode",next:"legend"});try{H.apply(t=O.call(p.childNodes),p.childNodes),t[p.childNodes.length].nodeType}catch(e){H={apply:t.length?function(e,t){L.apply(e,O.call(t))}:function(e,t){var n=e.length,r=0;while(e[n++]=t[r++]);e.length=n-1}}}function se(t,e,n,r){var i,o,a,s,u,l,c,f=e&&e.ownerDocument,p=e?e.nodeType:9;if(n=n||[],"string"!=typeof t||!t||1!==p&&9!==p&&11!==p)return n;if(!r&&(T(e),e=e||C,E)){if(11!==p&&(u=Z.exec(t)))if(i=u[1]){if(9===p){if(!(a=e.getElementById(i)))return n;if(a.id===i)return n.push(a),n}else if(f&&(a=f.getElementById(i))&&v(e,a)&&a.id===i)return n.push(a),n}else{if(u[2])return H.apply(n,e.getElementsByTagName(t)),n;if((i=u[3])&&d.getElementsByClassName&&e.getElementsByClassName)return H.apply(n,e.getElementsByClassName(i)),n}if(d.qsa&&!N[t+" "]&&(!y||!y.test(t))&&(1!==p||"object"!==e.nodeName.toLowerCase())){if(c=t,f=e,1===p&&(U.test(t)||z.test(t))){(f=ee.test(t)&&ve(e.parentNode)||e)===e&&d.scope||((s=e.getAttribute("id"))?s=s.replace(re,ie):e.setAttribute("id",s=S)),o=(l=h(t)).length;while(o--)l[o]=(s?"#"+s:":scope")+" "+xe(l[o]);c=l.join(",")}try{return H.apply(n,f.querySelectorAll(c)),n}catch(e){N(t,!0)}finally{s===S&&e.removeAttribute("id")}}}return g(t.replace(B,"$1"),e,n,r)}function ue(){var r=[];return function e(t,n){return r.push(t+" ")>b.cacheLength&&delete e[r.shift()],e[t+" "]=n}}function le(e){return e[S]=!0,e}function ce(e){var t=C.createElement("fieldset");try{return!!e(t)}catch(e){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function fe(e,t){var n=e.split("|"),r=n.length;while(r--)b.attrHandle[n[r]]=t}function pe(e,t){var n=t&&e,r=n&&1===e.nodeType&&1===t.nodeType&&e.sourceIndex-t.sourceIndex;if(r)return r;if(n)while(n=n.nextSibling)if(n===t)return-1;return e?1:-1}function de(t){return function(e){return"input"===e.nodeName.toLowerCase()&&e.type===t}}function he(n){return function(e){var t=e.nodeName.toLowerCase();return("input"===t||"button"===t)&&e.type===n}}function ge(t){return function(e){return"form"in e?e.parentNode&&!1===e.disabled?"label"in e?"label"in e.parentNode?e.parentNode.disabled===t:e.disabled===t:e.isDisabled===t||e.isDisabled!==!t&&ae(e)===t:e.disabled===t:"label"in e&&e.disabled===t}}function ye(a){return le(function(o){return o=+o,le(function(e,t){var n,r=a([],e.length,o),i=r.length;while(i--)e[n=r[i]]&&(e[n]=!(t[n]=e[n]))})})}function ve(e){return e&&"undefined"!=typeof e.getElementsByTagName&&e}for(e in d=se.support={},i=se.isXML=function(e){var t=e&&e.namespaceURI,n=e&&(e.ownerDocument||e).documentElement;return!Y.test(t||n&&n.nodeName||"HTML")},T=se.setDocument=function(e){var t,n,r=e?e.ownerDocument||e:p;return r!=C&&9===r.nodeType&&r.documentElement&&(a=(C=r).documentElement,E=!i(C),p!=C&&(n=C.defaultView)&&n.top!==n&&(n.addEventListener?n.addEventListener("unload",oe,!1):n.attachEvent&&n.attachEvent("onunload",oe)),d.scope=ce(function(e){return a.appendChild(e).appendChild(C.createElement("div")),"undefined"!=typeof e.querySelectorAll&&!e.querySelectorAll(":scope fieldset div").length}),d.cssHas=ce(function(){try{return C.querySelector(":has(*,:jqfake)"),!1}catch(e){return!0}}),d.attributes=ce(function(e){return e.className="i",!e.getAttribute("className")}),d.getElementsByTagName=ce(function(e){return e.appendChild(C.createComment("")),!e.getElementsByTagName("*").length}),d.getElementsByClassName=K.test(C.getElementsByClassName),d.getById=ce(function(e){return a.appendChild(e).id=S,!C.getElementsByName||!C.getElementsByName(S).length}),d.getById?(b.filter.ID=function(e){var t=e.replace(te,ne);return function(e){return e.getAttribute("id")===t}},b.find.ID=function(e,t){if("undefined"!=typeof t.getElementById&&E){var n=t.getElementById(e);return n?[n]:[]}}):(b.filter.ID=function(e){var n=e.replace(te,ne);return function(e){var t="undefined"!=typeof e.getAttributeNode&&e.getAttributeNode("id");return t&&t.value===n}},b.find.ID=function(e,t){if("undefined"!=typeof t.getElementById&&E){var n,r,i,o=t.getElementById(e);if(o){if((n=o.getAttributeNode("id"))&&n.value===e)return[o];i=t.getElementsByName(e),r=0;while(o=i[r++])if((n=o.getAttributeNode("id"))&&n.value===e)return[o]}return[]}}),b.find.TAG=d.getElementsByTagName?function(e,t){return"undefined"!=typeof t.getElementsByTagName?t.getElementsByTagName(e):d.qsa?t.querySelectorAll(e):void 0}:function(e,t){var n,r=[],i=0,o=t.getElementsByTagName(e);if("*"===e){while(n=o[i++])1===n.nodeType&&r.push(n);return r}return o},b.find.CLASS=d.getElementsByClassName&&function(e,t){if("undefined"!=typeof t.getElementsByClassName&&E)return t.getElementsByClassName(e)},s=[],y=[],(d.qsa=K.test(C.querySelectorAll))&&(ce(function(e){var t;a.appendChild(e).innerHTML=" ",e.querySelectorAll("[msallowcapture^='']").length&&y.push("[*^$]="+M+"*(?:''|\"\")"),e.querySelectorAll("[selected]").length||y.push("\\["+M+"*(?:value|"+R+")"),e.querySelectorAll("[id~="+S+"-]").length||y.push("~="),(t=C.createElement("input")).setAttribute("name",""),e.appendChild(t),e.querySelectorAll("[name='']").length||y.push("\\["+M+"*name"+M+"*="+M+"*(?:''|\"\")"),e.querySelectorAll(":checked").length||y.push(":checked"),e.querySelectorAll("a#"+S+"+*").length||y.push(".#.+[+~]"),e.querySelectorAll("\\\f"),y.push("[\\r\\n\\f]")}),ce(function(e){e.innerHTML=" ";var t=C.createElement("input");t.setAttribute("type","hidden"),e.appendChild(t).setAttribute("name","D"),e.querySelectorAll("[name=d]").length&&y.push("name"+M+"*[*^$|!~]?="),2!==e.querySelectorAll(":enabled").length&&y.push(":enabled",":disabled"),a.appendChild(e).disabled=!0,2!==e.querySelectorAll(":disabled").length&&y.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),y.push(",.*:")})),(d.matchesSelector=K.test(c=a.matches||a.webkitMatchesSelector||a.mozMatchesSelector||a.oMatchesSelector||a.msMatchesSelector))&&ce(function(e){d.disconnectedMatch=c.call(e,"*"),c.call(e,"[s!='']:x"),s.push("!=",F)}),d.cssHas||y.push(":has"),y=y.length&&new RegExp(y.join("|")),s=s.length&&new RegExp(s.join("|")),t=K.test(a.compareDocumentPosition),v=t||K.test(a.contains)?function(e,t){var n=9===e.nodeType&&e.documentElement||e,r=t&&t.parentNode;return e===r||!(!r||1!==r.nodeType||!(n.contains?n.contains(r):e.compareDocumentPosition&&16&e.compareDocumentPosition(r)))}:function(e,t){if(t)while(t=t.parentNode)if(t===e)return!0;return!1},j=t?function(e,t){if(e===t)return l=!0,0;var n=!e.compareDocumentPosition-!t.compareDocumentPosition;return n||(1&(n=(e.ownerDocument||e)==(t.ownerDocument||t)?e.compareDocumentPosition(t):1)||!d.sortDetached&&t.compareDocumentPosition(e)===n?e==C||e.ownerDocument==p&&v(p,e)?-1:t==C||t.ownerDocument==p&&v(p,t)?1:u?P(u,e)-P(u,t):0:4&n?-1:1)}:function(e,t){if(e===t)return l=!0,0;var n,r=0,i=e.parentNode,o=t.parentNode,a=[e],s=[t];if(!i||!o)return e==C?-1:t==C?1:i?-1:o?1:u?P(u,e)-P(u,t):0;if(i===o)return pe(e,t);n=e;while(n=n.parentNode)a.unshift(n);n=t;while(n=n.parentNode)s.unshift(n);while(a[r]===s[r])r++;return r?pe(a[r],s[r]):a[r]==p?-1:s[r]==p?1:0}),C},se.matches=function(e,t){return se(e,null,null,t)},se.matchesSelector=function(e,t){if(T(e),d.matchesSelector&&E&&!N[t+" "]&&(!s||!s.test(t))&&(!y||!y.test(t)))try{var n=c.call(e,t);if(n||d.disconnectedMatch||e.document&&11!==e.document.nodeType)return n}catch(e){N(t,!0)}return 0":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(te,ne),e[3]=(e[3]||e[4]||e[5]||"").replace(te,ne),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||se.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&se.error(e[0]),e},PSEUDO:function(e){var t,n=!e[6]&&e[2];return G.CHILD.test(e[0])?null:(e[3]?e[2]=e[4]||e[5]||"":n&&X.test(n)&&(t=h(n,!0))&&(t=n.indexOf(")",n.length-t)-n.length)&&(e[0]=e[0].slice(0,t),e[2]=n.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(te,ne).toLowerCase();return"*"===e?function(){return!0}:function(e){return e.nodeName&&e.nodeName.toLowerCase()===t}},CLASS:function(e){var t=m[e+" "];return t||(t=new RegExp("(^|"+M+")"+e+"("+M+"|$)"))&&m(e,function(e){return t.test("string"==typeof e.className&&e.className||"undefined"!=typeof e.getAttribute&&e.getAttribute("class")||"")})},ATTR:function(n,r,i){return function(e){var t=se.attr(e,n);return null==t?"!="===r:!r||(t+="","="===r?t===i:"!="===r?t!==i:"^="===r?i&&0===t.indexOf(i):"*="===r?i&&-1:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i;function j(e,n,r){return m(n)?S.grep(e,function(e,t){return!!n.call(e,t,e)!==r}):n.nodeType?S.grep(e,function(e){return e===n!==r}):"string"!=typeof n?S.grep(e,function(e){return-1)[^>]*|#([\w-]+))$/;(S.fn.init=function(e,t,n){var r,i;if(!e)return this;if(n=n||D,"string"==typeof e){if(!(r="<"===e[0]&&">"===e[e.length-1]&&3<=e.length?[null,e,null]:q.exec(e))||!r[1]&&t)return!t||t.jquery?(t||n).find(e):this.constructor(t).find(e);if(r[1]){if(t=t instanceof S?t[0]:t,S.merge(this,S.parseHTML(r[1],t&&t.nodeType?t.ownerDocument||t:E,!0)),N.test(r[1])&&S.isPlainObject(t))for(r in t)m(this[r])?this[r](t[r]):this.attr(r,t[r]);return this}return(i=E.getElementById(r[2]))&&(this[0]=i,this.length=1),this}return e.nodeType?(this[0]=e,this.length=1,this):m(e)?void 0!==n.ready?n.ready(e):e(S):S.makeArray(e,this)}).prototype=S.fn,D=S(E);var L=/^(?:parents|prev(?:Until|All))/,H={children:!0,contents:!0,next:!0,prev:!0};function O(e,t){while((e=e[t])&&1!==e.nodeType);return e}S.fn.extend({has:function(e){var t=S(e,this),n=t.length;return this.filter(function(){for(var e=0;e\x20\t\r\n\f]*)/i,he=/^$|^module$|\/(?:java|ecma)script/i;ce=E.createDocumentFragment().appendChild(E.createElement("div")),(fe=E.createElement("input")).setAttribute("type","radio"),fe.setAttribute("checked","checked"),fe.setAttribute("name","t"),ce.appendChild(fe),v.checkClone=ce.cloneNode(!0).cloneNode(!0).lastChild.checked,ce.innerHTML="",v.noCloneChecked=!!ce.cloneNode(!0).lastChild.defaultValue,ce.innerHTML=" ",v.option=!!ce.lastChild;var ge={thead:[1,""],col:[2,""],tr:[2,""],td:[3,""],_default:[0,"",""]};function ye(e,t){var n;return n="undefined"!=typeof e.getElementsByTagName?e.getElementsByTagName(t||"*"):"undefined"!=typeof e.querySelectorAll?e.querySelectorAll(t||"*"):[],void 0===t||t&&A(e,t)?S.merge([e],n):n}function ve(e,t){for(var n=0,r=e.length;n",""]);var me=/<|?\w+;/;function xe(e,t,n,r,i){for(var o,a,s,u,l,c,f=t.createDocumentFragment(),p=[],d=0,h=e.length;d\s*$/g;function je(e,t){return A(e,"table")&&A(11!==t.nodeType?t:t.firstChild,"tr")&&S(e).children("tbody")[0]||e}function De(e){return e.type=(null!==e.getAttribute("type"))+"/"+e.type,e}function qe(e){return"true/"===(e.type||"").slice(0,5)?e.type=e.type.slice(5):e.removeAttribute("type"),e}function Le(e,t){var n,r,i,o,a,s;if(1===t.nodeType){if(Y.hasData(e)&&(s=Y.get(e).events))for(i in Y.remove(t,"handle events"),s)for(n=0,r=s[i].length;n").attr(n.scriptAttrs||{}).prop({charset:n.scriptCharset,src:n.url}).on("load error",i=function(e){r.remove(),i=null,e&&t("error"===e.type?404:200,e.type)}),E.head.appendChild(r[0])},abort:function(){i&&i()}}});var Ut,Xt=[],Vt=/(=)\?(?=&|$)|\?\?/;S.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=Xt.pop()||S.expando+"_"+Ct.guid++;return this[e]=!0,e}}),S.ajaxPrefilter("json jsonp",function(e,t,n){var r,i,o,a=!1!==e.jsonp&&(Vt.test(e.url)?"url":"string"==typeof e.data&&0===(e.contentType||"").indexOf("application/x-www-form-urlencoded")&&Vt.test(e.data)&&"data");if(a||"jsonp"===e.dataTypes[0])return r=e.jsonpCallback=m(e.jsonpCallback)?e.jsonpCallback():e.jsonpCallback,a?e[a]=e[a].replace(Vt,"$1"+r):!1!==e.jsonp&&(e.url+=(Et.test(e.url)?"&":"?")+e.jsonp+"="+r),e.converters["script json"]=function(){return o||S.error(r+" was not called"),o[0]},e.dataTypes[0]="json",i=C[r],C[r]=function(){o=arguments},n.always(function(){void 0===i?S(C).removeProp(r):C[r]=i,e[r]&&(e.jsonpCallback=t.jsonpCallback,Xt.push(r)),o&&m(i)&&i(o[0]),o=i=void 0}),"script"}),v.createHTMLDocument=((Ut=E.implementation.createHTMLDocument("").body).innerHTML="",2===Ut.childNodes.length),S.parseHTML=function(e,t,n){return"string"!=typeof e?[]:("boolean"==typeof t&&(n=t,t=!1),t||(v.createHTMLDocument?((r=(t=E.implementation.createHTMLDocument("")).createElement("base")).href=E.location.href,t.head.appendChild(r)):t=E),o=!n&&[],(i=N.exec(e))?[t.createElement(i[1])]:(i=xe([e],t,o),o&&o.length&&S(o).remove(),S.merge([],i.childNodes)));var r,i,o},S.fn.load=function(e,t,n){var r,i,o,a=this,s=e.indexOf(" ");return-1").append(S.parseHTML(e)).find(r):e)}).always(n&&function(e,t){a.each(function(){n.apply(this,o||[e.responseText,t,e])})}),this},S.expr.pseudos.animated=function(t){return S.grep(S.timers,function(e){return t===e.elem}).length},S.offset={setOffset:function(e,t,n){var r,i,o,a,s,u,l=S.css(e,"position"),c=S(e),f={};"static"===l&&(e.style.position="relative"),s=c.offset(),o=S.css(e,"top"),u=S.css(e,"left"),("absolute"===l||"fixed"===l)&&-1<(o+u).indexOf("auto")?(a=(r=c.position()).top,i=r.left):(a=parseFloat(o)||0,i=parseFloat(u)||0),m(t)&&(t=t.call(e,n,S.extend({},s))),null!=t.top&&(f.top=t.top-s.top+a),null!=t.left&&(f.left=t.left-s.left+i),"using"in t?t.using.call(e,f):c.css(f)}},S.fn.extend({offset:function(t){if(arguments.length)return void 0===t?this:this.each(function(e){S.offset.setOffset(this,t,e)});var e,n,r=this[0];return r?r.getClientRects().length?(e=r.getBoundingClientRect(),n=r.ownerDocument.defaultView,{top:e.top+n.pageYOffset,left:e.left+n.pageXOffset}):{top:0,left:0}:void 0},position:function(){if(this[0]){var e,t,n,r=this[0],i={top:0,left:0};if("fixed"===S.css(r,"position"))t=r.getBoundingClientRect();else{t=this.offset(),n=r.ownerDocument,e=r.offsetParent||n.documentElement;while(e&&(e===n.body||e===n.documentElement)&&"static"===S.css(e,"position"))e=e.parentNode;e&&e!==r&&1===e.nodeType&&((i=S(e).offset()).top+=S.css(e,"borderTopWidth",!0),i.left+=S.css(e,"borderLeftWidth",!0))}return{top:t.top-i.top-S.css(r,"marginTop",!0),left:t.left-i.left-S.css(r,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){var e=this.offsetParent;while(e&&"static"===S.css(e,"position"))e=e.offsetParent;return e||re})}}),S.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(t,i){var o="pageYOffset"===i;S.fn[t]=function(e){return B(this,function(e,t,n){var r;if(x(e)?r=e:9===e.nodeType&&(r=e.defaultView),void 0===n)return r?r[i]:e[t];r?r.scrollTo(o?r.pageXOffset:n,o?n:r.pageYOffset):e[t]=n},t,e,arguments.length)}}),S.each(["top","left"],function(e,n){S.cssHooks[n]=_e(v.pixelPosition,function(e,t){if(t)return t=Be(e,n),Pe.test(t)?S(e).position()[n]+"px":t})}),S.each({Height:"height",Width:"width"},function(a,s){S.each({padding:"inner"+a,content:s,"":"outer"+a},function(r,o){S.fn[o]=function(e,t){var n=arguments.length&&(r||"boolean"!=typeof e),i=r||(!0===e||!0===t?"margin":"border");return B(this,function(e,t,n){var r;return x(e)?0===o.indexOf("outer")?e["inner"+a]:e.document.documentElement["client"+a]:9===e.nodeType?(r=e.documentElement,Math.max(e.body["scroll"+a],r["scroll"+a],e.body["offset"+a],r["offset"+a],r["client"+a])):void 0===n?S.css(e,t,i):S.style(e,t,n,i)},s,n?e:void 0,n)}})}),S.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(e,t){S.fn[t]=function(e){return this.on(t,e)}}),S.fn.extend({bind:function(e,t,n){return this.on(e,null,t,n)},unbind:function(e,t){return this.off(e,null,t)},delegate:function(e,t,n,r){return this.on(t,e,n,r)},undelegate:function(e,t,n){return 1===arguments.length?this.off(e,"**"):this.off(t,e||"**",n)},hover:function(e,t){return this.mouseenter(e).mouseleave(t||e)}}),S.each("blur focus focusin focusout resize scroll click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup contextmenu".split(" "),function(e,n){S.fn[n]=function(e,t){return 0 {
+ const $toggleMenu = document.getElementById('toggle-menu');
+ const $mobileSidebarMenus = document.getElementById('sidebar-menus');
+ const $menuMask = document.getElementById('menu-mask');
+ const $body = document.body;
+
+ const toggleMobileSidebar = (isOpen) => {
+ utils.sidebarPaddingR();
+ $body.style.overflow = isOpen ? 'hidden' : '';
+ $body.style.paddingRight = isOpen ? '' : '';
+ utils[isOpen ? 'fadeIn' : 'fadeOut']($menuMask, 0.5);
+ $mobileSidebarMenus.classList[isOpen ? 'add' : 'remove']('open');
+ }
+ const closeMobileSidebar = () => {
+ if ($mobileSidebarMenus.classList.contains('open')) {
+ toggleMobileSidebar(false);
+ }
+ }
+ $toggleMenu.addEventListener('click', () => toggleMobileSidebar(true));
+ $menuMask.addEventListener('click', closeMobileSidebar);
+
+ window.addEventListener('resize', () => {
+ if (utils.isHidden($toggleMenu) && $mobileSidebarMenus.classList.contains('open')) {
+ closeMobileSidebar();
+ }
+ sco.refreshWaterFall();
+ });
+}
+const scrollFn = () => {
+ const innerHeight = window.innerHeight;
+ let initTop = 0;
+ const $header = document.getElementById('page-header');
+ const throttledScroll = utils.throttle((e) => {
+ initThemeColor();
+ const currentTop = window.scrollY || document.documentElement.scrollTop;
+ const isDown = scrollDirection(currentTop);
+ if (currentTop > 0) {
+ if (isDown) {
+ if ($header.classList.contains('nav-visible')) $header.classList.remove('nav-visible');
+ } else {
+ if (!$header.classList.contains('nav-visible')) $header.classList.add('nav-visible');
+ }
+ $header.classList.add('nav-fixed');
+ } else {
+ $header.classList.remove('nav-fixed', 'nav-visible');
+ }
+ }, 200);
+ window.addEventListener('scroll', (e) => {
+ throttledScroll(e);
+ if (window.scrollY === 0) {
+ $header.classList.remove('nav-fixed', 'nav-visible');
+ }
+ });
+
+ function scrollDirection(currentTop) {
+ const result = currentTop > initTop;
+ initTop = currentTop;
+ return result;
+ }
+}
+const percent = () => {
+ const docEl = document.documentElement;
+ const body = document.body;
+ const scrollPos = window.pageYOffset || docEl.scrollTop;
+ const totalScrollableHeight = Math.max(body.scrollHeight, docEl.scrollHeight, body.offsetHeight, docEl.offsetHeight, body.clientHeight, docEl.clientHeight) - docEl.clientHeight;
+ const scrolledPercent = Math.round((scrollPos / totalScrollableHeight) * 100);
+ const navToTop = document.querySelector("#nav-totop");
+ const percentDisplay = document.querySelector("#percent");
+ const isNearEnd = (window.scrollY + docEl.clientHeight) >= (document.getElementById("post-comment") || document.getElementById("footer")).offsetTop;
+ navToTop.classList.toggle("long", isNearEnd || scrolledPercent > 90);
+ percentDisplay.textContent = isNearEnd || scrolledPercent > 90 ? GLOBAL_CONFIG.lang.backtop : scrolledPercent;
+ document.querySelectorAll(".needEndHide").forEach(item => item.classList.toggle("hide", totalScrollableHeight - scrollPos < 100));
+}
+const showTodayCard = () => {
+ const el = document.getElementById('todayCard');
+ const topGroup = document.querySelector('.topGroup');
+ topGroup?.addEventListener('mouseleave', () => el?.classList.remove('hide'));
+}
+const initObserver = () => {
+ const commentElement = document.getElementById("post-comment");
+ const paginationElement = document.getElementById("pagination");
+ const commentBarrageElement = document.querySelector(".comment-barrage");
+ if (commentElement && paginationElement) {
+ const observer = new IntersectionObserver(entries => {
+ entries.forEach(entry => {
+ const action = entry.isIntersecting ? 'add' : 'remove';
+ paginationElement.classList[action]("show-window");
+ if (GLOBAL_CONFIG.comment.commentBarrage) {
+ commentBarrageElement.style.bottom = entry.isIntersecting ? "-200px" : "0px";
+ }
+ });
+ });
+ observer.observe(commentElement);
+ }
+};
+const addCopyright = () => {
+ if (!GLOBAL_CONFIG.copyright) return;
+ const {limit, author, link, source, info} = GLOBAL_CONFIG.copyright;
+ document.body.addEventListener('copy', (e) => {
+ e.preventDefault();
+ const copyText = window.getSelection().toString();
+ const text = copyText.length > limit ? `${copyText}\n\n${author}\n${link}${window.location.href}\n${source}\n${info}` : copyText;
+ e.clipboardData.setData('text', text);
+ });
+};
+const asideStatus = () => {
+ const status = utils.saveToLocal.get('aside-status');
+ document.documentElement.classList.toggle('hide-aside', status === 'hide');
+}
+function initThemeColor() {
+ const currentTop = window.scrollY || document.documentElement.scrollTop;
+ const themeColor = currentTop > 0 ? '--efu-card-bg' : PAGE_CONFIG.is_post ? '--efu-main' : '--efu-background';
+ applyThemeColor(getComputedStyle(document.documentElement).getPropertyValue(themeColor));
+}
+function applyThemeColor(color) {
+ const themeColorMeta = document.querySelector('meta[name="theme-color"]');
+ const appleMobileWebAppMeta = document.querySelector('meta[name="apple-mobile-web-app-status-bar-style"]');
+ themeColorMeta?.setAttribute("content", color);
+ appleMobileWebAppMeta?.setAttribute("content", color);
+ if (window.matchMedia("(display-mode: standalone)").matches) {
+ document.body.style.backgroundColor = color;
+ }
+}
+const handleThemeChange = mode => {
+ const themeChange = window.globalFn?.themeChange || {}
+ for (let key in themeChange) {
+ themeChange[key](mode)
+ }
+}
+const sco = {
+ lastSayHello: "",
+ wasPageHidden: false,
+ musicPlaying: false,
+ hideCookie() {
+ const cookiesWindow = document.getElementById("cookies-window");
+ if (cookiesWindow) {
+ setTimeout(() => {
+ cookiesWindow.classList.add("cw-hide");
+ setTimeout(() => cookiesWindow.style.display = "none", 1000);
+ }, 3000);
+ }
+ },
+ scrollTo(elementId) {
+ const targetElement = document.getElementById(elementId);
+ if (targetElement) {
+ const targetPosition = targetElement.getBoundingClientRect().top + window.pageYOffset - 80;
+ window.scroll({
+ top: targetPosition,
+ behavior: "smooth"
+ });
+ }
+ },
+ musicToggle() {
+ const $music = document.querySelector('#nav-music');
+ const $meting = document.querySelector('meting-js');
+ const $console = document.getElementById('consoleMusic');
+ const $rm_text = document.querySelector('#menu-music-toggle span');
+ const $rm_icon = document.querySelector('#menu-music-toggle i');
+ this.musicPlaying = !this.musicPlaying;
+ $music.classList.toggle("playing", this.musicPlaying);
+ $console.classList.toggle("on", this.musicPlaying);
+ if (this.musicPlaying) {
+ $meting.aplayer.play();
+ rm?.menuItems.music[0] && ($rm_text.textContent = GLOBAL_CONFIG.right_menu.music.stop) && ($rm_icon.className = 'solitude st-pause-fill')
+ } else {
+ $meting.aplayer.pause();
+ rm?.menuItems.music[0] && ($rm_text.textContent = GLOBAL_CONFIG.right_menu.music.start) && ($rm_icon.className = 'solitude st-play-fill')
+ }
+ },
+ switchCommentBarrage() {
+ let commentBarrageElement = document.querySelector(".comment-barrage");
+ if (!commentBarrageElement) return;
+ const isDisplayed = window.getComputedStyle(commentBarrageElement).display === "flex";
+ commentBarrageElement.style.display = isDisplayed ? "none" : "flex";
+ document.querySelector("#consoleCommentBarrage").classList.toggle("on", !isDisplayed);
+ utils.saveToLocal.set("commentBarrageSwitch", !isDisplayed, .2);
+ rm?.menuItems.barrage && rm.barrage(isDisplayed)
+ },
+ switchHideAside() {
+ const htmlClassList = document.documentElement.classList;
+ const consoleHideAside = document.querySelector("#consoleHideAside");
+ const isHideAside = htmlClassList.contains("hide-aside");
+ utils.saveToLocal.set("aside-status", isHideAside ? "show" : "hide", 1);
+ htmlClassList.toggle("hide-aside");
+ consoleHideAside.classList.toggle("on", !isHideAside);
+ },
+ switchKeyboard() {
+ this.sco_keyboards = !this.sco_keyboards;
+ const consoleKeyboard = document.querySelector("#consoleKeyboard");
+ const keyboardFunction = this.sco_keyboards ? openKeyboard : closeKeyboard;
+ consoleKeyboard.classList.toggle("on", this.sco_keyboards);
+ keyboardFunction();
+ localStorage.setItem("keyboard", this.sco_keyboards);
+ document.getElementById('keyboard-tips')?.classList.remove('show');
+ },
+ initConsoleState() {
+ const consoleHideAside = document.querySelector("#consoleHideAside");
+ consoleHideAside.classList.toggle("on", !document.documentElement.classList.contains("hide-aside"));
+ },
+ changeSayHelloText() {
+ const greetings = GLOBAL_CONFIG.aside.sayhello2;
+ const greetingElement = document.getElementById("author-info__sayhi");
+ let randomGreeting;
+ do {
+ randomGreeting = greetings[Math.floor(Math.random() * greetings.length)];
+ } while (randomGreeting === this.lastSayHello);
+ greetingElement.textContent = randomGreeting;
+ this.lastSayHello = randomGreeting;
+ },
+ switchDarkMode() {
+ const isDarkMode = document.documentElement.getAttribute('data-theme') === 'dark';
+ const newMode = isDarkMode ? 'light' : 'dark';
+ document.documentElement.setAttribute('data-theme', newMode);
+ utils.saveToLocal.set('theme', newMode, 0.02);
+ utils.snackbarShow(GLOBAL_CONFIG.lang.theme[newMode], false, 2000);
+ if(typeof rm === 'object') rm.mode(!isDarkMode) && rm.hideRightMenu();
+ handleThemeChange(newMode);
+ },
+ hideTodayCard: () => document.getElementById('todayCard').classList.add('hide'),
+ toTop: () => utils.scrollToDest(0),
+ showConsole: () => document.getElementById('console')?.classList.toggle('show', true),
+ hideConsole: () => document.getElementById('console')?.classList.remove('show'),
+ refreshWaterFall() {
+ const observer = new IntersectionObserver((entries) => {
+ entries.forEach(entry => {
+ if (entry.isIntersecting) {
+ setTimeout(() => {
+ waterfall(entry.target) || entry.target.classList.add('show');
+ }, 300);
+ }
+ });
+ });
+ document.querySelectorAll('.waterfall').forEach(el => observer.observe(el));
+ },
+ addRuntime() {
+ let el = document.getElementById('runtimeshow');
+ el && GLOBAL_CONFIG.runtime && (el.innerText = utils.timeDiff(new Date(GLOBAL_CONFIG.runtime), new Date()) + GLOBAL_CONFIG.lang.day);
+ },
+ toTalk(txt) {
+ const inputs = ["#wl-edit", ".el-textarea__inner", "#veditor", ".atk-textarea"];
+ inputs.forEach(selector => {
+ const el = document.querySelector(selector);
+ if (el) {
+ el.dispatchEvent(new Event('input', { bubble: true, cancelable: true }));
+ el.value = '> ' + txt.replace(/\n/g, '\n> ') + '\n\n';
+ utils.scrollToDest(utils.getEleTop(document.getElementById('post-comment')), 300);
+ el.focus();
+ el.setSelectionRange(-1, -1);
+ }
+ });
+ utils.snackbarShow(GLOBAL_CONFIG.lang.totalk, false, 2000);
+ },
+ initbbtalk() {
+ const bberTalkElement = document.querySelector('#bber-talk');
+ if (bberTalkElement) {
+ new Swiper('.swiper-container', {
+ direction: 'vertical',
+ loop: true,
+ autoplay: {
+ delay: 3000,
+ pauseOnMouseEnter: true
+ },
+ });
+ }
+ },
+ addPhotoFigcaption() {
+ document.querySelectorAll('#article-container img:not(.gallery-item img)').forEach(image => {
+ const captionText = image.getAttribute('alt');
+ captionText && image.insertAdjacentHTML('afterend', `${captionText}
`);
+ });
+ },
+ scrollToComment: () => utils.scrollToDest(utils.getEleTop(document.getElementById('post-comment')), 300),
+ setTimeState() {
+ const el = document.getElementById('author-info__sayhi');
+ if (el) {
+ const hours = new Date().getHours();
+ const lang = GLOBAL_CONFIG.aside.sayhello;
+
+ const localData = getLocalData(['twikoo', 'WALINE_USER_META', 'WALINE_USER', '_v_Cache_Meta', 'ArtalkUser']);
+
+ function getLocalData(keys) {
+ for (let key of keys) {
+ const data = localStorage.getItem(key);
+ if (data) {
+ return JSON.parse(data);
+ }
+ }
+ return null;
+ };
+ const nick = localData ? (localData.nick ? localData.nick : localData.display_name) : null;
+
+ let prefix;
+ if (this.wasPageHidden) {
+ prefix = GLOBAL_CONFIG.aside.sayhello3.back + nick;
+ this.wasPageHidden = false;
+ } else {
+ prefix = GLOBAL_CONFIG.aside.sayhello3.prefix + nick;
+ }
+
+ const greetings = [
+ { start: 0, end: 5, text: nick ? prefix : lang.goodnight },
+ { start: 6, end: 10, text: nick ? prefix : lang.morning },
+ { start: 11, end: 14, text: nick ? prefix : lang.noon },
+ { start: 15, end: 18, text: nick ? prefix : lang.afternoon },
+ { start: 19, end: 24, text: nick ? prefix : lang.night },
+ ];
+ const greeting = greetings.find(g => hours >= g.start && hours <= g.end);
+ el.innerText = greeting.text;
+ }
+ },
+ tagPageActive() {
+ const decodedPath = decodeURIComponent(window.location.pathname);
+ const isTagPage = /\/tags\/.*?\//.test(decodedPath);
+ if (isTagPage) {
+ const tag = decodedPath.split("/").slice(-2, -1)[0];
+ const tagElement = document.getElementById(tag);
+ if (tagElement) {
+ document.querySelectorAll("a.select").forEach(link => {
+ link.classList.remove("select");
+ });
+ tagElement.classList.add("select");
+ }
+ }
+ },
+ categoriesBarActive() {
+ const categoryBar = document.querySelector("#category-bar");
+ const currentPath = decodeURIComponent(window.location.pathname);
+ const isHomePage = currentPath === "/";
+ if (categoryBar) {
+ const categoryItems = categoryBar.querySelectorAll(".category-bar-item");
+ categoryItems.forEach(item => item.classList.remove("select"));
+ const activeItemId = isHomePage ? "category-bar-home" : currentPath.split("/").slice(-2, -1)[0];
+ const activeItem = document.getElementById(activeItemId);
+ if (activeItem) {
+ activeItem.classList.add("select");
+ }
+ }
+ },
+ scrollCategoryBarToRight() {
+ const scrollBar = document.getElementById("category-bar-items");
+ const nextElement = document.getElementById("category-bar-next");
+ if (scrollBar) {
+ const isScrollBarAtEnd = () => scrollBar.scrollLeft + scrollBar.clientWidth >= scrollBar.scrollWidth - 8;
+ const scroll = () => {
+ if (isScrollBarAtEnd()) {
+ scrollBar.scroll({ left: 0, behavior: "smooth" });
+ } else {
+ scrollBar.scrollBy({ left: scrollBar.clientWidth, behavior: "smooth" });
+ }
+ };
+ scrollBar.addEventListener("scroll", () => {
+ clearTimeout(this.timeoutId);
+ this.timeoutId = setTimeout(() => {
+ nextElement.style.transform = isScrollBarAtEnd() ? "rotate(180deg)" : "";
+ }, 150);
+ });
+ scroll();
+ }
+ },
+ openAllTags() {
+ document.querySelectorAll(".card-allinfo .card-tag-cloud").forEach(tagCloudElement => tagCloudElement.classList.add("all-tags"));
+ document.getElementById("more-tags-btn")?.remove();
+ },
+ listenToPageInputPress() {
+ const toGroup = document.querySelector(".toPageGroup")
+ const pageText = document.getElementById("toPageText");
+ if (!pageText) return;
+ const pageButton = document.getElementById("toPageButton");
+ const pageNumbers = document.querySelectorAll(".page-number");
+ const lastPageNumber = +pageNumbers[pageNumbers.length - 1].textContent;
+ if (!pageText || lastPageNumber === 1) {
+ toGroup.style.display = "none";
+ return
+ }
+ pageText.addEventListener("keydown", (event) => {
+ if (event.keyCode === 13) {
+ sco.toPage();
+ pjax.loadUrl(pageButton.href);
+ }
+ });
+ pageText.addEventListener("input", () => {
+ pageButton.classList.toggle("haveValue", pageText.value !== "" && pageText.value !== "0");
+ if (+pageText.value > lastPageNumber) {
+ pageText.value = lastPageNumber;
+ }
+ });
+ },
+ addNavBackgroundInit() {
+ const scrollTop = document.documentElement.scrollTop;
+ (scrollTop !== 0) && document.getElementById("page-header").classList.add("nav-fixed", "nav-visible");
+ },
+ toPage() {
+ const pageNumbers = document.querySelectorAll(".page-number");
+ const maxPageNumber = parseInt(pageNumbers[pageNumbers.length - 1].innerHTML);
+ const inputElement = document.getElementById("toPageText");
+ const inputPageNumber = parseInt(inputElement.value);
+ document.getElementById("toPageButton").href = (!isNaN(inputPageNumber) && inputPageNumber <= maxPageNumber && inputPageNumber > 1)
+ ? window.location.href.replace(/\/page\/\d+\/$/, "/") + "page/" + inputPageNumber + "/"
+ : '/';
+ },
+ owoBig(owoSelector) {
+ let owoBig = document.getElementById('owo-big');
+ if (!owoBig) {
+ owoBig = document.createElement('div');
+ owoBig.id = 'owo-big';
+ document.body.appendChild(owoBig);
+ }
+ const showOwoBig = event => {
+ const target = event.target;
+ const owoItem = target.closest(owoSelector.item);
+ if (owoItem && target.closest(owoSelector.body)) {
+ const imgSrc = owoItem.querySelector('img')?.src;
+ if (imgSrc) {
+ owoBig.innerHTML = ` `;
+ owoBig.style.display = 'block';
+ positionOwoBig(owoItem);
+ }
+ }
+ };
+ const hideOwoBig = event => {
+ if (event.target.closest(owoSelector.item) && event.target.closest(owoSelector.body)) {
+ owoBig.style.display = 'none';
+ }
+ };
+ const positionOwoBig = owoItem => {
+ const itemRect = owoItem.getBoundingClientRect();
+ owoBig.style.left = `${itemRect.left - (owoBig.offsetWidth / 4)}px`;
+ owoBig.style.top = `${itemRect.top}px`;
+ }
+ document.addEventListener('mouseover', showOwoBig);
+ document.addEventListener('mouseout', hideOwoBig);
+ },
+ changeTimeFormat(selector) {
+ selector.forEach(item => {
+ const timeVal = item.getAttribute('datetime')
+ item.textContent = utils.diffDate(timeVal, true)
+ item.style.display = 'inline'
+ })
+ },
+ switchComments() {
+ const switchBtn = document.getElementById('switch-btn')
+ if (!switchBtn) return
+ let switchDone = false
+ const commentContainer = document.getElementById('post-comment')
+ const handleSwitchBtn = () => {
+ commentContainer.classList.toggle('move')
+ if (!switchDone && typeof loadTwoComment === 'function') {
+ switchDone = true
+ loadTwoComment()
+ }
+ }
+ utils.addEventListenerPjax(switchBtn, 'click', handleSwitchBtn)
+ }
+};
+const addHighlight = () => {
+ const highlight = GLOBAL_CONFIG.highlight;
+ if (!highlight) return;
+ const {copy, expand, limit, syntax} = highlight;
+ const $isPrismjs = syntax === 'prismjs';
+ const $isShowTool = highlight.enable || copy || expand || limit;
+ const expandClass = !expand === true ? 'closed' : ''
+ const $syntaxHighlight = syntax === 'highlight.js' ? document.querySelectorAll('figure.highlight') : document.querySelectorAll('pre[class*="language-"]')
+ if (!(($isShowTool || limit) && $syntaxHighlight.length)) return
+ const copyEle = copy ? ` ` : ' ';
+ const expandEle = ` `;
+ const limitEle = limit ? ` ` : ' ';
+ const alertInfo = (ele, text) => utils.snackbarShow(text, false, 2000)
+ const copyFn = (e) => {
+ const $buttonParent = e.parentNode
+ $buttonParent.classList.add('copy-true')
+ const selection = window.getSelection()
+ const range = document.createRange()
+ const preCodeSelector = $isPrismjs ? 'pre code' : 'table .code pre'
+ range.selectNodeContents($buttonParent.querySelectorAll(`${preCodeSelector}`)[0])
+ selection.removeAllRanges()
+ selection.addRange(range)
+ document.execCommand('copy')
+ alertInfo(e.lastChild, GLOBAL_CONFIG.lang.copy.success)
+ selection.removeAllRanges()
+ $buttonParent.classList.remove('copy-true')
+ }
+ const expandClose = (e) => e.classList.toggle('closed')
+ const shrinkEle = function () {
+ this.classList.toggle('expand-done')
+ }
+ const ToolsFn = function (e) {
+ const $target = e.target.classList
+ if ($target.contains('expand')) expandClose(this)
+ else if ($target.contains('copy-button')) copyFn(this)
+ }
+ const createEle = (lang, item, service) => {
+ const fragment = document.createDocumentFragment()
+ if ($isShowTool) {
+ const hlTools = document.createElement('div')
+ hlTools.className = `highlight-tools ${expandClass}`
+ hlTools.innerHTML = expandEle + lang + copyEle
+ utils.addEventListenerPjax(hlTools, 'click', ToolsFn)
+ fragment.appendChild(hlTools)
+ }
+ if (limit && item.offsetHeight > limit + 30) {
+ const ele = document.createElement('div')
+ ele.className = 'code-expand-btn'
+ ele.innerHTML = limitEle
+ utils.addEventListenerPjax(ele, 'click', shrinkEle)
+ fragment.appendChild(ele)
+ }
+ if (service === 'hl') {
+ item.insertBefore(fragment, item.firstChild)
+ } else {
+ item.parentNode.insertBefore(fragment, item)
+ }
+ }
+ if ($isPrismjs) {
+ $syntaxHighlight.forEach(item => {
+ const langName = item.getAttribute('data-language') || 'Code'
+ const highlightLangEle = `${langName}
`
+ utils.wrap(item, 'figure', {
+ class: 'highlight'
+ })
+ createEle(highlightLangEle, item)
+ })
+ } else {
+ $syntaxHighlight.forEach(item => {
+ let langName = item.getAttribute('class').split(' ')[1]
+ if (langName === 'plain' || langName === undefined) langName = 'Code'
+ const highlightLangEle = `${langName}
`
+ createEle(highlightLangEle, item, 'hl')
+ })
+ }
+}
+class toc {
+ static init() {
+ const tocContainer = document.getElementById('card-toc')
+ if (!tocContainer || !tocContainer.querySelector('.toc a')) {
+ tocContainer.style.display = 'none'
+ return
+ }
+ const el = document.querySelectorAll('.toc a')
+ el.forEach((e) => {
+ e.addEventListener('click', (event) => {
+ event.preventDefault()
+ utils.scrollToDest(utils.getEleTop(document.getElementById(decodeURI((event.target.className === 'toc-text' ? event.target.parentNode.hash : event.target.hash).replace('#', '')))), 300)
+ })
+ })
+ this.active(el)
+ }
+ static active(toc) {
+ const $article = document.getElementById('article-container')
+ const $tocContent = document.getElementById('toc-content')
+ const list = $article.querySelectorAll('h1,h2,h3,h4,h5,h6')
+ let detectItem = ''
+ function autoScroll(el) {
+ const activePosition = el.getBoundingClientRect().top
+ const sidebarScrollTop = $tocContent.scrollTop
+ if (activePosition > (document.documentElement.clientHeight - 100)) {
+ $tocContent.scrollTop = sidebarScrollTop + 150
+ }
+ if (activePosition < 100) {
+ $tocContent.scrollTop = sidebarScrollTop - 150
+ }
+ }
+ function findHeadPosition(top) {
+ if (top === 0) return false
+ let currentIndex = ''
+ list.forEach(function (ele, index) {
+ if (top > utils.getEleTop(ele) - 80) {
+ currentIndex = index
+ }
+ })
+ if (detectItem === currentIndex) return
+ detectItem = currentIndex
+ document.querySelectorAll('.toc .active').forEach((i) => {
+ i.classList.remove('active')
+ })
+ const activeitem = toc[detectItem]
+ if (activeitem) {
+ let parent = toc[detectItem].parentNode
+ activeitem.classList.add('active')
+ autoScroll(activeitem)
+ for (; !parent.matches('.toc'); parent = parent.parentNode) {
+ if (parent.matches('li')) parent.classList.add('active')
+ }
+ }
+ }
+ window.tocScrollFn = utils.throttle(function () {
+ const currentTop = window.scrollY || document.documentElement.scrollTop
+ findHeadPosition(currentTop)
+ }, 100)
+ window.addEventListener('scroll', tocScrollFn)
+ }
+}
+class tabs {
+ static init() {
+ this.clickFnOfTabs();
+ this.backToTop();
+ }
+ static clickFnOfTabs() {
+ document.querySelectorAll('#article-container .tab > button').forEach((item) => {
+ item.addEventListener('click', function (e) {
+ const that = this;
+ const $tabItem = that.parentNode;
+ if (!$tabItem.classList.contains('active')) {
+ const $tabContent = $tabItem.parentNode.nextElementSibling;
+ const $siblings = utils.siblings($tabItem, '.active')[0];
+ $siblings && $siblings.classList.remove('active');
+ $tabItem.classList.add('active');
+ const tabId = that.getAttribute('data-href').replace('#', '');
+ const childList = [...$tabContent.children];
+ childList.forEach((item) => {
+ if (item.id === tabId) item.classList.add('active');
+ else item.classList.remove('active');
+ });
+ }
+ });
+ });
+ }
+ static backToTop() {
+ document.querySelectorAll('#article-container .tabs .tab-to-top').forEach((item) => {
+ item.addEventListener('click', function () {
+ utils.scrollToDest(utils.getEleTop(item.parentElement.parentElement.parentNode), 300);
+ });
+ });
+ }
+}
+
+window.refreshFn = () => {
+ const {is_home, is_page, page, is_post} = PAGE_CONFIG;
+ const {runtime, lazyload, lightbox, randomlink, covercolor, post_ai} = GLOBAL_CONFIG;
+ const timeSelector = (is_home ? '.post-meta-date time' : is_post ? '.post-meta-date time' : '.datatime') + ', .webinfo-item time';
+ document.body.setAttribute('data-type', page);
+ sco.changeTimeFormat(document.querySelectorAll(timeSelector));
+ runtime && sco.addRuntime();
+ [scrollFn, sidebarFn, sco.hideCookie, sco.addPhotoFigcaption, sco.setTimeState, sco.tagPageActive, sco.categoriesBarActive, sco.listenToPageInputPress, sco.addNavBackgroundInit, sco.refreshWaterFall].forEach(fn => fn());
+ lazyload.enable && utils.lazyloadImg();
+ lightbox && utils.lightbox(document.querySelectorAll("#article-container img:not(.flink-avatar,.gallery-group img)"));
+ randomlink && randomLinksList();
+ post_ai && is_post && efu_ai.init();
+ sco.switchComments();
+ initObserver();
+ if (is_home) showTodayCard();
+ if (is_post || is_page) {
+ addHighlight();
+ tabs.init();
+ }
+ if (covercolor.enable) coverColor();
+ if (PAGE_CONFIG.toc) toc.init();
+}
+document.addEventListener('DOMContentLoaded', () => {
+ [addCopyright, sco.initConsoleState, window.refreshFn, asideStatus, () => window.onscroll = percent].forEach(fn => fn());
+});
+document.addEventListener('visibilitychange', () => {
+ if (document.hidden) {
+ sco.wasPageHidden = true;
+ }
+});
+window.onkeydown = e => {
+ const { keyCode, ctrlKey, shiftKey } = e;
+ if (keyCode === 123 || (ctrlKey && shiftKey && keyCode === 67)) {
+ utils.snackbarShow(GLOBAL_CONFIG.lang.f12, false, 3000);
+ }
+ if (keyCode === 27) {
+ sco.hideConsole();
+ }
+};
+document.addEventListener('copy', () => {
+ utils.snackbarShow(GLOBAL_CONFIG.lang.copy.success, false, 3000);
+});
\ No newline at end of file
diff --git a/public/js/music.js b/public/js/music.js
new file mode 100644
index 0000000..83a8870
--- /dev/null
+++ b/public/js/music.js
@@ -0,0 +1,123 @@
+/**
+ * Music Player
+ * @description Initialize the music player and add event listeners to control the player
+ */
+class ScoMusicPlayer {
+ constructor() {
+ this.init();
+ }
+ init() {
+ document.documentElement.style.setProperty('--vh', `${window.innerHeight}px`);
+ this.getCustomPlayList();
+ this.addEventListenerToDocument();
+ this.addButtonListEventListener();
+ }
+
+ getCustomPlayList() {
+ this.changeMusicBg(false);
+ }
+ addEventListenerToDocument() {
+ document.addEventListener("keydown", this.handleKeydown.bind(this));
+ }
+
+ addButtonListEventListener() {
+ const aplayerList = document.querySelector(".aplayer-list");
+ document.querySelector(".aplayer-lrc")?.addEventListener("click", () => {
+ aplayerList.classList.toggle("aplayer-list-hide");
+ });
+ }
+
+ changeMusicBg(isChangeBg = true) {
+ const musicBg = document.getElementById("Music-bg");
+ const musicLoading = document.getElementsByClassName("Music-loading")[0];
+
+ if (isChangeBg) {
+ this.updateBackgroundImage(musicBg);
+ } else {
+ this.setLoadingScreen(musicLoading, musicBg);
+ }
+ }
+
+ updateBackgroundImage(element) {
+ const musicCover = document.querySelector("#Music-page .aplayer-pic");
+ const img = new Image();
+ img.src = this.extractValue(musicCover.style.backgroundImage);
+ img.onload = () => {
+ element.style.backgroundImage = musicCover.style.backgroundImage;
+ };
+ element.className = 'show'
+ }
+
+ setLoadingScreen(loadingElement, backgroundElement) {
+ const timer = setInterval(() => {
+ const musicCover = document.querySelector("#Music-page .aplayer-pic");
+ if (musicCover) {
+ loadingElement.style.display = "none";
+ clearInterval(timer);
+ document.querySelector('meting-js').aplayer.volume(0.8, true);
+ this.addEventListenerChangeMusicBg();
+ backgroundElement.style.display = "block";
+ }
+ this.addButtonListEventListener();
+ }, 100);
+ }
+
+ extractValue(input) {
+ const valueRegex = /url\("([^"]+)"\)/;
+ const match = valueRegex.exec(input);
+ return match ? match[1] : '';
+ }
+
+ addEventListenerChangeMusicBg() {
+ const aplayer = document.querySelector("#Music-page meting-js").aplayer;
+ aplayer.on('loadeddata', this.changeMusicBg.bind(this, true));
+ aplayer.on('timeupdate', this.lrcUpdate.bind(this));
+ }
+
+ lrcUpdate() {
+ const aplayerLrcContents = document.querySelector('.aplayer-lrc-contents');
+ const currentLrc = aplayerLrcContents.querySelector('p.aplayer-lrc-current');
+ if (currentLrc) {
+ const currentIndex = Array.from(aplayerLrcContents.children).indexOf(currentLrc);
+ aplayerLrcContents.style.transform = `translateY(${-currentIndex * 80}px)`;
+ }
+ }
+
+ handleKeydown(event) {
+ const aplayer = document.querySelector('meting-js').aplayer;
+ switch (event.code) {
+ case "Space":
+ event.preventDefault();
+ aplayer.toggle();
+ break;
+ case "ArrowRight":
+ event.preventDefault();
+ aplayer.skipForward();
+ break;
+ case "ArrowLeft":
+ event.preventDefault();
+ aplayer.skipBack();
+ break;
+ case "ArrowUp":
+ event.preventDefault();
+ if (aplayer.volume < 1) aplayer.volume(aplayer.volume + 0.1);
+ break;
+ case "ArrowDown":
+ event.preventDefault();
+ if (aplayer.volume > 0) aplayer.volume(aplayer.volume - 0.1);
+ break;
+ }
+ }
+ destroy() {
+ document.removeEventListener("keydown", this.handleKeydown);
+ }
+}
+
+/**
+ * Initialize the music player
+ */
+function initializeMusicPlayer() {
+ let exitingMusic = window.scoMusic;
+ if (exitingMusic) exitingMusic.destroy();
+ window.scoMusic = new ScoMusicPlayer();
+}
\ No newline at end of file
diff --git a/public/js/right_menu.js b/public/js/right_menu.js
new file mode 100644
index 0000000..008d329
--- /dev/null
+++ b/public/js/right_menu.js
@@ -0,0 +1,251 @@
+let selectTextNow = "";
+const selectText = () => {
+ selectTextNow = document.selection
+ ? document.selection.createRange().text
+ : window.getSelection() + "" || "";
+};
+document.onmouseup = document.ondbclick = selectText;
+
+const rm = {
+ mask: document.getElementById("rightmenu-mask"),
+ menu: document.getElementById("rightMenu"),
+ width: 0,
+ height: 0,
+ domhref: "",
+ domsrc: "",
+ globalEvent: null,
+ menuItems: {
+ other: document.getElementsByClassName("rightMenuOther"),
+ plugin: document.getElementsByClassName("rightMenuPlugin"),
+ back: document.getElementById("menu-backward"),
+ forward: document.getElementById("menu-forward"),
+ refresh: document.getElementById("menu-refresh"),
+ top: document.getElementById("menu-top"),
+ copy: document.getElementById("menu-copytext"),
+ paste: document.getElementById("menu-pastetext"),
+ comment: document.getElementById("menu-commenttext"),
+ new: document.getElementById("menu-newwindow"),
+ copyLink: document.getElementById("menu-copylink"),
+ copyImg: document.getElementById("menu-copyimg"),
+ downloadImg: document.getElementById("menu-downloadimg"),
+ search: document.getElementById("menu-search"),
+ barrage: document.getElementById("menu-commentBarrage"),
+ mode: document.getElementById("menu-darkmode"),
+ translate: document.getElementById("menu-translate"),
+ music: [
+ document.getElementById("menu-music-toggle"),
+ document.getElementById("menu-music-back"),
+ document.getElementById("menu-music-forward"),
+ document.getElementById("menu-music-copyMusicName"),
+ ],
+ },
+ showRightMenu(e, x = 0, y = 0) {
+ this.menu.style.top = y + "px";
+ this.menu.style.left = x + "px";
+ this.menu.style.display = e ? "block" : "none";
+ e ? stopMaskScroll() : (this.mask.style.display = "none");
+ },
+ hideRightMenu() {
+ rm.showRightMenu(false);
+ rm.mask.style.display = "none";
+ },
+ reLoadSize() {
+ rm.menu.style.display = "block";
+ rm.width = rm.menu.offsetWidth;
+ rm.height = rm.menu.offsetHeight;
+ rm.menu.style.display = 'none';
+ },
+ copyText(e) {
+ navigator.clipboard && navigator.clipboard.writeText(e);
+ utils.snackbarShow(GLOBAL_CONFIG.lang.copy.success, false, 2000);
+ this.hideRightMenu();
+ },
+ async downloadImage(imageUrl = this.domsrc, filename = "photo") {
+ try {
+ const response = await fetch(imageUrl);
+ const blob = await response.blob();
+ const url = URL.createObjectURL(blob);
+ const link = document.createElement("a");
+ link.href = url;
+ link.download = filename || "image.jpg";
+ link.style.display = "none";
+ document.body.appendChild(link);
+ link.click();
+ document.body.removeChild(link);
+ URL.revokeObjectURL(url);
+ } catch (error) {
+ utils.snackbarShow(GLOBAL_CONFIG.right_menu.img_error, false, 2000);
+ }
+ },
+ copyImage(imgUrl = this.domsrc) {
+ window.open(imgUrl);
+ },
+ mode(darkmode) {
+ darkmode
+ ? (document.querySelector(".menu-darkmode-text").textContent =
+ GLOBAL_CONFIG.right_menu.mode.light)
+ : (document.querySelector(".menu-darkmode-text").textContent =
+ GLOBAL_CONFIG.right_menu.mode.dark);
+ this.hideRightMenu();
+ },
+ barrage(enable) {
+ enable
+ ? (document.querySelector(".menu-commentBarrage-text").textContent =
+ GLOBAL_CONFIG.right_menu.barrage.open)
+ : (document.querySelector(".menu-commentBarrage-text").textContent =
+ GLOBAL_CONFIG.right_menu.barrage.close);
+ this.hideRightMenu();
+ },
+};
+
+function stopMaskScroll() {
+ utils.addEventListenerPjax(rm.menu, "mousewheel", rm.hideRightMenu, { passive: true });
+ utils.addEventListenerPjax(rm.mask, "mousewheel", rm.hideRightMenu, { passive: true });
+ utils.addEventListenerPjax(rm.mask, "click", rm.hideRightMenu, { passive: true });
+}
+
+window.oncontextmenu = (ele) => {
+ if (document.body.clientWidth <= 768) return;
+ let x = ele.clientX + 10;
+ let y = ele.clientY;
+ Array.from(rm.menuItems.other).forEach((item) => (item.style.display = "block"));
+ rm.globalEvent = ele;
+
+ let display = false;
+ let link = ele.target.href;
+ let src = ele.target.currentSrc;
+
+ if (selectTextNow && window.getSelection()) {
+ display = true;
+ rm.menuItems.copy.style.display = "block";
+ GLOBAL_CONFIG.comment && (rm.menuItems.comment.style.display = "block");
+ rm.menuItems.search && (rm.menuItems.search.style.display = "block");
+ } else {
+ rm.menuItems.copy.style.display = "none";
+ GLOBAL_CONFIG.comment && (rm.menuItems.comment.style.display = "none");
+ rm.menuItems.search && (rm.menuItems.search.style.display = "none");
+ }
+
+ if (link) {
+ display = true;
+ rm.menuItems.new.style.display = "block";
+ rm.menuItems.copyLink.style.display = "block";
+ rm.domhref = link;
+ } else {
+ rm.menuItems.new.style.display = "none";
+ rm.menuItems.copyLink.style.display = "none";
+ }
+
+ if (src) {
+ display = true;
+ rm.menuItems.copyImg.style.display = "block";
+ rm.menuItems.downloadImg.style.display = "block";
+ rm.domsrc = src;
+ } else {
+ rm.menuItems.copyImg.style.display = "none";
+ rm.menuItems.downloadImg.style.display = "none";
+ }
+
+ let tagName = ele.target.tagName.toLowerCase();
+ if (tagName === "input" || tagName === "textarea") {
+ display = true;
+ rm.menuItems.paste.style.display = "block";
+ } else {
+ rm.menuItems.paste.style.display = "none";
+ }
+
+ if (tagName === "meting-js") {
+ display = true;
+ rm.menuItems.music.forEach((item) => (item.style.display = "block"));
+ } else {
+ rm.menuItems.music[0] &&
+ rm.menuItems.music.forEach((item) => (item.style.display = "none"));
+ }
+
+ Array.from(display ? rm.menuItems.other : rm.menuItems.plugin).forEach(
+ (item) => (item.style.display = "none")
+ );
+ Array.from(display ? rm.menuItems.plugin : rm.menuItems.other).forEach(
+ (item) => (item.style.display = "block")
+ );
+ rm.reLoadSize();
+ x + rm.width > window.innerWidth && (x -= rm.width + 10);
+ y + rm.height > window.innerHeight && (y -= y + rm.height - window.innerHeight);
+ rm.mask.style.display = "flex";
+ rm.showRightMenu(true, x, y);
+ return false;
+};
+
+(function () {
+ const addEventListener = (element, event, handler) =>
+ element.addEventListener(event, handler);
+
+ addEventListener(rm.menuItems.back, "click", () =>
+ window.history.back() || rm.hideRightMenu()
+ );
+ addEventListener(rm.menuItems.forward, "click", () =>
+ window.history.forward() || rm.hideRightMenu()
+ );
+ addEventListener(rm.menuItems.refresh, "click", () =>
+ window.location.reload()
+ );
+ addEventListener(rm.menuItems.top, "click", () =>
+ sco.toTop() || rm.hideRightMenu()
+ );
+
+ if (GLOBAL_CONFIG.right_menu.music) {
+ addEventListener(rm.menuItems.music[0], "click", () => {
+ sco.musicToggle();
+ rm.hideRightMenu();
+ });
+ addEventListener(rm.menuItems.music[1], "click", () => {
+ document.querySelector("meting-js").aplayer.skipBack();
+ rm.hideRightMenu();
+ });
+ addEventListener(rm.menuItems.music[2], "click", () => {
+ document.querySelector("meting-js").aplayer.skipForward();
+ rm.hideRightMenu();
+ });
+ addEventListener(rm.menuItems.music[3], "click", () => {
+ const title = Array.from(document.querySelectorAll(".aplayer-title")).map(
+ (e) => e.innerText
+ )[0];
+ rm.copyText(title);
+ });
+ }
+
+ addEventListener(rm.menuItems.copy, "click", () => {
+ if (GLOBAL_CONFIG.copyright) {
+ const { limit, author, link, source, info } = GLOBAL_CONFIG.right_menu;
+ if (selectTextNow.length > limit) {
+ selectTextNow = `${selectTextNow}\n\n${author}\n${link}${window.location.href}\n${source}\n${info}`;
+ }
+ }
+ rm.copyText(selectTextNow);
+ rm.hideRightMenu();
+ });
+
+ if (utils.saveToLocal.get("commentBarrageSwitch") !== null) {
+ rm.menuItems.barrage && rm.barrage(!utils.saveToLocal.get("commentBarrageSwitch"));
+ }
+
+ addEventListener(rm.menuItems.paste, "click", () =>
+ rm.pasteText() && rm.hideRightMenu()
+ );
+ GLOBAL_CONFIG.comment &&
+ addEventListener(rm.menuItems.comment, "click", () =>
+ rm.hideRightMenu() || sco.toTalk(selectTextNow)
+ );
+ addEventListener(rm.menuItems.new, "click", () =>
+ window.open(rm.domhref) && rm.hideRightMenu()
+ );
+ addEventListener(rm.menuItems.downloadImg, "click", () =>
+ rm.downloadImage() && rm.hideRightMenu()
+ );
+ addEventListener(rm.menuItems.copyImg, "click", () =>
+ rm.copyImage() && rm.hideRightMenu()
+ );
+ addEventListener(rm.menuItems.copyLink, "click", () =>
+ rm.copyText(rm.domhref) && rm.hideRightMenu()
+ );
+})();
\ No newline at end of file
diff --git a/public/js/script.js b/public/js/script.js
new file mode 100644
index 0000000..6c1bd0e
--- /dev/null
+++ b/public/js/script.js
@@ -0,0 +1,138 @@
+(function($){
+ // Search
+ var $searchWrap = $('#search-form-wrap'),
+ isSearchAnim = false,
+ searchAnimDuration = 200;
+
+ var startSearchAnim = function(){
+ isSearchAnim = true;
+ };
+
+ var stopSearchAnim = function(callback){
+ setTimeout(function(){
+ isSearchAnim = false;
+ callback && callback();
+ }, searchAnimDuration);
+ };
+
+ $('.nav-search-btn').on('click', function(){
+ if (isSearchAnim) return;
+
+ startSearchAnim();
+ $searchWrap.addClass('on');
+ stopSearchAnim(function(){
+ $('.search-form-input').focus();
+ });
+ });
+
+ $('.search-form-input').on('blur', function(){
+ startSearchAnim();
+ $searchWrap.removeClass('on');
+ stopSearchAnim();
+ });
+
+ // Share
+ $('body').on('click', function(){
+ $('.article-share-box.on').removeClass('on');
+ }).on('click', '.article-share-link', function(e){
+ e.stopPropagation();
+
+ var $this = $(this),
+ url = $this.attr('data-url'),
+ encodedUrl = encodeURIComponent(url),
+ id = 'article-share-box-' + $this.attr('data-id'),
+ title = $this.attr('data-title'),
+ offset = $this.offset();
+
+ if ($('#' + id).length){
+ var box = $('#' + id);
+
+ if (box.hasClass('on')){
+ box.removeClass('on');
+ return;
+ }
+ } else {
+ var html = [
+ '',
+ '
',
+ '
',
+ '
',
+ '
',
+ '
',
+ '
',
+ '
',
+ '
'
+ ].join('');
+
+ var box = $(html);
+
+ $('body').append(box);
+ }
+
+ $('.article-share-box.on').hide();
+
+ box.css({
+ top: offset.top + 25,
+ left: offset.left
+ }).addClass('on');
+ }).on('click', '.article-share-box', function(e){
+ e.stopPropagation();
+ }).on('click', '.article-share-box-input', function(){
+ $(this).select();
+ }).on('click', '.article-share-box-link', function(e){
+ e.preventDefault();
+ e.stopPropagation();
+
+ window.open(this.href, 'article-share-box-window-' + Date.now(), 'width=500,height=450');
+ });
+
+ // Caption
+ $('.article-entry').each(function(i){
+ $(this).find('img').each(function(){
+ if ($(this).parent().hasClass('fancybox') || $(this).parent().is('a')) return;
+
+ var alt = this.alt;
+
+ if (alt) $(this).after('' + alt + ' ');
+
+ $(this).wrap(' ')
+ });
+
+ $(this).find('.fancybox').each(function(){
+ $(this).attr('rel', 'article' + i);
+ });
+ });
+
+ if ($.fancybox){
+ $('.fancybox').fancybox();
+ }
+
+ // Mobile nav
+ var $container = $('#container'),
+ isMobileNavAnim = false,
+ mobileNavAnimDuration = 200;
+
+ var startMobileNavAnim = function(){
+ isMobileNavAnim = true;
+ };
+
+ var stopMobileNavAnim = function(){
+ setTimeout(function(){
+ isMobileNavAnim = false;
+ }, mobileNavAnimDuration);
+ }
+
+ $('#main-nav-toggle').on('click', function(){
+ if (isMobileNavAnim) return;
+
+ startMobileNavAnim();
+ $container.toggleClass('mobile-nav-on');
+ stopMobileNavAnim();
+ });
+
+ $('#wrap').on('click', function(){
+ if (isMobileNavAnim || !$container.hasClass('mobile-nav-on')) return;
+
+ $container.removeClass('mobile-nav-on');
+ });
+})(jQuery);
\ No newline at end of file
diff --git a/public/js/search/algolia.js b/public/js/search/algolia.js
new file mode 100644
index 0000000..4e5741a
--- /dev/null
+++ b/public/js/search/algolia.js
@@ -0,0 +1,181 @@
+window.addEventListener("load", () => {
+ const $searchMask = document.getElementById("search-mask");
+ const $searchDialog = document.querySelector("#algolia-search .search-dialog");
+
+ window.openSearch = () => {
+ utils.animateIn($searchMask, "to_show 0.5s");
+ $searchDialog.style.display = "block";
+ setTimeout(() => {
+ document.querySelector("#algolia-search .ais-SearchBox-input").focus();
+ }, 100);
+ document.addEventListener("keydown", function f(event) {
+ if (event.code === "Escape") {
+ closeSearch();
+ document.removeEventListener("keydown", f);
+ }
+ });
+ fixSafariHeight();
+ window.addEventListener("resize", fixSafariHeight);
+ };
+
+ const closeSearch = () => {
+ utils.animateOut($searchDialog, "search_close .5s");
+ utils.animateOut($searchMask, "to_hide 0.5s");
+ window.removeEventListener("resize", fixSafariHeight);
+ };
+
+ const fixSafariHeight = () => {
+ if (window.innerWidth < 768) {
+ $searchDialog.style.setProperty("--search-height", window.innerHeight + "px");
+ }
+ };
+
+ const addEventCtrlK = () => {
+ document.addEventListener("keydown", function (event) {
+ if (event.ctrlKey && event.key === "k") {
+ event.preventDefault();
+ openSearch();
+ }
+ });
+ }
+
+ addEventCtrlK()
+
+ const searchClickFn = () => {
+ utils.addEventListenerPjax(document.querySelector("#search-button > .search"), "click", openSearch);
+
+ GLOBAL_CONFIG.right_menu && document.getElementById("menu-search").addEventListener("click", function (){
+ rm.hideRightMenu();
+ openSearch();
+ let t=document.getElementsByClassName('ais-SearchBox-input')[0];
+ let evt = document.createEvent('HTMLEvents');
+ evt.initEvent('input', true,true)
+ t.value = selectTextNow
+ t.dispatchEvent(evt)
+ })
+ };
+
+ const searchFnOnce = () => {
+ $searchMask.addEventListener("click", closeSearch);
+ document.querySelector("#algolia-search .search-close-button").addEventListener("click", closeSearch);
+ };
+
+ const algolia = GLOBAL_CONFIG.algolia;
+ const isAlgoliaValid = algolia.appId && algolia.apiKey && algolia.indexName;
+ if (!isAlgoliaValid) {
+ return console.error("Algolia setting is invalid!");
+ }
+
+ const search = instantsearch({
+ indexName: algolia.indexName,
+ searchClient: algoliasearch(algolia.appId, algolia.apiKey),
+ searchFunction(helper) {
+ if (helper.state.query) {
+ let innerLoading = ' ';
+ document.getElementById("algolia-hits").innerHTML = innerLoading;
+ helper.search();
+ }
+ },
+ });
+
+ const configure = instantsearch.widgets.configure({
+ hitsPerPage: algolia.hits.per_page || 5,
+ });
+
+ const searchBox = instantsearch.widgets.searchBox({
+ container: "#algolia-search-input",
+ showReset: false,
+ showSubmit: false,
+ placeholder: GLOBAL_CONFIG.lang.search.placeholder,
+ showLoadingIndicator: true,
+ searchOnEnterKeyPressOnly: true,
+ searchAsYouType: false,
+ });
+
+ const hits = instantsearch.widgets.hits({
+ container: "#algolia-hits",
+ templates: {
+ item(data) {
+ const link = data.permalink ? data.permalink : GLOBAL_CONFIG.root + data.path;
+ const result = data._highlightResult;
+ const loadingLogo = document.querySelector("#algolia-hits .st-spin");
+ if (loadingLogo) {
+ loadingLogo.style.display = "none";
+ }
+ setTimeout(() => {
+ document.querySelector("#algolia-search .ais-SearchBox-input").focus();
+ }, 200);
+ return `
+
+ ${result.title.value || "no-title"}
+ `;
+ },
+ empty: function (data) {
+ const loadingLogo = document.querySelector("#algolia-hits .st-spin");
+ if (loadingLogo) {
+ loadingLogo.style.display = "none";
+ }
+ setTimeout(() => {
+ document.querySelector("#algolia-search .ais-SearchBox-input").focus();
+ }, 200);
+ return (
+ '' +
+ GLOBAL_CONFIG.lang.search.empty.replace(/\$\{query}/, data.query) +
+ "
"
+ );
+ },
+ },
+ cssClasses: {
+ item: "algolia-hit-item",
+ },
+ });
+
+ const pagination = instantsearch.widgets.pagination({
+ container: "#algolia-pagination",
+ totalPages: algolia.hits.per_page ?? 5,
+ scrollTo: false,
+ showFirstLast: false,
+ templates: {
+ first: ' ',
+ last: ' ',
+ previous: ' ',
+ next: ' ',
+ },
+ cssClasses: {
+ root: "pagination",
+ item: "pagination-item",
+ link: "page-number",
+ active: "current",
+ disabled: "disabled-item",
+ },
+ });
+
+ const stats = instantsearch.widgets.stats({
+ container: "#algolia-tips > #algolia-stats",
+ templates: {
+ text: function (data) {
+ const stats = GLOBAL_CONFIG.lang.search.hit
+ .replace(/\$\{hits}/, data.nbHits)
+ .replace(/\$\{time}/, data.processingTimeMS);
+ return ` ${stats}`;
+ },
+ },
+ });
+
+ search.addWidgets([configure, searchBox,stats, hits, pagination]);
+
+ search.start();
+
+ searchClickFn();
+ searchFnOnce();
+
+ window.addEventListener("pjax:complete", () => {
+ !utils.isHidden($searchMask) && closeSearch();
+ searchClickFn();
+ });
+
+ window.pjax &&
+ search.on("render", () => {
+ window.pjax.refresh(document.getElementById("algolia-hits"));
+ });
+});
\ No newline at end of file
diff --git a/public/js/search/local.js b/public/js/search/local.js
new file mode 100644
index 0000000..2c2f2ac
--- /dev/null
+++ b/public/js/search/local.js
@@ -0,0 +1,205 @@
+window.addEventListener("load", () => {
+ let store = [];
+ const $searchMask = document.getElementById("search-mask");
+ const $searchDialog = document.querySelector("#local-search .search-dialog");
+ window.openSearch = () => {
+ utils.animateIn($searchMask, "to_show 0.5s");
+ $searchDialog.style.display = "block";
+ setTimeout(() => {
+ document.querySelector("#local-search .search-box-input").focus();
+ }, 100);
+ document.addEventListener("keydown", function f(event) {
+ if (event.code === "Escape") {
+ closeSearch();
+ document.removeEventListener("keydown", f);
+ }
+ });
+ fixSafariHeight();
+ window.addEventListener("resize", fixSafariHeight);
+ };
+ const fixSafariHeight = () => {
+ if (window.innerWidth < 768) {
+ $searchDialog.style.setProperty("--search-height", window.innerHeight + "px");
+ }
+ };
+ const closeSearch = () => {
+ utils.animateOut($searchDialog, "search_close .5s");
+ utils.animateOut($searchMask, "to_hide 0.5s");
+ window.removeEventListener("resize", fixSafariHeight);
+ };
+
+ const addEventTagList = () => {
+ const list = document.querySelectorAll("#local-search .tag-list");
+ if (list.length > 0) {
+ list.forEach(el => el.addEventListener("click", (e) => closeSearch()))
+ }
+ }
+
+ addEventTagList()
+
+ const addEventCtrlK = () => {
+ document.addEventListener("keydown", function (event) {
+ if (event.ctrlKey && event.key === "k") {
+ event.preventDefault();
+ openSearch();
+ }
+ });
+ }
+
+ addEventCtrlK()
+
+ const searchFnOnce = () => {
+ $searchMask.addEventListener("click", closeSearch);
+ utils.addEventListenerPjax(document.querySelector("#local-search .search-close-button"), "click", closeSearch);
+ };
+
+ searchFnOnce();
+
+ const searchClickFn = () => {
+ utils.addEventListenerPjax(document.querySelector("#search-button > .search"), "click", openSearch);
+
+ GLOBAL_CONFIG.right_menu && document.getElementById("menu-search").addEventListener("click", function () {
+ rm.hideRightMenu();
+ openSearch();
+ let t = document.getElementsByClassName('search-box-input')[0];
+ let evt = document.createEvent('HTMLEvents');
+ evt.initEvent('input', true, true)
+ t.value = selectTextNow
+ t.dispatchEvent(evt)
+ })
+ }
+
+ searchClickFn();
+
+ function init() {
+ fetch(GLOBAL_CONFIG.localsearch.path)
+ .then(response => response.text())
+ .then(data => {
+ let parser = new DOMParser();
+ let xmlDoc = parser.parseFromString(data, "text/xml");
+ let entries = xmlDoc.getElementsByTagName("entry");
+ for (let i = 0; i < entries.length; i++) {
+ let entry = entries[i];
+ let title = entry.getElementsByTagName("title")[0].textContent;
+ let link = entry.getElementsByTagName("url")[0].textContent;
+ let content = entry.getElementsByTagName("content")[0].textContent;
+ store.push({
+ 'title': title,
+ 'link': link,
+ 'content': content
+ });
+ }
+ })
+ .catch(err => console.error("Error loading search data:", err));
+ }
+
+ let query = ''
+ let currentPage = 0;
+ const resultsPerPage = 10;
+ let results = [];
+
+ function initUI() {
+ const $results = document.getElementById("search-results");
+ const $search = document.getElementById("search-input");
+ $search.addEventListener('keydown', function (e) {
+ if (e.keyCode === 13) {
+ e.preventDefault();
+ $results.innerHTML = '';
+ query = this.value.trim();
+ if (query !== '') {
+ results = search(query);
+ renderResults(results, currentPage);
+ renderPagination(results.length);
+ } else {
+ clearSearchResults();
+ }
+ }
+ });
+ }
+
+ function clearSearchResults() {
+ const $results = document.getElementById("search-results");
+ const $pagination = document.getElementById("search-pagination");
+ const $tips = document.getElementById("search-tips");
+
+ $results.innerHTML = '';
+ $pagination.innerHTML = '';
+ $tips.innerHTML = '';
+ }
+
+ function search(query) {
+ const regex = new RegExp(query.split('').join('.*'), 'i');
+ return store.filter(page => regex.test(page.title) || regex.test(page.content));
+ }
+
+ function renderResults(results, page) {
+ const $search_results = document.getElementById("search-results");
+ $search_results.innerHTML = '';
+ const $tips = document.getElementById("search-tips");
+ $tips.innerHTML = '';
+ const start = page * resultsPerPage;
+ const end = start + resultsPerPage;
+ if (!results.length) {
+ const $empty = document.createElement("span");
+ $empty.className = "search-result-empty";
+ $empty.textContent = GLOBAL_CONFIG.lang.search.empty.replace(/\$\{query}/, query);
+ $search_results.appendChild($empty);
+ return;
+ }
+ results.slice(start, end).forEach(function (result) {
+ const $result = document.createElement("li");
+ $result.className = "search-result-item";
+ const $link = document.createElement("a");
+ $link.className = "search-result-title";
+ $link.href = result.link;
+ $link.innerHTML = highlightSearchKeyword(result.title, query);
+ $result.appendChild($link);
+ $search_results.appendChild($result);
+ });
+ const count = document.createElement("span");
+ count.className = "search-result-count";
+ count.innerHTML = GLOBAL_CONFIG.lang.search.count.replace(/\$\{count}/, results.length)
+ $tips.appendChild(count);
+ }
+
+ function highlightSearchKeyword(text, keyword) {
+ const regex = new RegExp(`(${keyword.split(' ').join('|')})`, 'gi');
+ return text.replace(regex, '$1 ');
+ }
+
+ function renderPagination(totalResults) {
+ const totalPages = Math.ceil(totalResults / resultsPerPage);
+ const paginationContainer = document.getElementById("search-pagination");
+ paginationContainer.innerHTML = '';
+ const paginationList = document.createElement("ul");
+ paginationList.className = "pagination-list";
+
+ for (let i = 0; i < totalPages; i++) {
+ const button = document.createElement("li");
+ button.className = "pagination-item";
+ button.textContent = i + 1;
+ if (i === currentPage) {
+ button.classList.add('select');
+ }
+ button.addEventListener('click', function () {
+ currentPage = i;
+ renderResults(results, i);
+ document.querySelectorAll(".pagination-item").forEach(function (btn) {
+ btn.classList.remove('select');
+ });
+ button.classList.add('select');
+ });
+ paginationList.appendChild(button);
+ }
+ paginationContainer.appendChild(paginationList);
+ }
+
+ init();
+ initUI();
+ window.addEventListener('DOMContentLoaded', (event) => {
+ initUI();
+ });
+ window.addEventListener('pjax:complete', () => {
+ searchClickFn()
+ })
+});
\ No newline at end of file
diff --git a/public/js/third_party/barrage.min.js b/public/js/third_party/barrage.min.js
new file mode 100644
index 0000000..991eec2
--- /dev/null
+++ b/public/js/third_party/barrage.min.js
@@ -0,0 +1,6 @@
+/**
+ * Barrage Comment
+ * author: @efuo
+ * date: 2024-04-28
+ */
+function _0x2736(_0x423b83,_0x26de1b){const _0x562b41=_0x562b();return _0x2736=function(_0x2736dc,_0x1e863c){_0x2736dc=_0x2736dc-0x11f;let _0x1c44ad=_0x562b41[_0x2736dc];return _0x1c44ad;},_0x2736(_0x423b83,_0x26de1b);}const _0xf096ba=_0x2736;(function(_0x244294,_0x51eb5a){const _0x2047ac=_0x2736,_0x461abb=_0x244294();while(!![]){try{const _0x362f69=-parseInt(_0x2047ac(0x12f))/0x1+-parseInt(_0x2047ac(0x126))/0x2+-parseInt(_0x2047ac(0x120))/0x3+-parseInt(_0x2047ac(0x15b))/0x4+parseInt(_0x2047ac(0x13c))/0x5+parseInt(_0x2047ac(0x153))/0x6*(parseInt(_0x2047ac(0x15c))/0x7)+parseInt(_0x2047ac(0x132))/0x8*(parseInt(_0x2047ac(0x152))/0x9);if(_0x362f69===_0x51eb5a)break;else _0x461abb['push'](_0x461abb['shift']());}catch(_0x59d2ed){_0x461abb['push'](_0x461abb['shift']());}}}(_0x562b,0xa9d59));class Barrage{constructor(_0x35d098){const _0xc51bb8=_0x2736;this['comments']=_0x35d098,this[_0xc51bb8(0x136)]=document[_0xc51bb8(0x15a)](_0xc51bb8(0x142)),this[_0xc51bb8(0x12c)]=[],this[_0xc51bb8(0x133)]=0x0,this[_0xc51bb8(0x139)]=[],this[_0xc51bb8(0x14b)]=![],this[_0xc51bb8(0x146)]();}[_0xf096ba(0x13e)]=_0x50912d=>{const _0x243af9=_0xf096ba;return _0x50912d['flatMap'](_0x18bbb5=>_0x18bbb5[_0x243af9(0x14a)]?[_0x18bbb5,...this['filterAndFlatten'](_0x18bbb5[_0x243af9(0x14a)])]:[_0x18bbb5]);};[_0xf096ba(0x135)](_0x25b918){const _0x4cf7a3=_0xf096ba;return _0x25b918[_0x4cf7a3(0x124)](/(<([^>]+)>)/ig,'')[_0x4cf7a3(0x12e)]();}[_0xf096ba(0x147)](_0x3c5b88){const _0x58f618=_0xf096ba,_0x1c09f9=this[_0x58f618(0x135)](_0x3c5b88[_0x58f618(0x156)]);if(!_0x1c09f9)return![];const _0xbed29a=document[_0x58f618(0x127)]('div');return _0xbed29a[_0x58f618(0x122)]=_0x58f618(0x138),_0xbed29a[_0x58f618(0x12d)]=''+GLOBAL_CONFIG[_0x58f618(0x125)][_0x58f618(0x158)][_0x58f618(0x134)]+_0x58f618(0x140)+_0x3c5b88['nick']+_0x58f618(0x149)+GLOBAL_CONFIG[_0x58f618(0x130)][_0x58f618(0x13b)]+_0x58f618(0x143)+_0x3c5b88[_0x58f618(0x131)]+_0x58f618(0x14d)+(_0x3c5b88['id']?_0x58f618(0x14f)+_0x3c5b88['id']+'\x27)':'javascript:sco.scrollTo(\x27post-comment\x27)')+'\x22>'+_0x1c09f9+_0x58f618(0x11f),this[_0x58f618(0x136)][_0x58f618(0x155)](_0xbed29a),this[_0x58f618(0x139)][_0x58f618(0x12a)](_0xbed29a),!![];}[_0xf096ba(0x141)](_0x4142a6){const _0x5da976=_0xf096ba;_0x4142a6[_0x5da976(0x13a)][_0x5da976(0x14e)](_0x5da976(0x13f)),setTimeout(()=>this[_0x5da976(0x136)][_0x5da976(0x121)](_0x4142a6),0x3e8);}[_0xf096ba(0x154)](){const _0x3d0cb8=_0xf096ba;if(this['barrageList'][_0x3d0cb8(0x159)]&&!this[_0x3d0cb8(0x14b)]){if(!this[_0x3d0cb8(0x147)](this['barrageList'][this[_0x3d0cb8(0x133)]]))return this[_0x3d0cb8(0x133)]=(this[_0x3d0cb8(0x133)]+0x1)%this[_0x3d0cb8(0x12c)][_0x3d0cb8(0x159)],this[_0x3d0cb8(0x154)]();this[_0x3d0cb8(0x133)]=(this[_0x3d0cb8(0x133)]+0x1)%this['barrageList'][_0x3d0cb8(0x159)];}this[_0x3d0cb8(0x139)][_0x3d0cb8(0x159)]>Math['min'](0x1,this['barrageList'][_0x3d0cb8(0x159)])&&!this[_0x3d0cb8(0x14b)]&&this[_0x3d0cb8(0x141)](this['barrageTimer'][_0x3d0cb8(0x150)]());}['initBarrage'](){const _0x571de5=_0xf096ba,_0x2e2e3e=utils[_0x571de5(0x157)][_0x571de5(0x137)](_0x571de5(0x128));this[_0x571de5(0x136)]['style']['display']=_0x2e2e3e?_0x571de5(0x13d):_0x571de5(0x144),this[_0x571de5(0x12c)]=this['filterAndFlatten'](this[_0x571de5(0x145)]),this[_0x571de5(0x136)][_0x571de5(0x12d)]='',clearInterval(this['commentInterval']),this[_0x571de5(0x14c)]=setInterval(()=>this[_0x571de5(0x154)](),0x1388);}[_0xf096ba(0x146)](){const _0x81bb1e=_0xf096ba;this['initBarrage'](),this['dom'][_0x81bb1e(0x148)]('mouseover',()=>this['hoverOnCommentBarrage']=!![]),this[_0x81bb1e(0x136)][_0x81bb1e(0x148)](_0x81bb1e(0x151),()=>this[_0x81bb1e(0x14b)]=![]);}[_0xf096ba(0x123)](){const _0x569798=_0xf096ba;clearInterval(this[_0x569798(0x14c)]),this[_0x569798(0x136)][_0x569798(0x129)]('mouseover',()=>this[_0x569798(0x14b)]=!![]),this[_0x569798(0x136)][_0x569798(0x129)](_0x569798(0x151),()=>this['hoverOnCommentBarrage']=![]),this[_0x569798(0x136)][_0x569798(0x12d)]='';}}function _0x562b(){const _0x3031bd=[' ','3742368aCgLQg','removeChild','className','destroy','replace','lang','1438760uXBNRa','createElement','commentBarrageSwitch','removeEventListener','push','currentBarrage','barrageList','innerHTML','trim','271090IyHbzI','comment','mailMd5','8MDfQRc','barrageIndex','title','sanitizeContent','dom','get','comment-barrage-item','barrageTimer','classList','avatar','5632610YtcmxI','flex','filterAndFlatten','out',' ','removeBarrageItem','.comment-barrage','/avatar/','none','comments','init','createBarrageItem','addEventListener'];_0x562b=function(){return _0x3031bd;};return _0x562b();}function initializeCommentBarrage(_0x506af1){const _0x438d69=_0xf096ba;if(_0x506af1[_0x438d69(0x159)]===0x0)return;let _0x6d138e=window[_0x438d69(0x12b)];if(_0x6d138e)_0x6d138e[_0x438d69(0x123)]();window[_0x438d69(0x12b)]=new Barrage(_0x506af1);}
\ No newline at end of file
diff --git a/public/js/third_party/efu_ai.min.js b/public/js/third_party/efu_ai.min.js
new file mode 100644
index 0000000..db87199
--- /dev/null
+++ b/public/js/third_party/efu_ai.min.js
@@ -0,0 +1,6 @@
+/**
+ * author: Efu
+ * email: o@efu.me
+ * website: https://efu.me
+ */
+class efuAI{constructor(){this.root="https://summary.tianli0.top",this.aiTalkMode=!1,this.aiPostExplanation='',this.config=GLOBAL_CONFIG.post_ai,this.scoGPTIsRunning=!1}init(){if(!document.querySelector(".ai-explanation"))return;this.scoGPTIsRunning=!1;this.aiPostExplanation=PAGE_CONFIG.ai_text?PAGE_CONFIG.ai_text+"":false;if(!this.aiPostExplanation){this.generate()}else{this.aiShowAnimation(Promise.resolve(this.aiPostExplanation))}this.AIEngine()}getTitleAndContent(){const e=document.getElementById("article-container"),t=document.title,n=e.getElementsByTagName("p"),i=e.querySelectorAll("h1, h2, h3, h4, h5");return(t+" "+Array.from(i).concat(Array.from(n)).map((e=>e.innerText.replace(/https?:\/\/[^\s]+/g,""))).join(" ")).slice(0,1e3)}async generate(){this.aiShowAnimation(this.fetch(document.title,this.getTitleAndContent(),this.config.key))}async fetch(e,t,n){const i=`${this.root}/?content=${encodeURIComponent(t)}&title=${e}&key=${encodeURIComponent(n)}&url=${encodeURIComponent(window.location.href)}`,s=await fetch(i),o=await s.json();return s.ok?(this.aiPostExplanation=o.summary,o.summary):(console.error("Request failed:",o.err_msg),o.err_msg)}aiShowAnimation(e,t=!1){const n=document.querySelector(".ai-explanation"),i=document.querySelector(".ai-tag");if(!n||this.scoGPTIsRunning)return;this.scoGPTIsRunning=!0,this.cleanSuggestions(),i.classList.add("loadingAI"),n.style.display="block",n.innerHTML='生成中...
';let s,o,a=!0,c=0,r=!0;const l=new IntersectionObserver((e=>{a=e[0].isIntersecting,a&&requestAnimationFrame(o)}),{threshold:0});e.then((e=>{s=performance.now(),o=()=>{if(c
=(u?100*Math.random()+100:m?10:25)&&(n.innerText=e.slice(0,c+1),s=r,c++,c':(n.innerHTML=e,n.style.display="block",this.scoGPTIsRunning=!1,i.classList.remove("loadingAI"),l.disconnect(),t&&this.createSuggestions())),a&&requestAnimationFrame(o)}},a&&r&&setTimeout((()=>{requestAnimationFrame(o),r=!1}),3e3),l.observe(n)})).catch((e=>{console.error("检索信息失败:",e),n.innerHTML="检索信息失败",n.style.display="block",this.scoGPTIsRunning=!1,i.classList.remove("loadingAI"),l.disconnect()}))}AIEngine(){const e=document.querySelector(".ai-tag");e&&e.addEventListener("click",(()=>{this.scoGPTIsRunning||(this.aiTalkMode=!0,this.aiShowAnimation(Promise.resolve(this.config.talk),!0))}))}cleanSuggestions(){const e=document.querySelector(".ai-suggestions");e?e.innerHTML="":console.error("没有这个元素:'ai-suggestions'")}createSuggestions(){this.aiTalkMode&&(this.cleanSuggestions(),this.createSuggestionItemWithAction("这篇文章讲了什么?",(()=>{""===this.aiPostExplanation?this.generate():this.aiShowAnimation(Promise.resolve(this.aiPostExplanation),!0)})),this.config.randomPost&&this.createSuggestionItemWithAction("带我去看看其他文章",(()=>toRandomPost())),this.aiTalkMode=!0)}createSuggestionItemWithAction(e,t){const n=document.querySelector(".ai-suggestions");if(!n)return void console.error("无法找到具有class为ai-suggestions的元素");const i=document.createElement("div");i.classList.add("ai-suggestions-item"),i.textContent=e,i.addEventListener("click",t),n.appendChild(i)}}const efu_ai=new efuAI;
\ No newline at end of file
diff --git a/public/js/third_party/envelope.min.js b/public/js/third_party/envelope.min.js
new file mode 100644
index 0000000..ef5f436
--- /dev/null
+++ b/public/js/third_party/envelope.min.js
@@ -0,0 +1,5 @@
+/**
+ * EasyDanmaku v1.0.0
+ * author: Leonus
+ */
+class EasyDanmaku{constructor(t){this.container=this.checkParams(t),this.pathname=t.page||null,this.wrapperStyle=t.wrapperStyle||null,this.line=t.line||10,this.speed=t.speed||5,this.runtime=t.runtime||10,this.colourful=t.colourful||!1,this.loop=t.loop||!1,this.hover=t.hover||!1,this.coefficient=t.coefficient||1.38,this.originIndex=0,this.originList=null,this.offsetValue=this.container.offsetHeight/this.line,this.vipIndex=0,this.overflowArr=[],this.clearIng=!1,this.cleartimer=null,this.init(),this.handleEvents(t)}handleEvents(t){this.onComplete=t.onComplete||null,this.onHover=t.onHover||null}init(){this.runstatus=1,this.aisle=[],this.container.style.overflow="hidden",this.hover&&this.handleMouseHover(),"relative"!==Utils.getStyle(this.container,"position")&&"fixed"!==Utils.getStyle(this.container,"position")&&(this.container.style.position="relative");for(let t=0;t{l+=t,l>n.offsetWidth*this.coefficient&&(this.aisle[r].normalRow=!0,clearInterval(o))}),16.66),setTimeout((()=>{1!=n.getAttribute("relieveDel")&&(i&&i({runtime:s,target:n,width:n.offsetWidth}),n.remove())}),1e3*s)}else{this.aisle.some((t=>!0===t.normalRow))?a.call(this):(()=>{this.overflowArr.push({content:t,normalClass:e}),this.clearIng||this.clearOverflowDanmakuArray()})()}}.call(this)}batchSend(t,e=!1,i=null){let n=this.runtime||1.23*t.length;this.originList=t,this.hasAvatar=e,this.normalClass=i;let r=setInterval((()=>{location.pathname!=this.pathname&&clearInterval(r),this.originIndex>t.length-1?(clearInterval(r),this.originIndex=0,this.onComplete&&this.onComplete(),this.loop&&this.batchSend(this.originList,e,i)):(e?this.send(`${t[this.originIndex].url?'':""} \n ${t[this.originIndex].content}
${t[this.originIndex].url?" ":""}\n `,i||this.wrapperStyle):this.send(t[this.originIndex],i||this.wrapperStyle),this.originIndex++)}),n/t.length*1e3)}centeredSend(t,e,i=3e3,n=null){let r=document.createElement("div"),s=0;r.innerHTML=t,(e||this.wrapperStyle)&&r.classList.add(e||this.wrapperStyle),function t(){if(this.aisle[s].vipRow)this.container.appendChild(r),r.style.cssText=`\n position:absolute;\n left:50%;\n transform:translateX(-50%);\n top: ${s*this.offsetValue}px;\n `,this.aisle[s].vipRow=!1,setTimeout((()=>{n&&n({duration:i,target:r,width:r.offsetWidth}),r.remove(),this.aisle[s].vipRow=!0}),i);else{if(s++,s>this.line-1)return;t.call(this)}}.call(this)}play(){const t=this.container.children;for(let e=0;e{t.remove()}),1e3*this.speed)}else if(e===i){clearTimeout(t.timer);const e=Utils.getStyle(t,"transform").match(n)[1];t.style.transition="transform 0s linear",t.style.transform=`translateX(-${e}px)`,t.setAttribute("relieveDel",1)}}handleMouseHover(){Utils.eventDelegation(this.container,"default-style","mouseover",(t=>{t.style["z-index"]=1e3,this.controlDanmakurunStatus(t,0),this.onHover&&this.onHover(t)})),Utils.eventDelegation(this.container,"default-style","mouseout",(t=>{t.style.zIndex=1,1==this.runstatus&&this.controlDanmakurunStatus(t,1)}))}clearOverflowDanmakuArray(){clearInterval(this.cleartimer),this.clearIng=!0;let t=0;this.cleartimer=setInterval((()=>{0===this.overflowArr.length?(t++,t>20&&(clearInterval(this.cleartimer),this.clearIng=!1)):(this.send(this.overflowArr[0].content,this.overflowArr[0].normalClass||this.wrapperStyle),this.overflowArr.shift())}),500)}}class Utils{static getStyle(t,e){return window.getComputedStyle(t,null)[e]}static eventDelegation(t,e,i,n){t.addEventListener(i,(t=>{try{t.target.className.includes(e)?n(t.target):t.target.parentNode.className.includes(e)&&n(t.target.parentNode)}catch(t){}}))}}
\ No newline at end of file
diff --git a/public/js/third_party/universe.min.js b/public/js/third_party/universe.min.js
new file mode 100644
index 0000000..10b43ee
--- /dev/null
+++ b/public/js/third_party/universe.min.js
@@ -0,0 +1,5 @@
+/**
+ * @name: Universe
+ * author: Leonus
+ */
+function dark(){window.requestAnimationFrame=window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||window.msRequestAnimationFrame;var t,i,e,s,n=.05,h=document.getElementById("universe"),a=!0,o="226,225,224",r=[];function d(){t=window.innerWidth,i=window.innerHeight,e=.216*t,h.setAttribute("width",t),h.setAttribute("height",i)}function c(){s.clearRect(0,0,t,i);for(var e=r.length,n=0;nthis.opacityTresh),this.opacity+=this.do)},this.fadeOut=function(){this.fadingOut&&(this.fadingOut=!(this.opacity<0),this.opacity-=this.do/2,(this.x>t||this.y<0)&&(this.fadingOut=!1,this.reset()))},this.draw=function(){if(s.beginPath(),this.giant)s.fillStyle="rgba(180,184,240,"+this.opacity+")",s.arc(this.x,this.y,2,0,2*Math.PI,!1);else if(this.comet){s.fillStyle="rgba("+o+","+this.opacity+")",s.arc(this.x,this.y,1.5,0,2*Math.PI,!1);for(var t=0;t<30;t++)s.fillStyle="rgba("+o+","+(this.opacity-this.opacity/20*t)+")",s.rect(this.x-this.dx/4*t,this.y-this.dy/4*t-2,2,2),s.fill()}else s.fillStyle="rgba(226,225,142,"+this.opacity+")",s.rect(this.x,this.y,this.r,this.r);s.closePath(),s.fill()},this.move=function(){this.x+=this.dx,this.y+=this.dy,!1===this.fadingOut&&this.reset(),(this.x>t-t/4||this.y<0)&&(this.fadingOut=!0)},setTimeout((function(){a=!1}),50)}function u(t){return Math.floor(1e3*Math.random())+1<10*t}function m(t,i){return Math.random()*(i-t)+t}d(),window.addEventListener("resize",d,!1),function(){s=h.getContext("2d");for(var t=0;t 0 ||
+ obj === translateButtonObject
+ ) {
+ continue
+ }
+ if (obj.title !== '' && obj.title != null) {
+ obj.title = translateText(obj.title)
+ }
+ if (obj.alt !== '' && obj.alt != null) obj.alt = translateText(obj.alt)
+ if (obj.placeholder !== '' && obj.placeholder != null) {
+ obj.placeholder = translateText(obj.placeholder)
+ }
+ if (
+ obj.tagName === 'INPUT' &&
+ obj.value !== '' &&
+ obj.type !== 'text' &&
+ obj.type !== 'hidden'
+ ) {
+ obj.value = translateText(obj.value)
+ }
+ if (obj.nodeType === 3) obj.data = translateText(obj.data)
+ else translateBody(obj)
+ }
+ }
+
+ function translatePage() {
+ if (targetEncoding === 1) {
+ currentEncoding = 1
+ targetEncoding = 2
+ translateButtonObject.lastChild.textContent = msgToTraditionalChinese
+ translateButtonObject.firstChild.className = 'solitude st-panben-line'
+ utils.snackbarShow('你已切换为简体')
+ } else if (targetEncoding === 2) {
+ currentEncoding = 2
+ targetEncoding = 1
+ translateButtonObject.lastChild.textContent = msgToSimplifiedChinese
+ translateButtonObject.firstChild.className = 'solitude st-jianben-line'
+ utils.snackbarShow('你已切換為繁體')
+ }
+ utils.saveToLocal.set(targetEncodingCookie, targetEncoding, 2)
+ setLang()
+ translateBody()
+ rm.hideRightMenu()
+ }
+
+ function JTPYStr() {
+ return '万与丑专业丛东丝丢两严丧个丬丰临为丽举么义乌乐乔习乡书买乱争于亏云亘亚产亩亲亵亸亿仅从仑仓仪们价众优伙会伛伞伟传伤伥伦伧伪伫体余佣佥侠侣侥侦侧侨侩侪侬俣俦俨俩俪俭债倾偬偻偾偿傥傧储傩儿兑兖党兰关兴兹养兽冁内冈册写军农冢冯冲决况冻净凄凉凌减凑凛几凤凫凭凯击凼凿刍划刘则刚创删别刬刭刽刿剀剂剐剑剥剧劝办务劢动励劲劳势勋勐勚匀匦匮区医华协单卖卢卤卧卫却卺厂厅历厉压厌厍厕厢厣厦厨厩厮县参叆叇双发变叙叠叶号叹叽吁后吓吕吗吣吨听启吴呒呓呕呖呗员呙呛呜咏咔咙咛咝咤咴咸哌响哑哒哓哔哕哗哙哜哝哟唛唝唠唡唢唣唤唿啧啬啭啮啰啴啸喷喽喾嗫呵嗳嘘嘤嘱噜噼嚣嚯团园囱围囵国图圆圣圹场坂坏块坚坛坜坝坞坟坠垄垅垆垒垦垧垩垫垭垯垱垲垴埘埙埚埝埯堑堕塆墙壮声壳壶壸处备复够头夸夹夺奁奂奋奖奥妆妇妈妩妪妫姗姜娄娅娆娇娈娱娲娴婳婴婵婶媪嫒嫔嫱嬷孙学孪宁宝实宠审宪宫宽宾寝对寻导寿将尔尘尧尴尸尽层屃屉届属屡屦屿岁岂岖岗岘岙岚岛岭岳岽岿峃峄峡峣峤峥峦崂崃崄崭嵘嵚嵛嵝嵴巅巩巯币帅师帏帐帘帜带帧帮帱帻帼幂幞干并广庄庆庐庑库应庙庞废庼廪开异弃张弥弪弯弹强归当录彟彦彻径徕御忆忏忧忾怀态怂怃怄怅怆怜总怼怿恋恳恶恸恹恺恻恼恽悦悫悬悭悯惊惧惨惩惫惬惭惮惯愍愠愤愦愿慑慭憷懑懒懔戆戋戏戗战戬户扎扑扦执扩扪扫扬扰抚抛抟抠抡抢护报担拟拢拣拥拦拧拨择挂挚挛挜挝挞挟挠挡挢挣挤挥挦捞损捡换捣据捻掳掴掷掸掺掼揸揽揿搀搁搂搅携摄摅摆摇摈摊撄撑撵撷撸撺擞攒敌敛数斋斓斗斩断无旧时旷旸昙昼昽显晋晒晓晔晕晖暂暧札术朴机杀杂权条来杨杩杰极构枞枢枣枥枧枨枪枫枭柜柠柽栀栅标栈栉栊栋栌栎栏树栖样栾桊桠桡桢档桤桥桦桧桨桩梦梼梾检棂椁椟椠椤椭楼榄榇榈榉槚槛槟槠横樯樱橥橱橹橼檐檩欢欤欧歼殁殇残殒殓殚殡殴毁毂毕毙毡毵氇气氢氩氲汇汉污汤汹沓沟没沣沤沥沦沧沨沩沪沵泞泪泶泷泸泺泻泼泽泾洁洒洼浃浅浆浇浈浉浊测浍济浏浐浑浒浓浔浕涂涌涛涝涞涟涠涡涢涣涤润涧涨涩淀渊渌渍渎渐渑渔渖渗温游湾湿溃溅溆溇滗滚滞滟滠满滢滤滥滦滨滩滪漤潆潇潋潍潜潴澜濑濒灏灭灯灵灾灿炀炉炖炜炝点炼炽烁烂烃烛烟烦烧烨烩烫烬热焕焖焘煅煳熘爱爷牍牦牵牺犊犟状犷犸犹狈狍狝狞独狭狮狯狰狱狲猃猎猕猡猪猫猬献獭玑玙玚玛玮环现玱玺珉珏珐珑珰珲琎琏琐琼瑶瑷璇璎瓒瓮瓯电画畅畲畴疖疗疟疠疡疬疮疯疱疴痈痉痒痖痨痪痫痴瘅瘆瘗瘘瘪瘫瘾瘿癞癣癫癯皑皱皲盏盐监盖盗盘眍眦眬着睁睐睑瞒瞩矫矶矾矿砀码砖砗砚砜砺砻砾础硁硅硕硖硗硙硚确硷碍碛碜碱碹磙礼祎祢祯祷祸禀禄禅离秃秆种积称秽秾稆税稣稳穑穷窃窍窑窜窝窥窦窭竖竞笃笋笔笕笺笼笾筑筚筛筜筝筹签简箓箦箧箨箩箪箫篑篓篮篱簖籁籴类籼粜粝粤粪粮糁糇紧絷纟纠纡红纣纤纥约级纨纩纪纫纬纭纮纯纰纱纲纳纴纵纶纷纸纹纺纻纼纽纾线绀绁绂练组绅细织终绉绊绋绌绍绎经绐绑绒结绔绕绖绗绘给绚绛络绝绞统绠绡绢绣绤绥绦继绨绩绪绫绬续绮绯绰绱绲绳维绵绶绷绸绹绺绻综绽绾绿缀缁缂缃缄缅缆缇缈缉缊缋缌缍缎缏缐缑缒缓缔缕编缗缘缙缚缛缜缝缞缟缠缡缢缣缤缥缦缧缨缩缪缫缬缭缮缯缰缱缲缳缴缵罂网罗罚罢罴羁羟羡翘翙翚耢耧耸耻聂聋职聍联聩聪肃肠肤肷肾肿胀胁胆胜胧胨胪胫胶脉脍脏脐脑脓脔脚脱脶脸腊腌腘腭腻腼腽腾膑臜舆舣舰舱舻艰艳艹艺节芈芗芜芦苁苇苈苋苌苍苎苏苘苹茎茏茑茔茕茧荆荐荙荚荛荜荞荟荠荡荣荤荥荦荧荨荩荪荫荬荭荮药莅莜莱莲莳莴莶获莸莹莺莼萚萝萤营萦萧萨葱蒇蒉蒋蒌蓝蓟蓠蓣蓥蓦蔷蔹蔺蔼蕲蕴薮藁藓虏虑虚虫虬虮虽虾虿蚀蚁蚂蚕蚝蚬蛊蛎蛏蛮蛰蛱蛲蛳蛴蜕蜗蜡蝇蝈蝉蝎蝼蝾螀螨蟏衅衔补衬衮袄袅袆袜袭袯装裆裈裢裣裤裥褛褴襁襕见观觃规觅视觇览觉觊觋觌觍觎觏觐觑觞触觯詟誉誊讠计订讣认讥讦讧讨让讪讫训议讯记讱讲讳讴讵讶讷许讹论讻讼讽设访诀证诂诃评诅识诇诈诉诊诋诌词诎诏诐译诒诓诔试诖诗诘诙诚诛诜话诞诟诠诡询诣诤该详诧诨诩诪诫诬语诮误诰诱诲诳说诵诶请诸诹诺读诼诽课诿谀谁谂调谄谅谆谇谈谊谋谌谍谎谏谐谑谒谓谔谕谖谗谘谙谚谛谜谝谞谟谠谡谢谣谤谥谦谧谨谩谪谫谬谭谮谯谰谱谲谳谴谵谶谷豮贝贞负贠贡财责贤败账货质贩贪贫贬购贮贯贰贱贲贳贴贵贶贷贸费贺贻贼贽贾贿赀赁赂赃资赅赆赇赈赉赊赋赌赍赎赏赐赑赒赓赔赕赖赗赘赙赚赛赜赝赞赟赠赡赢赣赪赵赶趋趱趸跃跄跖跞践跶跷跸跹跻踊踌踪踬踯蹑蹒蹰蹿躏躜躯车轧轨轩轪轫转轭轮软轰轱轲轳轴轵轶轷轸轹轺轻轼载轾轿辀辁辂较辄辅辆辇辈辉辊辋辌辍辎辏辐辑辒输辔辕辖辗辘辙辚辞辩辫边辽达迁过迈运还这进远违连迟迩迳迹适选逊递逦逻遗遥邓邝邬邮邹邺邻郁郄郏郐郑郓郦郧郸酝酦酱酽酾酿释里鉅鉴銮錾钆钇针钉钊钋钌钍钎钏钐钑钒钓钔钕钖钗钘钙钚钛钝钞钟钠钡钢钣钤钥钦钧钨钩钪钫钬钭钮钯钰钱钲钳钴钵钶钷钸钹钺钻钼钽钾钿铀铁铂铃铄铅铆铈铉铊铋铍铎铏铐铑铒铕铗铘铙铚铛铜铝铞铟铠铡铢铣铤铥铦铧铨铪铫铬铭铮铯铰铱铲铳铴铵银铷铸铹铺铻铼铽链铿销锁锂锃锄锅锆锇锈锉锊锋锌锍锎锏锐锑锒锓锔锕锖锗错锚锜锞锟锠锡锢锣锤锥锦锨锩锫锬锭键锯锰锱锲锳锴锵锶锷锸锹锺锻锼锽锾锿镀镁镂镃镆镇镈镉镊镌镍镎镏镐镑镒镕镖镗镙镚镛镜镝镞镟镠镡镢镣镤镥镦镧镨镩镪镫镬镭镮镯镰镱镲镳镴镶长门闩闪闫闬闭问闯闰闱闲闳间闵闶闷闸闹闺闻闼闽闾闿阀阁阂阃阄阅阆阇阈阉阊阋阌阍阎阏阐阑阒阓阔阕阖阗阘阙阚阛队阳阴阵阶际陆陇陈陉陕陧陨险随隐隶隽难雏雠雳雾霁霉霭靓静靥鞑鞒鞯鞴韦韧韨韩韪韫韬韵页顶顷顸项顺须顼顽顾顿颀颁颂颃预颅领颇颈颉颊颋颌颍颎颏颐频颒颓颔颕颖颗题颙颚颛颜额颞颟颠颡颢颣颤颥颦颧风飏飐飑飒飓飔飕飖飗飘飙飚飞飨餍饤饥饦饧饨饩饪饫饬饭饮饯饰饱饲饳饴饵饶饷饸饹饺饻饼饽饾饿馀馁馂馃馄馅馆馇馈馉馊馋馌馍馎馏馐馑馒馓馔馕马驭驮驯驰驱驲驳驴驵驶驷驸驹驺驻驼驽驾驿骀骁骂骃骄骅骆骇骈骉骊骋验骍骎骏骐骑骒骓骔骕骖骗骘骙骚骛骜骝骞骟骠骡骢骣骤骥骦骧髅髋髌鬓魇魉鱼鱽鱾鱿鲀鲁鲂鲄鲅鲆鲇鲈鲉鲊鲋鲌鲍鲎鲏鲐鲑鲒鲓鲔鲕鲖鲗鲘鲙鲚鲛鲜鲝鲞鲟鲠鲡鲢鲣鲤鲥鲦鲧鲨鲩鲪鲫鲬鲭鲮鲯鲰鲱鲲鲳鲴鲵鲶鲷鲸鲹鲺鲻鲼鲽鲾鲿鳀鳁鳂鳃鳄鳅鳆鳇鳈鳉鳊鳋鳌鳍鳎鳏鳐鳑鳒鳓鳔鳕鳖鳗鳘鳙鳛鳜鳝鳞鳟鳠鳡鳢鳣鸟鸠鸡鸢鸣鸤鸥鸦鸧鸨鸩鸪鸫鸬鸭鸮鸯鸰鸱鸲鸳鸴鸵鸶鸷鸸鸹鸺鸻鸼鸽鸾鸿鹀鹁鹂鹃鹄鹅鹆鹇鹈鹉鹊鹋鹌鹍鹎鹏鹐鹑鹒鹓鹔鹕鹖鹗鹘鹚鹛鹜鹝鹞鹟鹠鹡鹢鹣鹤鹥鹦鹧鹨鹩鹪鹫鹬鹭鹯鹰鹱鹲鹳鹴鹾麦麸黄黉黡黩黪黾龙历志制一台皋准复猛钟注范签'
+ }
+
+ function FTPYStr() {
+ return '萬與醜專業叢東絲丟兩嚴喪個爿豐臨為麗舉麼義烏樂喬習鄉書買亂爭於虧雲亙亞產畝親褻嚲億僅從侖倉儀們價眾優夥會傴傘偉傳傷倀倫傖偽佇體餘傭僉俠侶僥偵側僑儈儕儂俁儔儼倆儷儉債傾傯僂僨償儻儐儲儺兒兌兗黨蘭關興茲養獸囅內岡冊寫軍農塚馮衝決況凍淨淒涼淩減湊凜幾鳳鳧憑凱擊氹鑿芻劃劉則剛創刪別剗剄劊劌剴劑剮劍剝劇勸辦務勱動勵勁勞勢勳猛勩勻匭匱區醫華協單賣盧鹵臥衛卻巹廠廳曆厲壓厭厙廁廂厴廈廚廄廝縣參靉靆雙發變敘疊葉號歎嘰籲後嚇呂嗎唚噸聽啟吳嘸囈嘔嚦唄員咼嗆嗚詠哢嚨嚀噝吒噅鹹呱響啞噠嘵嗶噦嘩噲嚌噥喲嘜嗊嘮啢嗩唕喚呼嘖嗇囀齧囉嘽嘯噴嘍嚳囁嗬噯噓嚶囑嚕劈囂謔團園囪圍圇國圖圓聖壙場阪壞塊堅壇壢壩塢墳墜壟壟壚壘墾坰堊墊埡墶壋塏堖塒塤堝墊垵塹墮壪牆壯聲殼壺壼處備複夠頭誇夾奪奩奐奮獎奧妝婦媽嫵嫗媯姍薑婁婭嬈嬌孌娛媧嫻嫿嬰嬋嬸媼嬡嬪嬙嬤孫學孿寧寶實寵審憲宮寬賓寢對尋導壽將爾塵堯尷屍盡層屭屜屆屬屢屨嶼歲豈嶇崗峴嶴嵐島嶺嶽崠巋嶨嶧峽嶢嶠崢巒嶗崍嶮嶄嶸嶔崳嶁脊巔鞏巰幣帥師幃帳簾幟帶幀幫幬幘幗冪襆幹並廣莊慶廬廡庫應廟龐廢廎廩開異棄張彌弳彎彈強歸當錄彠彥徹徑徠禦憶懺憂愾懷態慫憮慪悵愴憐總懟懌戀懇惡慟懨愷惻惱惲悅愨懸慳憫驚懼慘懲憊愜慚憚慣湣慍憤憒願懾憖怵懣懶懍戇戔戲戧戰戩戶紮撲扡執擴捫掃揚擾撫拋摶摳掄搶護報擔擬攏揀擁攔擰撥擇掛摯攣掗撾撻挾撓擋撟掙擠揮撏撈損撿換搗據撚擄摑擲撣摻摜摣攬撳攙擱摟攪攜攝攄擺搖擯攤攖撐攆擷擼攛擻攢敵斂數齋斕鬥斬斷無舊時曠暘曇晝曨顯晉曬曉曄暈暉暫曖劄術樸機殺雜權條來楊榪傑極構樅樞棗櫪梘棖槍楓梟櫃檸檉梔柵標棧櫛櫳棟櫨櫟欄樹棲樣欒棬椏橈楨檔榿橋樺檜槳樁夢檮棶檢欞槨櫝槧欏橢樓欖櫬櫚櫸檟檻檳櫧橫檣櫻櫫櫥櫓櫞簷檁歡歟歐殲歿殤殘殞殮殫殯毆毀轂畢斃氈毿氌氣氫氬氳彙漢汙湯洶遝溝沒灃漚瀝淪滄渢溈滬濔濘淚澩瀧瀘濼瀉潑澤涇潔灑窪浹淺漿澆湞溮濁測澮濟瀏滻渾滸濃潯濜塗湧濤澇淶漣潿渦溳渙滌潤澗漲澀澱淵淥漬瀆漸澠漁瀋滲溫遊灣濕潰濺漵漊潷滾滯灩灄滿瀅濾濫灤濱灘澦濫瀠瀟瀲濰潛瀦瀾瀨瀕灝滅燈靈災燦煬爐燉煒熗點煉熾爍爛烴燭煙煩燒燁燴燙燼熱煥燜燾煆糊溜愛爺牘犛牽犧犢強狀獷獁猶狽麅獮獰獨狹獅獪猙獄猻獫獵獼玀豬貓蝟獻獺璣璵瑒瑪瑋環現瑲璽瑉玨琺瓏璫琿璡璉瑣瓊瑤璦璿瓔瓚甕甌電畫暢佘疇癤療瘧癘瘍鬁瘡瘋皰屙癰痙癢瘂癆瘓癇癡癉瘮瘞瘺癟癱癮癭癩癬癲臒皚皺皸盞鹽監蓋盜盤瞘眥矓著睜睞瞼瞞矚矯磯礬礦碭碼磚硨硯碸礪礱礫礎硜矽碩硤磽磑礄確鹼礙磧磣堿镟滾禮禕禰禎禱禍稟祿禪離禿稈種積稱穢穠穭稅穌穩穡窮竊竅窯竄窩窺竇窶豎競篤筍筆筧箋籠籩築篳篩簹箏籌簽簡籙簀篋籜籮簞簫簣簍籃籬籪籟糴類秈糶糲粵糞糧糝餱緊縶糸糾紆紅紂纖紇約級紈纊紀紉緯紜紘純紕紗綱納紝縱綸紛紙紋紡紵紖紐紓線紺絏紱練組紳細織終縐絆紼絀紹繹經紿綁絨結絝繞絰絎繪給絢絳絡絕絞統綆綃絹繡綌綏絛繼綈績緒綾緓續綺緋綽緔緄繩維綿綬繃綢綯綹綣綜綻綰綠綴緇緙緗緘緬纜緹緲緝縕繢緦綞緞緶線緱縋緩締縷編緡緣縉縛縟縝縫縗縞纏縭縊縑繽縹縵縲纓縮繆繅纈繚繕繒韁繾繰繯繳纘罌網羅罰罷羆羈羥羨翹翽翬耮耬聳恥聶聾職聹聯聵聰肅腸膚膁腎腫脹脅膽勝朧腖臚脛膠脈膾髒臍腦膿臠腳脫腡臉臘醃膕齶膩靦膃騰臏臢輿艤艦艙艫艱豔艸藝節羋薌蕪蘆蓯葦藶莧萇蒼苧蘇檾蘋莖蘢蔦塋煢繭荊薦薘莢蕘蓽蕎薈薺蕩榮葷滎犖熒蕁藎蓀蔭蕒葒葤藥蒞蓧萊蓮蒔萵薟獲蕕瑩鶯蓴蘀蘿螢營縈蕭薩蔥蕆蕢蔣蔞藍薊蘺蕷鎣驀薔蘞藺藹蘄蘊藪槁蘚虜慮虛蟲虯蟣雖蝦蠆蝕蟻螞蠶蠔蜆蠱蠣蟶蠻蟄蛺蟯螄蠐蛻蝸蠟蠅蟈蟬蠍螻蠑螿蟎蠨釁銜補襯袞襖嫋褘襪襲襏裝襠褌褳襝褲襇褸襤繈襴見觀覎規覓視覘覽覺覬覡覿覥覦覯覲覷觴觸觶讋譽謄訁計訂訃認譏訐訌討讓訕訖訓議訊記訒講諱謳詎訝訥許訛論訩訟諷設訪訣證詁訶評詛識詗詐訴診詆謅詞詘詔詖譯詒誆誄試詿詩詰詼誠誅詵話誕詬詮詭詢詣諍該詳詫諢詡譸誡誣語誚誤誥誘誨誑說誦誒請諸諏諾讀諑誹課諉諛誰諗調諂諒諄誶談誼謀諶諜謊諫諧謔謁謂諤諭諼讒諮諳諺諦謎諞諝謨讜謖謝謠謗諡謙謐謹謾謫譾謬譚譖譙讕譜譎讞譴譫讖穀豶貝貞負貟貢財責賢敗賬貨質販貪貧貶購貯貫貳賤賁貰貼貴貺貸貿費賀貽賊贄賈賄貲賃賂贓資賅贐賕賑賚賒賦賭齎贖賞賜贔賙賡賠賧賴賵贅賻賺賽賾贗讚贇贈贍贏贛赬趙趕趨趲躉躍蹌蹠躒踐躂蹺蹕躚躋踴躊蹤躓躑躡蹣躕躥躪躦軀車軋軌軒軑軔轉軛輪軟轟軲軻轤軸軹軼軤軫轢軺輕軾載輊轎輈輇輅較輒輔輛輦輩輝輥輞輬輟輜輳輻輯轀輸轡轅轄輾轆轍轔辭辯辮邊遼達遷過邁運還這進遠違連遲邇逕跡適選遜遞邐邏遺遙鄧鄺鄔郵鄒鄴鄰鬱郤郟鄶鄭鄆酈鄖鄲醞醱醬釅釃釀釋裏钜鑒鑾鏨釓釔針釘釗釙釕釷釺釧釤鈒釩釣鍆釹鍚釵鈃鈣鈈鈦鈍鈔鍾鈉鋇鋼鈑鈐鑰欽鈞鎢鉤鈧鈁鈥鈄鈕鈀鈺錢鉦鉗鈷缽鈳鉕鈽鈸鉞鑽鉬鉭鉀鈿鈾鐵鉑鈴鑠鉛鉚鈰鉉鉈鉍鈹鐸鉶銬銠鉺銪鋏鋣鐃銍鐺銅鋁銱銦鎧鍘銖銑鋌銩銛鏵銓鉿銚鉻銘錚銫鉸銥鏟銃鐋銨銀銣鑄鐒鋪鋙錸鋱鏈鏗銷鎖鋰鋥鋤鍋鋯鋨鏽銼鋝鋒鋅鋶鐦鐧銳銻鋃鋟鋦錒錆鍺錯錨錡錁錕錩錫錮鑼錘錐錦鍁錈錇錟錠鍵鋸錳錙鍥鍈鍇鏘鍶鍔鍤鍬鍾鍛鎪鍠鍰鎄鍍鎂鏤鎡鏌鎮鎛鎘鑷鐫鎳鎿鎦鎬鎊鎰鎔鏢鏜鏍鏰鏞鏡鏑鏃鏇鏐鐔钁鐐鏷鑥鐓鑭鐠鑹鏹鐙鑊鐳鐶鐲鐮鐿鑔鑣鑞鑲長門閂閃閆閈閉問闖閏闈閑閎間閔閌悶閘鬧閨聞闥閩閭闓閥閣閡閫鬮閱閬闍閾閹閶鬩閿閽閻閼闡闌闃闠闊闋闔闐闒闕闞闤隊陽陰陣階際陸隴陳陘陝隉隕險隨隱隸雋難雛讎靂霧霽黴靄靚靜靨韃鞽韉韝韋韌韍韓韙韞韜韻頁頂頃頇項順須頊頑顧頓頎頒頌頏預顱領頗頸頡頰頲頜潁熲頦頤頻頮頹頷頴穎顆題顒顎顓顏額顳顢顛顙顥纇顫顬顰顴風颺颭颮颯颶颸颼颻飀飄飆飆飛饗饜飣饑飥餳飩餼飪飫飭飯飲餞飾飽飼飿飴餌饒餉餄餎餃餏餅餑餖餓餘餒餕餜餛餡館餷饋餶餿饞饁饃餺餾饈饉饅饊饌饢馬馭馱馴馳驅馹駁驢駔駛駟駙駒騶駐駝駑駕驛駘驍罵駰驕驊駱駭駢驫驪騁驗騂駸駿騏騎騍騅騌驌驂騙騭騤騷騖驁騮騫騸驃騾驄驏驟驥驦驤髏髖髕鬢魘魎魚魛魢魷魨魯魴魺鮁鮃鯰鱸鮋鮓鮒鮊鮑鱟鮍鮐鮭鮚鮳鮪鮞鮦鰂鮜鱠鱭鮫鮮鮺鯗鱘鯁鱺鰱鰹鯉鰣鰷鯀鯊鯇鮶鯽鯒鯖鯪鯕鯫鯡鯤鯧鯝鯢鯰鯛鯨鯵鯴鯔鱝鰈鰏鱨鯷鰮鰃鰓鱷鰍鰒鰉鰁鱂鯿鰠鼇鰭鰨鰥鰩鰟鰜鰳鰾鱈鱉鰻鰵鱅鰼鱖鱔鱗鱒鱯鱤鱧鱣鳥鳩雞鳶鳴鳲鷗鴉鶬鴇鴆鴣鶇鸕鴨鴞鴦鴒鴟鴝鴛鴬鴕鷥鷙鴯鴰鵂鴴鵃鴿鸞鴻鵐鵓鸝鵑鵠鵝鵒鷳鵜鵡鵲鶓鵪鶤鵯鵬鵮鶉鶊鵷鷫鶘鶡鶚鶻鶿鶥鶩鷊鷂鶲鶹鶺鷁鶼鶴鷖鸚鷓鷚鷯鷦鷲鷸鷺鸇鷹鸌鸏鸛鸘鹺麥麩黃黌黶黷黲黽龍歷誌製壹臺臯準復勐鐘註範籤'
+ }
+
+ function Traditionalized(cc) {
+ let str = ''
+ const ss = JTPYStr()
+ const tt = FTPYStr()
+ for (let i = 0; i < cc.length; i++) {
+ if (cc.charCodeAt(i) > 10000 && ss.indexOf(cc.charAt(i)) !== -1) {
+ str += tt.charAt(ss.indexOf(cc.charAt(i)))
+ } else str += cc.charAt(i)
+ }
+ return str
+ }
+
+ function Simplized(cc) {
+ let str = ''
+ const ss = JTPYStr()
+ const tt = FTPYStr()
+ for (let i = 0; i < cc.length; i++) {
+ if (cc.charCodeAt(i) > 10000 && tt.indexOf(cc.charAt(i)) !== -1) {
+ str += ss.charAt(tt.indexOf(cc.charAt(i)))
+ } else str += cc.charAt(i)
+ }
+ return str
+ }
+
+ function translateInitialization() {
+ translateButtonObject = document.getElementById('menu-translate')
+ if (translateButtonObject) {
+ if (currentEncoding !== targetEncoding) {
+ translateButtonObject.lastChild.textContent = targetEncoding === 1 ? msgToSimplifiedChinese : msgToTraditionalChinese
+ translateButtonObject.firstChild.className = targetEncoding === 1 ? 'solitude st-jianben-line' : 'solitude st-panben-line'
+ setLang()
+ setTimeout(translateBody, translateDelay)
+ }
+ translateButtonObject.addEventListener('click', translatePage, false)
+ }
+ }
+
+ translateInitialization()
+ document.addEventListener('pjax:complete', () => {
+ translateInitialization()
+ })
+})
\ No newline at end of file
diff --git a/public/js/utils.js b/public/js/utils.js
new file mode 100644
index 0000000..7b088b4
--- /dev/null
+++ b/public/js/utils.js
@@ -0,0 +1,208 @@
+(() => {
+ const utilsFn = {
+ throttle: (func, wait, {leading = true, trailing = true} = {}) => {
+ let timeout, previous = 0;
+ const later = (context, args) => {
+ timeout = previous = leading === false ? 0 : Date.now();
+ func.apply(context, args);
+ };
+ return function () {
+ const now = Date.now();
+ if (!previous && leading === false) previous = now;
+ const remaining = wait - (now - previous);
+ if (remaining <= 0 || remaining > wait) {
+ if (timeout) {
+ clearTimeout(timeout);
+ timeout = null;
+ }
+ later(this, arguments);
+ } else if (!timeout && trailing !== false) {
+ timeout = setTimeout(() => later(this, arguments), remaining);
+ }
+ };
+ },
+ fadeIn: (ele, time) => ele.style.cssText = `display:block;animation: to_show ${time}s`,
+ fadeOut: (ele, time) => {
+ const resetStyles = () => {
+ ele.style.cssText = "display: none; animation: '' ";
+ ele.removeEventListener('animationend', resetStyles);
+ };
+ ele.addEventListener('animationend', resetStyles);
+ ele.style.animation = `to_hide ${time}s`;
+ },
+ sidebarPaddingR: () => {
+ const paddingRight = window.innerWidth - document.body.clientWidth;
+ if (paddingRight > 0) {
+ document.body.style.paddingRight = `${paddingRight}px`;
+ }
+ },
+ snackbarShow: (text, showAction = false, duration = 5000) => {
+ document.styleSheets[0].addRule(':root', `--efu-snackbar-time:${duration}ms!important`);
+ Snackbar.show({
+ text,
+ showAction,
+ duration,
+ pos: 'top-center'
+ });
+ },
+ copy: async (text) => {
+ const message = await navigator.clipboard.writeText(text)
+ .then(() => GLOBAL_CONFIG.lang.copy.success)
+ .catch(() => GLOBAL_CONFIG.lang.copy.error);
+ utils.snackbarShow(message, false, 2000);
+ },
+ getEleTop: ele => {
+ let actualTop = ele.offsetTop;
+ while (ele.offsetParent) {
+ ele = ele.offsetParent;
+ actualTop += ele.offsetTop;
+ }
+ return actualTop;
+ },
+ siblings: (ele, selector) => {
+ return [...ele.parentNode.children].filter((child) => {
+ if (selector) {
+ return child !== ele && child.matches(selector)
+ }
+ return child !== ele
+ })
+ },
+ randomNum: (length) => {
+ return Math.floor(Math.random() * length)
+ },
+ timeDiff: (timeObj, today) => {
+ const timeDiff = today.getTime() - timeObj.getTime();
+ return Math.floor(timeDiff / (1000 * 3600 * 24));
+ },
+ scrollToDest: (pos, time = 500) => {
+ const currentPos = window.pageYOffset;
+ const isNavFixed = document.getElementById('page-header').classList.contains('nav-fixed');
+ pos = currentPos > pos || isNavFixed ? pos - 70 : pos;
+
+ if ('scrollBehavior' in document.documentElement.style) {
+ window.scrollTo({top: pos, behavior: 'smooth'});
+ return;
+ }
+
+ const distance = pos - currentPos;
+ const step = currentTime => {
+ const start = start || currentTime;
+ const progress = currentTime - start;
+
+ if (progress < time) {
+ window.scrollTo(0, currentPos + distance * progress / time);
+ window.requestAnimationFrame(step);
+ } else {
+ window.scrollTo(0, pos);
+ }
+ };
+
+ window.requestAnimationFrame(step);
+ },
+ isMobile: () => /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent),
+ isHidden: e => 0 === e.offsetHeight && 0 === e.offsetWidth,
+ addEventListenerPjax: (ele, event, fn, option = false) => {
+ ele.addEventListener(event, fn, option)
+ utils.addGlobalFn('pjax', () => {
+ ele.removeEventListener(event, fn, option)
+ })
+ },
+ animateIn: (ele, text) => {
+ Object.assign(ele.style, {display: 'block', animation: text});
+ },
+ animateOut: (ele, text) => {
+ const resetAnimation = () => {
+ ele.style.display = '';
+ ele.style.animation = '';
+ ele.removeEventListener('animationend', resetAnimation);
+ };
+ ele.addEventListener('animationend', resetAnimation);
+ ele.style.animation = text;
+ },
+ wrap: (selector, eleType, options) => {
+ const createEle = document.createElement(eleType)
+ for (const [key, value] of Object.entries(options)) {
+ createEle.setAttribute(key, value)
+ }
+ selector.parentNode.insertBefore(createEle, selector)
+ createEle.appendChild(selector)
+ },
+ lazyloadImg: () => {
+ window.lazyLoadInstance = new LazyLoad({
+ elements_selector: 'img',
+ threshold: 0,
+ data_src: 'lazy-src',
+ callback_error: img => img.src = GLOBAL_CONFIG.lazyload.error
+ });
+ },
+ lightbox: function (selector) {
+ const lightboxType = GLOBAL_CONFIG.lightbox;
+ const options = {
+ class: 'fancybox',
+ 'data-fancybox': 'gallery',
+ };
+
+ if (lightboxType === 'mediumZoom') {
+ mediumZoom && mediumZoom(selector, {background: "var(--efu-card-bg)"});
+ } else if (lightboxType === 'fancybox') {
+ selector.forEach(i => {
+ if (i.parentNode.tagName !== 'A') {
+ options.href = options['data-thumb'] = i.dataset.lazySrc || i.src;
+ options['data-caption'] = i.title || i.alt || '';
+ utils.wrap(i, 'a', options);
+ }
+ });
+
+ if (!window.fancyboxRun) {
+ Fancybox.bind('[data-fancybox]', {
+ Hash: false,
+ animated: true,
+ Thumbs: {showOnStart: false},
+ Images: {Panzoom: {maxScale: 4}},
+ Carousel: {transition: 'slide'},
+ Toolbar: {
+ display: {
+ left: ['infobar'],
+ middle: ['zoomIn', 'zoomOut', 'toggle1to1', 'rotateCCW', 'rotateCW', 'flipX', 'flipY'],
+ right: ['slideshow', 'thumbs', 'close']
+ }
+ },
+ });
+ window.fancyboxRun = true;
+ }
+ }
+ },
+ diffDate: (d, more = false) => {
+ const dateNow = new Date();
+ const datePost = new Date(d);
+ const dateDiff = dateNow - datePost;
+ const minute = 60000;
+ const hour = 3600000;
+ const day = 86400000;
+ const month = 2592000000;
+ const {time} = GLOBAL_CONFIG.lang;
+ const dayCount = Math.floor(dateDiff / day)
+ if (!more) return dayCount
+ const minuteCount = Math.floor(dateDiff / minute)
+ const hourCount = Math.floor(dateDiff / hour)
+ const monthCount = Math.floor(dateDiff / month)
+ if (monthCount > 12) return datePost.toISOString().slice(0, 10)
+ if (monthCount >= 1) return `${monthCount} ${time.month}`
+ if (dayCount >= 1) return `${dayCount} ${time.day}`
+ if (hourCount >= 1) return `${hourCount} ${time.hour}`
+ if (minuteCount >= 1) return `${minuteCount} ${time.min}`
+ return time.just
+ },
+ loadComment: (dom, callback) => {
+ const observerItem = 'IntersectionObserver' in window ? new IntersectionObserver((entries) => {
+ if (entries[0].isIntersecting) {
+ callback();
+ observerItem.disconnect();
+ }
+ }, {threshold: [0]}) : null;
+
+ observerItem ? observerItem.observe(dom) : callback();
+ },
+ }
+ window.utils = {...window.utils, ...utilsFn};
+})()
\ No newline at end of file
diff --git a/public/tags/index.html b/public/tags/index.html
new file mode 100644
index 0000000..322fd51
--- /dev/null
+++ b/public/tags/index.html
@@ -0,0 +1,172 @@
+全部标签 | 基沃托斯铁道公团 KivotosRailway 开启JavaScript才能访问本站哦~
\ No newline at end of file