diff --git a/_config.fluid.yml b/_config.fluid.yml index ddbf237..2ab1fc1 100644 --- a/_config.fluid.yml +++ b/_config.fluid.yml @@ -62,7 +62,7 @@ code: highlightjs: # 在链接中挑选 style 填入 # Select a style in the link - # See: https://highlightjs.org/static/demo/ + # See: https://highlightjs.org/demo/ style: "github gist" style_dark: "dark" @@ -83,7 +83,7 @@ fun_features: # 为 subtitle 添加打字机效果 # Typing animation for subtitle typing: - enable: true + enable: false # 打印速度,数字越大越慢 # Typing speed, the larger the number, the slower @@ -91,7 +91,7 @@ fun_features: # 游标字符 # Cursor character - cursorChar: "光锥之内,就是命运" + cursorChar: "_" # 是否循环播放效果 # If true, loop animation @@ -109,8 +109,10 @@ fun_features: element: h1,h2,h3,h4,h5,h6 # Options: left | right placement: left - # Options: hover | always | touch + + # Options: hover | always visible: hover + # Options: § | # | ❡ icon: "" @@ -128,7 +130,7 @@ fun_features: dark_mode: enable: true # 默认的选项(当用户手动切换后则不再按照默认模式),选择 `auto` 会优先遵循 prefers-color-scheme,其次按用户本地时间 18 点到次日 6 点之间进入暗色模式 - # Default option (when the visitor switches manually, the default mode is no longer followed), choosing `auto` will give priority to prefers-color-scheme, and then enter the dark mode from 18:00 to 6:00 in the visitor’s local time + # Default option (when the visitor switches manually, the default mode is no longer followed), choosing `auto` will give priority to prefers-color-scheme, and then enter the dark mode from 18:00 to 6:00 in the visitor's local time # Options: auto | light | dark default: auto @@ -154,7 +156,7 @@ color: navbar_text_color_dark: "#d0d0d0" # 副标题字体色 - # Color of navigation bar text + # Color of subtitle text subtitle_color: "#fff" subtitle_color_dark: "#d0d0d0" @@ -265,16 +267,6 @@ web_analytics: # 网页访问统计 sid: cid: - # 51.la 站点统计 ID - # 51.la analytics - # See: https://www.51.la/user/site/index - woyaola: - - # 友盟/cnzz 站点统计 web_id - # cnzz analytics - # See: https://web.umeng.com/main.php?c=site&a=show - cnzz: - # LeanCloud 计数统计,可用于 PV UV 展示,如果 `web_analytics: enable` 没有开启,PV UV 展示只会查询不会增加 # LeanCloud count statistics, which can be used for PV UV display. If `web_analytics: enable` is false, PV UV display will only query and not increase leancloud: @@ -290,6 +282,40 @@ web_analytics: # 网页访问统计 # If true, ignore localhost & 127.0.0.1 ignore_local: false + # Umami Analytics,仅支持自部署。如果要展示 PV UV 需要填写所有配置项,否则只填写 `src` 和 `website_id` 即可 + # Umami Analytics, only Self-host support. If you want to display PV UV need to set all config items, otherwise only set 'src' and 'website_id' + # See: https://umami.is/docs + umami: + # umami js 文件地址,需要在 umami 后台创建站点后获取 + # umami js file url, get after create website in umami + src: "https://umami.mmeiblog.cn/script.js" + + # umami 的 website id,需要在 umami 后台创建站点后获取 + # umami website id, get after create website in umami + website_id: "f41c8851-4c0f-49e4-9dc4-0d1f227dbba5" + + # 如果你只想统计特定的域名可以填入此字段,多个域名通过逗号分隔,这可以避免统计 localhost。 + # If you only want to tracker to specific domains you can fill in this field, multiple domain names are separated by commas, which can avoid tracker localhost + domains: + + # 用于统计 PV UV 的开始时间,格式为 "YYYY-MM-DD" + # statistics on the start time, the format is "YYYY-MM-DD" + start_time: 2023-07-12 + + # 新建一个 umami viewOnly 用户,然后通过 login api 获取该用户 token + # create an umami viewOnly user, and then get user token through the login api + token: + + # 填写 umami 部署的服务器地址,如 "https://umami.example.com" + # server url of umami deployment, such as "https://umami.example.com" + api_server: "https://umami.mmeiblog.cn" + +# Canonical 用于向 Google 搜索指定规范网址,开启前确保 hexo _config.yml 中配置 `url: http://yourdomain.com` +# Canonical, to specify a canonical URL for Google Search, need to set up `url: http://yourdomain.com` in hexo _config.yml +# See: https://support.google.com/webmasters/answer/139066 +canonical: + enable: false + # 对页面中的图片和评论插件进行懒加载处理,可见范围外的元素不会提前加载 # Lazy loading of images and comment plugin on the page lazyload: @@ -447,9 +473,9 @@ footer: statistics: enable: false - # 统计数据来源,使用 leancloud 需要设置 `web_analytics: leancloud` 中的参数;使用 busuanzi 不需要额外设置,但是有时不稳定,另外本地运行时 busuanzi 显示统计数据很大属于正常现象,部署后会正常 - # Data source. If use leancloud, you need to set the parameter in `web_analytics: leancloud` - # Options: busuanzi | leancloud + # 统计数据来源,使用 leancloud, umami 需要设置 `web_analytics` 中对应的参数;使用 busuanzi 不需要额外设置,但是有时不稳定,另外本地运行时 busuanzi 显示统计数据很大属于正常现象,部署后会正常 + # Data source. If use leancloud, umami, you need to set the parameter in `web_analytics` + # Options: busuanzi | leancloud | umami source: "busuanzi" # 国内大陆服务器的备案信息 @@ -457,13 +483,13 @@ footer: beian: enable: false # ICP证号 - icp_text: + icp_text: 京ICP证123456号 # 公安备案号,不填则只显示ICP - police_text: + police_text: 京公网安备12345678号 # 公安备案的编号,用于URL跳转查询 - police_code: + police_code: 12345678 # 公安备案的图片. 为空时不显示备案图片 - police_icon: + police_icon: /img/police_beian.png #--------------------------- @@ -480,7 +506,7 @@ index: # Available: 0 - 100 banner_img_height: 100 - # 头图黑色蒙版的不透明度,available: 0 - 1.0, 1 是完全不透明 + # 头图黑色蒙版的不透明度,available: 0 - 1.0,1 是完全不透明 # Opacity of the banner mask, 1.0 is completely opaque # Available: 0 - 1.0 banner_mask_alpha: 0.3 @@ -551,7 +577,7 @@ post: # 文章在首页的默认封面图,当没有指定 index_img 时会使用该图片,若两者都为空则不显示任何图片 # Path of the default post cover when `index_img` is not set. If both are empty, no image will be displayed - default_index_img: + default_index_img: # 文章标题下方的元信息 # Meta information below title @@ -592,7 +618,7 @@ post: enable: false # 统计数据来源 # Data Source - # Options: busuanzi | leancloud + # Options: busuanzi | leancloud | umami source: "busuanzi" # 在文章开头显示文章更新时间,该时间默认是 md 文件更新时间,可通过 front-matter 中 `updated` 手动指定(和 date 一样格式) @@ -1114,7 +1140,7 @@ static_prefix: internal_css: /css internal_img: /img - anchor: https://lib.baomitu.com/anchor-js/4.3.1/ + anchor: https://lib.baomitu.com/anchor-js/5.0.0/ github_markdown: https://lib.baomitu.com/github-markdown-css/4.0.0/ @@ -1144,7 +1170,7 @@ static_prefix: valine: https://lib.baomitu.com/valine/1.5.1/ - waline: https://cdn.staticfile.org/waline/2.15.5/ + waline: https://registry.npmmirror.com/@waline/client/2.15.8/files/dist/ gitalk: https://lib.baomitu.com/gitalk/1.8.0/ @@ -1154,4 +1180,6 @@ static_prefix: discuss: https://lib.baomitu.com/discuss/1.2.1/ - hint: https://lib.baomitu.com/hint.css/2.7.0/ \ No newline at end of file + hint: https://lib.baomitu.com/hint.css/2.7.0/ + + moment: https://lib.baomitu.com/moment.js/2.29.4/ \ No newline at end of file diff --git a/scripts/miao.js b/scripts/miao.js index 89d230e..79a84d8 100644 --- a/scripts/miao.js +++ b/scripts/miao.js @@ -1,4 +1,5 @@ -hexo.extend.injector.register('head_begin', '', 'default'); +hexo.extend.injector.register('body_end', '', 'default'); +// hexo.extend.injector.register('body_end', '', 'default'); // 预先连接的域名 -hexo.extend.injector.register('head_begin', '', 'default'); +hexo.extend.injector.register('head_begin', '', 'default'); hexo.extend.injector.register('head_begin', '', 'about'); \ No newline at end of file diff --git a/source/js/china-lantern.js b/source/js/china-lantern.js new file mode 100644 index 0000000..725cad8 --- /dev/null +++ b/source/js/china-lantern.js @@ -0,0 +1,37 @@ +(function (factory) { + typeof define === 'function' && define.amd ? define(factory) : + factory(); +}((function () { 'use strict'; + function styleInject(css, ref) { + if ( ref === void 0 ) ref = {}; + var insertAt = ref.insertAt; + if (!css || typeof document === 'undefined') { return; } + var head = document.head || document.getElementsByTagName('head')[0]; + var style = document.createElement('style'); + style.type = 'text/css'; + if (insertAt === 'top') { + if (head.firstChild) { + head.insertBefore(style, head.firstChild); + } else { + head.appendChild(style); + } + } else { + head.appendChild(style); + } + if (style.styleSheet) { + style.styleSheet.cssText = css; + } else { + style.appendChild(document.createTextNode(css)); + } + } + var css_248z = "@charset \"UTF-8\";.lantern__warpper{position:fixed;top:12px;left:40px;pointer-events:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;z-index:999}.lantern__warpper.lantern__secondary{left:calc(100% - 130px)}.lantern__warpper.lantern__secondary .lantern__box{-webkit-animation-duration:3s;animation-duration:3s}.lantern__box{position:relative;display:inline-block;width:90px;height:70px;background:rgba(216,0,15,.8);border-radius:50% 50%;animation:lantern-swing 3s ease-in-out infinite alternate-reverse;-webkit-transform-origin:50% -70px;-ms-transform-origin:50% -70px;transform-origin:50% -70px;-webkit-box-shadow:-5px 5px 50px 4px #fa6c00;box-shadow:-5px 5px 50px 4px #fa6c00}.lantern__box:after,.lantern__box:before{content:\"\";position:absolute;height:8px;width:45px;left:50%;border:1px solid #dc8f03;background:-webkit-gradient(linear,left top,right top,from(#dc8f03),color-stop(orange),color-stop(#dc8f03),color-stop(orange),to(#dc8f03));background:-o-linear-gradient(left,#dc8f03,orange,#dc8f03,orange,#dc8f03);background:linear-gradient(90deg,#dc8f03,orange,#dc8f03,orange,#dc8f03)}.lantern__box:before{top:0;border-radius:5px 5px 0 0;-webkit-transform:translate(-50%,-50%);-ms-transform:translate(-50%,-50%);transform:translate(-50%,-50%)}.lantern__box:after{bottom:0;border-radius:0 0 5px 5px;-webkit-transform:translate(-50%,50%);-ms-transform:translate(-50%,50%);transform:translate(-50%,50%)}.lantern__line{position:absolute;width:2px;height:12px;top:0;left:50%;-webkit-transform:translate(-50%,-100%);-ms-transform:translate(-50%,-100%);transform:translate(-50%,-100%);background:#dc8f03}.lantern__circle{width:80%;-webkit-box-sizing:border-box;box-sizing:border-box}.lantern__circle,.lantern__circle .lantern__ellipse{height:100%;margin:0 auto;border-radius:50%;border:2px solid #dc8f03}.lantern__circle .lantern__ellipse{width:50%}.lantern__circle .lantern__text{font-family: 华文行楷 ,Microsoft YaHei,sans-serif;font-size:24.3px;color:#dc8f03;font-weight:700;line-height:66px;text-align:center}.lantern__tail{position:relative;width:4px;height:12px;margin:0 auto;animation:lantern-swing 4s ease-in-out infinite alternate-reverse;background:orange;border-radius:0 0 5px 5px}.lantern__tail .lantern__junction{position:absolute;top:0;left:50%;width:8px;height:8px;-webkit-transform:translate(-50%,8.4px);-ms-transform:translate(-50%,8.4px);transform:translate(-50%,8.4px);background:#e69603;border-radius:50%}.lantern__tail .lantern__rect{position:absolute;top:0;left:50%;-webkit-transform:translate(-50%,10.8px);-ms-transform:translate(-50%,10.8px);transform:translate(-50%,10.8px);width:8px;height:24px;background:orange;border-radius:5px 5px 0 5px}@-webkit-keyframes lantern-swing{0%{-webkit-transform:rotate(-8deg);transform:rotate(-8deg)}to{-webkit-transform:rotate(8deg);transform:rotate(8deg)}}@keyframes lantern-swing{0%{-webkit-transform:rotate(-8deg);transform:rotate(-8deg)}to{-webkit-transform:rotate(8deg);transform:rotate(8deg)}}@media (max-width:460px){.lantern__warpper{top:8px;left:30px}.lantern__warpper.lantern__secondary{left:calc(100% - 80px)}.lantern__box{width:50px;height:40px;-webkit-transform-origin:50% -40px;-ms-transform-origin:50% -40px;transform-origin:50% -40px;-webkit-box-shadow:-5px 5px 50px -1px #fa6c00;box-shadow:-5px 5px 50px -1px #fa6c00}.lantern__box:after,.lantern__box:before{height:4px;width:25px}.lantern__line{width:2px;height:8px}.lantern__circle .lantern__text{font-size:13.5px;line-height:38px}.lantern__tail{width:4px;height:8px}.lantern__tail .lantern__junction{width:8px;height:8px;-webkit-transform:translate(-50%,5.6px);-ms-transform:translate(-50%,5.6px);transform:translate(-50%,5.6px)}.lantern__tail .lantern__rect{-webkit-transform:translate(-50%,7.2px);-ms-transform:translate(-50%,7.2px);transform:translate(-50%,7.2px);width:8px;height:16px}}"; + styleInject(css_248z); + var content = '
'; + function createElement() { + var div = document.createElement('div'); + div.className = 'j-china-lantern'; + div.innerHTML = content; + document.body.appendChild(div); + } + createElement(); +}))); \ No newline at end of file diff --git a/source/js/snowflake.js b/source/js/snowflake.js new file mode 100644 index 0000000..1f26c73 --- /dev/null +++ b/source/js/snowflake.js @@ -0,0 +1,127 @@ +/* 控制下雪 */ +function snowFall(snow) { + /* 可配置属性 */ + snow = snow || {}; + this.maxFlake = snow.maxFlake || 150; /* 最多片数 */ + this.flakeSize = snow.flakeSize || 10; /* 雪花形状 */ + this.fallSpeed = snow.fallSpeed || 1; /* 坠落速度 */ +} +/* 兼容写法 */ +requestAnimationFrame = window.requestAnimationFrame || + window.mozRequestAnimationFrame || + window.webkitRequestAnimationFrame || + window.msRequestAnimationFrame || + window.oRequestAnimationFrame || + function(callback) { setTimeout(callback, 1000 / 60); }; + +cancelAnimationFrame = window.cancelAnimationFrame || + window.mozCancelAnimationFrame || + window.webkitCancelAnimationFrame || + window.msCancelAnimationFrame || + window.oCancelAnimationFrame; +/* 开始下雪 */ +snowFall.prototype.start = function(){ + /* 创建画布 */ + snowCanvas.apply(this); + /* 创建雪花形状 */ + createFlakes.apply(this); + /* 画雪 */ + drawSnow.apply(this) +} +/* 创建画布 */ +function snowCanvas() { + /* 添加Dom结点 */ + var snowcanvas = document.createElement("canvas"); + snowcanvas.id = "snowfall"; + snowcanvas.width = document.body.offsetWidth; + snowcanvas.height = window.innerHeight; + snowcanvas.setAttribute("style", "position:fixed; top: 0; left: 0; z-index: 9999; pointer-events: none;"); + document.getElementsByTagName("body")[0].appendChild(snowcanvas); + this.canvas = snowcanvas; + this.ctx = snowcanvas.getContext("2d"); + /* 窗口大小改变的处理 */ + window.onresize = function() { + // snowcanvas.width = document.body.offsetWidth; + /* snowcanvas.height = window.innerHeight */ + } +} +/* 雪运动对象 */ +function flakeMove(canvasWidth, canvasHeight, flakeSize, fallSpeed) { + this.x = Math.floor(Math.random() * canvasWidth); /* x坐标 */ + this.y = Math.floor(Math.random() * canvasHeight); /* y坐标 */ + this.size = Math.random() * flakeSize + 2; /* 形状 */ + this.maxSize = flakeSize; /* 最大形状 */ + this.speed = Math.random() * 1 + fallSpeed; /* 坠落速度 */ + this.fallSpeed = fallSpeed; /* 坠落速度 */ + this.velY = this.speed; /* Y方向速度 */ + this.velX = 0; /* X方向速度 */ + this.stepSize = Math.random() / 30; /* 步长 */ + this.step = 0 /* 步数 */ +} +flakeMove.prototype.update = function() { + var x = this.x, + y = this.y; + /* 左右摆动(余弦) */ + this.velX *= 0.98; + if (this.velY <= this.speed) { + this.velY = this.speed + } + this.velX += Math.cos(this.step += .05) * this.stepSize; + + this.y += this.velY; + this.x += this.velX; + /* 飞出边界的处理 */ + if (this.x >= canvas.width || this.x <= 0 || this.y >= canvas.height || this.y <= 0) { + this.reset(canvas.width, canvas.height) + } +}; +/* 飞出边界-放置最顶端继续坠落 */ +flakeMove.prototype.reset = function(width, height) { + this.x = Math.floor(Math.random() * width); + this.y = 0; + this.size = Math.random() * this.maxSize + 2; + this.speed = Math.random() * 1 + this.fallSpeed; + this.velY = this.speed; + this.velX = 0; +}; +// 渲染雪花-随机形状(此处可修改雪花颜色!!!) +flakeMove.prototype.render = function(ctx) { + var snowFlake = ctx.createRadialGradient(this.x, this.y, 0, this.x, this.y, this.size); + snowFlake.addColorStop(0, "rgba(255, 255, 255, 0.9)"); /* 此处是雪花颜色,默认是白色 */ + snowFlake.addColorStop(.5, "rgba(255, 255, 255, 0.5)"); /* 若要改为其他颜色,请自行查 */ + snowFlake.addColorStop(1, "rgba(255, 255, 255, 0)"); /* 找16进制的RGB 颜色代码。 */ + ctx.save(); + ctx.fillStyle = snowFlake; + ctx.beginPath(); + ctx.arc(this.x, this.y, this.size, 0, Math.PI * 2); + ctx.fill(); + ctx.restore(); +}; +/* 创建雪花-定义形状 */ +function createFlakes() { + var maxFlake = this.maxFlake, + flakes = this.flakes = [], + canvas = this.canvas; + for (var i = 0; i < maxFlake; i++) { + flakes.push(new flakeMove(canvas.width, canvas.height, this.flakeSize, this.fallSpeed)) + } +} +/* 画雪 */ +function drawSnow() { + var maxFlake = this.maxFlake, + flakes = this.flakes; + ctx = this.ctx, canvas = this.canvas, that = this; + /* 清空雪花 */ + ctx.clearRect(0, 0, canvas.width, canvas.height); + for (var e = 0; e < maxFlake; e++) { + flakes[e].update(); + flakes[e].render(ctx); + } + /* 一帧一帧的画 */ + this.loop = requestAnimationFrame(function() { + drawSnow.apply(that); + }); +} +/* 调用及控制方法 */ +var snow = new snowFall({maxFlake:200}); +snow.start(); \ No newline at end of file