{"id":223,"date":"2024-02-29T16:04:41","date_gmt":"2024-02-29T08:04:41","guid":{"rendered":"https:\/\/levin.ink\/?p=223"},"modified":"2024-02-29T16:04:41","modified_gmt":"2024-02-29T08:04:41","slug":"wordpress-%e4%bf%ae%e6%94%b9%e8%bf%87%e7%a8%8b","status":"publish","type":"post","link":"https:\/\/levin.ink\/?p=223","title":{"rendered":"WordPress \u4fee\u6539\u8fc7\u7a0b"},"content":{"rendered":"<h1>\u8fd0\u884c\u65f6\u95f4\u3001\u8017\u65f6\u53ca\u5360\u7528\u5185\u5b58<\/h1>\n<p>\u5728footer.php\u4e2d<\/footer>\n<p>\u524d\u6dfb\u52a0\u4ee5\u4e0b\u4ee3\u7801\uff1a<\/p>\n<pre><code class=\"language-php\">&lt;!--\u8017\u65f6\u53ca\u5360\u7528\u5185\u5b58\u5f00\u59cb--&gt;\n&lt;span id=&quot;momk&quot;&gt;&lt;\/span&gt;&lt;span id=&quot;momk&quot; style=&quot;color: #ff0000;&quot;&gt;&lt;\/span&gt;\n&lt;script type=&quot;text\/javascript&quot;&gt;\nfunction NewDate(str) {\nstr = str.split(&#039;-&#039;);\nvar date = new Date();\ndate.setUTCFullYear(str[0], str[1] - 1, str[2]);\ndate.setUTCHours(0, 0, 0, 0);\nreturn date;\n}\nfunction momxc() {\n&lt;!--\u8fd9\u91cc\u8981\u6539\u6210\u81ea\u5df1\u535a\u5ba2\u7684\u8bde\u751f\u65f6\u95f4--&gt;\nvar birthDay =NewDate(&quot;2022-04-28&quot;);\nvar today=new Date();\nvar timeold=today.getTime()-birthDay.getTime();\nvar sectimeold=timeold\/1000\nvar secondsold=Math.floor(sectimeold);\nvar msPerDay=24*60*60*1000; var e_daysold=timeold\/msPerDay;\nvar daysold=Math.floor(e_daysold);\nvar e_hrsold=(daysold-e_daysold)*-24;\nvar hrsold=Math.floor(e_hrsold);\nvar e_minsold=(hrsold-e_hrsold)*-60;\nvar minsold=Math.floor((hrsold-e_hrsold)*-60); var seconds=Math.floor((minsold-e_minsold)*-60).toString();\ndocument.getElementById(&quot;momk&quot;).innerHTML = &quot;\u672c\u7ad9\u5df2\u5b89\u5168\u8fd0\u884c\uff1a&quot;+daysold+&quot;\u5929&quot;+hrsold+&quot;\u5c0f\u65f6&quot;+minsold+&quot;\u5206&quot;+seconds+&quot;\u79d2&lt;br&gt;&quot;;\nsetTimeout(momxc, 1000);\n}momxc();\n&lt;\/script&gt;\n&lt;style&gt;\n#momk{animation:change 10s infinite;font-weight:800; }\n@keyframes change{0%{color:#5cb85c;}25%{color:#556bd8;}50%{color:#e40707;}75%{color:#66e616;}100% {color:#67bd31;}}\n&lt;\/style&gt;\n&lt;?php printf(&#039; | \u8017\u65f6 %.3f \u79d2 | \u67e5\u8be2 %d \u6b21 | \u5185\u5b58 %.2f MB |&#039;,timer_stop( 0, 3 ),get_num_queries(),memory_get_peak_usage() \/ 1024 \/ 1024);?&gt;&lt;br&gt;\n&lt;!--\u8017\u65f6\u53ca\u5360\u7528\u5185\u5b58\u7ed3\u675f--&gt;<\/code><\/pre>\n<p>\u5c06\u8fd9\u91cc<code>var birthDay =NewDate(&quot;2024-01-31&quot;);<\/code>\u7684\u65f6\u95f4\u4fee\u6539\u5373\u53ef\u3002<\/p>\n<h1>\u6587\u5b57\u98a4\u6296<\/h1>\n<p>\u5728footer.php\u4e2d\u6dfb\u52a0css\u811a\u672c\uff1a<\/p>\n<pre><code class=\"language-php\">&lt;!--\u6587\u5b57\u6296\u52a8\u7279\u6548--&gt;\n&lt;link href=&quot;https:\/\/cdn.jsdelivr.net\/gh\/huangwb8\/bloghelper@latest\/css\/myface.css&quot; rel=&quot;stylesheet&quot;&gt;<\/code><\/pre>\n<p>\u7136\u540e\uff0c\u5728\u9875\u811a\u5185\u5bb9\u4e2d\u6dfb\u52a0\u4ee5\u4e0b\u547d\u4ee4\uff1a<\/p>\n<pre><code class=\"language-php\">&lt;div class=&quot;&quot;&gt;&lt;span class=&quot;my-face&quot;&gt;\u00a92024 Levin ( \u2022\u0300 \u03c9 \u2022\u0301 )y&lt;\/span&gt;&lt;br&gt;<\/code><\/pre>\n<h1>\u9f20\u6807\u70b9\u51fb\u7279\u6548<\/h1>\n<p>\u6dfb\u52a0\u5982\u4e0bjs\u811a\u672c\uff1a<\/p>\n<pre><code class=\"language-php\">&lt;!--\u70b9\u51fb\u70df\u82b1--&gt;\n&lt;script&gt;\nfunction clickEffect() {\n  let balls = [];\n  let longPressed = false;\n  let longPress;\n  let multiplier = 0;\n  let width, height;\n  let origin;\n  let normal;\n  let ctx;\n  const colours = [&quot;#F73859&quot;, &quot;#14FFEC&quot;, &quot;#00E0FF&quot;, &quot;#FF99FE&quot;, &quot;#FAF15D&quot;];\n  const canvas = document.createElement(&quot;canvas&quot;);\n  document.body.appendChild(canvas);\n  canvas.setAttribute(&quot;style&quot;, &quot;width: 100%; height: 100%; top: 0; left: 0; z-index: 99999; position: fixed; pointer-events: none;&quot;);\n  const pointer = document.createElement(&quot;span&quot;);\n  pointer.classList.add(&quot;pointer&quot;);\n  document.body.appendChild(pointer);\n\n  if (canvas.getContext &amp;&amp; window.addEventListener) {\n    ctx = canvas.getContext(&quot;2d&quot;);\n    updateSize();\n    window.addEventListener(&#039;resize&#039;, updateSize, false);\n    loop();\n    window.addEventListener(&quot;mousedown&quot;, function(e) {\n      pushBalls(randBetween(10, 20), e.clientX, e.clientY);\n      document.body.classList.add(&quot;is-pressed&quot;);\n      longPress = setTimeout(function(){\n        document.body.classList.add(&quot;is-longpress&quot;);\n        longPressed = true;\n      }, 500);\n    }, false);\n    window.addEventListener(&quot;mouseup&quot;, function(e) {\n      clearInterval(longPress);\n      if (longPressed == true) {\n        document.body.classList.remove(&quot;is-longpress&quot;);\n        pushBalls(randBetween(50 + Math.ceil(multiplier), 100 + Math.ceil(multiplier)), e.clientX, e.clientY);\n        longPressed = false;\n      }\n      document.body.classList.remove(&quot;is-pressed&quot;);\n    }, false);\n    window.addEventListener(&quot;mousemove&quot;, function(e) {\n      let x = e.clientX;\n      let y = e.clientY;\n      pointer.style.top = y + &quot;px&quot;;\n      pointer.style.left = x + &quot;px&quot;;\n    }, false);\n  } else {\n    console.log(&quot;canvas or addEventListener is unsupported!&quot;);\n  }\n\n  function updateSize() {\n    canvas.width = window.innerWidth * 2;\n    canvas.height = window.innerHeight * 2;\n    canvas.style.width = window.innerWidth + &#039;px&#039;;\n    canvas.style.height = window.innerHeight + &#039;px&#039;;\n    ctx.scale(2, 2);\n    width = (canvas.width = window.innerWidth);\n    height = (canvas.height = window.innerHeight);\n    origin = {\n      x: width \/ 2,\n      y: height \/ 2\n    };\n    normal = {\n      x: width \/ 2,\n      y: height \/ 2\n    };\n  }\n  class Ball {\n    constructor(x = origin.x, y = origin.y) {\n      this.x = x;\n      this.y = y;\n      this.angle = Math.PI * 2 * Math.random();\n      if (longPressed == true) {\n        this.multiplier = randBetween(14 + multiplier, 15 + multiplier);\n      } else {\n        this.multiplier = randBetween(6, 12);\n      }\n      this.vx = (this.multiplier + Math.random() * 0.5) * Math.cos(this.angle);\n      this.vy = (this.multiplier + Math.random() * 0.5) * Math.sin(this.angle);\n      this.r = randBetween(8, 12) + 3 * Math.random();\n      this.color = colours[Math.floor(Math.random() * colours.length)];\n    }\n    update() {\n      this.x += this.vx - normal.x;\n      this.y += this.vy - normal.y;\n      normal.x = -2 \/ window.innerWidth * Math.sin(this.angle);\n      normal.y = -2 \/ window.innerHeight * Math.cos(this.angle);\n      this.r -= 0.3;\n      this.vx *= 0.9;\n      this.vy *= 0.9;\n    }\n  }\n\n  function pushBalls(count = 1, x = origin.x, y = origin.y) {\n    for (let i = 0; i &lt; count; i++) {\n      balls.push(new Ball(x, y));\n    }\n  }\n\n  function randBetween(min, max) {\n    return Math.floor(Math.random() * max) + min;\n  }\n\n  function loop() {\n    ctx.fillStyle = &quot;rgba(255, 255, 255, 0)&quot;;\n    ctx.clearRect(0, 0, canvas.width, canvas.height);\n    for (let i = 0; i &lt; balls.length; i++) {\n      let b = balls[i];\n      if (b.r &lt; 0) continue;\n      ctx.fillStyle = b.color;\n      ctx.beginPath();\n      ctx.arc(b.x, b.y, b.r, 0, Math.PI * 2, false);\n      ctx.fill();\n      b.update();\n    }\n    if (longPressed == true) {\n      multiplier += 0.2;\n    } else if (!longPressed &amp;&amp; multiplier &gt;= 0) {\n      multiplier -= 0.4;\n    }\n    removeBall();\n    requestAnimationFrame(loop);\n  }\n\n  function removeBall() {\n    for (let i = 0; i &lt; balls.length; i++) {\n      let b = balls[i];\n      if (b.x + b.r &lt; 0 || b.x - b.r &gt; width || b.y + b.r &lt; 0 || b.y - b.r &gt; height || b.r &lt; 0) {\n        balls.splice(i, 1);\n      }\n    }\n  }\n}\nclickEffect();\/\/\u8c03\u7528\u7279\u6548\u51fd\u6570\n&lt;\/script&gt;\n&lt;!--\u70b9\u51fb\u70df\u82b1--&gt;<\/code><\/pre>\n<h1>\u6587\u7ae0\u5361\u7247\u534a\u900f\u660e<\/h1>\n<p>\u6dfb\u52a0\u5982\u4e0bjs\u811a\u672c\uff1a<\/p>\n<pre><code class=\"language-php\">&lt;script&gt;\n\nfunction hexToRgb(hex,op){\nlet str = hex.slice(1);\nlet arr;\nif (str.length === 3) arr = str.split(&#039;&#039;).map(d =&gt; parseInt(d.repeat(2), 16));\nelse arr = [parseInt(str.slice(0, 2), 16), parseInt(str.slice(2, 4), 16), parseInt(str.slice(4, 6), 16)];\nreturn `rgb(${arr.join(&#039;, &#039;)}, ${op})`;\n};\n\nlet themeColorHex = getComputedStyle(document.documentElement).getPropertyValue(&#039;--themecolor&#039;).trim();\nlet op1 = 0.65\nlet themeColorRgb = hexToRgb(themeColorHex,op1);\nlet themecolorGradient = getComputedStyle(document.documentElement).getPropertyValue(&#039;--themecolor-gradient&#039;)\n\ndocument.documentElement.style.setProperty(&#039;--themecolor-gradient&#039;,themeColorRgb)\nlet op2 = 0.8\nlet colorTint92 = getComputedStyle(document.documentElement).getPropertyValue(&#039;--color-tint-92&#039;).trim();\ncolorTint92 += &#039;, &#039;+op2;\ndocument.documentElement.style.setProperty(&#039;--color-tint-92&#039;,colorTint92)\n\nlet op3 = 0.7\nlet colorShade90 = getComputedStyle(document.documentElement).getPropertyValue(&#039;--color-shade-90&#039;).trim();\ncolorShade90 += &#039;, &#039; + op3;\ndocument.documentElement.style.setProperty(&#039;--color-shade-90&#039;,colorShade90)\n\nlet op4 = 0.8\nlet colorShade86 = getComputedStyle(document.documentElement).getPropertyValue(&#039;--color-shade-86&#039;).trim();\ncolorShade86 += &#039;, &#039; + op4;\ndocument.documentElement.style.setProperty(&#039;--color-shade-86&#039;,colorShade86)\n\n&lt;\/script&gt;<\/code><\/pre>\n<p>\u5206\u522b\u8c03\u6574\u5404op\u503c\u5373\u53ef\u8c03\u6574\u900f\u660e\u5ea6<\/p>\n<h1>\u989d\u5916CSS<\/h1>\n<h2>\u603b\u89c8<\/h2>\n<p>\u5728\u81ea\u5b9a\u4e49-\u989d\u5916css\u4e2d\u6309\u9700\u6dfb\u52a0\u5373\u53ef<\/p>\n<pre><code class=\"language-css\">#leftbar_announcement {\nbackground: var(--themecolor-gradient) !important;\n}\n#footer{\nbackground: var(--themecolor-gradient) !important\n}\n\n \/*\u8bbe\u7f6e\u7f51\u7ad9\u5b57\u4f53*\/\n@font-face{ \nfont-family:btfFont; \nsrc: url(https:\/\/levin.ink\/font\/SanJiYuanTiJian-Zhong-2.woff2) format(&#039;woff2&#039;) \n} \n\nbody{ \nfont-family:&quot;btfFont&quot; !important \n}\n\n\/*\u9876\u680f\u83dc\u5355*\/\n.navbar-nav .nav-link {\n    font-size: 1rem;\n    font-family: &#039;btfFont&#039;;\n}\n.nav-link-inner--text {\n    \/*\u9876\u680f\u83dc\u5355\u5b57\u4f53\u5927\u5c0f*\/\n \u00a0 \u00a0font-size: 1rem;\n}\n.navbar-nav .nav-item {\n    margin-right:0;\n}\n.mr-lg-5, .mx-lg-5 {\n    margin-right:1rem !important;\n}\n.navbar-toggler-icon {\n    width: 1.5rem;\n    height: 1.5rem;\n}\n.navbar-expand-lg .navbar-nav .nav-link {\n    padding-right: 0.9rem;\n    padding-left: 1rem;\n}\n\n\/*\u9876\u680f\u56fe\u6807*\/\n.navbar-brand {\n    font-family: &#039;Noto Serif SC&#039;,serif;\n    font-size: 0.1rem;\n    \/*\u9876\u680f\u56fe\u6807\u8fb9\u754c\u5fae\u8c03*\/\n    margin-right: 0rem;\n            \/*\u5de6\u53f3\u504f\u79fb*\/\n    padding-bottom: 0.3rem;\n}\n.n\n\n\/*\u9876\u90e8\u56fe\u6807\u5927\u5c0f\u4fee\u6539*\/\n.navbar-brand img {\nheight: 40px;\n}\n\n\/*\u9690\u85cf\u5de6\u4fa7\u680f\u641c\u7d22\u6846*\/\n.leftbar-menu {display: none;}\n.leftbar-search-button {display: none;}\n#leftbar_part2_inner:before {display: none;}\n@media screen and (min-width: 900px){\n    .leftbar-banner {\n    border-radius: var(--card-radius);\n    }\n}\n\n\/*\u9690\u85cf\u5de6\u79fb\u6309\u94ae*\/\n#fabtn_toggle_sides{display:none;}\n\n\/*\u56de\u9876\u56fe\u6807\u653e\u5927*\/\n#fabtn_back_to_top,\n#fabtn_go_to_comment,\n#fabtn_toggle_blog_settings_popup,\n#fabtn_toggle_sides,\n#fabtn_open_sidebar,\n#fabtn_toggle_darkmode {\n    font-size: 1.2rem;\n}\n\n\/*\u9f20\u6807\u6837\u5f0f\u4fee\u6539*\/\n\/*\nbody {\n    cursor: url(https:\/\/...\/xxx.ico), auto;\n}\n*\/\n\n\/*\u6b63\u6587\u8868\u683c\u6837\u5f0f\u4fee\u6539*\/\narticle table&gt;tbody&gt;tr&gt;td,\narticle table&gt;tbody&gt;tr&gt;th,\narticle table&gt;tfoot&gt;tr&gt;td,\narticle table&gt;tfoot&gt;tr&gt;th,\narticle table&gt;thead&gt;tr&gt;td,\narticle table&gt;thead&gt;tr&gt;th {\n    padding: 8px 10px;\n    border: 1px solid;\n}\n\n\/*\u8868\u683c\u5c45\u4e2d\u6837\u5f0f*\/\n.wp-block-table.aligncenter {\n    margin: 10px auto;\n}\n\n\/*\u6b63\u6587\u56fe\u7247\u8fb9\u8ddd\u4fee\u6539*\/\narticle figure {\n    margin-top:0;\n    margin-bottom: 1rem;\n}\n.wp-block-columns {\n    margin-bottom:0;\n}\n\n\/*\u5de6\u4fa7\u680f\u8fb9\u8ddd\u4fee\u6539*\/\n.tab-content {\n    padding: 10px 0px 0px 0px !important;\n}\n\n.site-author-links {\n    padding: 0px 0px 0px 10px;\n}\n\n\/*\u76ee\u5f55\u4f4d\u7f6e\u504f\u79fb\u4fee\u6539*\/\n#leftbar_catalog {\n    margin-left: 0px;\n}\n\n\/*\u76ee\u5f55\u6761\u76ee\u8fb9\u8ddd\u4fee\u6539*\/\n#leftbar_catalog .index-link {\n    padding: 4px 4px 4px 4px;\n}\n\n\/*\u7f51\u7ad9\u9ed1\u767d\u8272\uff08\u60bc\u5ff5\uff09*\/\n\/*\nhtml {\n    filter: grayscale(100%);\n    -webkit-filter: grayscale(100%);\n    -moz-filter: grayscale(100%);\n    -ms-filter: grayscale(100%);\n    -o-filter: grayscale(100%);\n    filter: url(&quot;data:image\/svg+xml;utf8,#grayscale&quot;);\n    filter:progid:DXImageTransform.Microsoft.BasicImage(grayscale=1);\n    -webkit-filter: grayscale(1);\n}\n*\/<\/code><\/pre>\n<h1>live2d\u770b\u677f\u5a18<\/h1>\n","protected":false},"excerpt":{"rendered":"<p>\u8fd0\u884c\u65f6\u95f4\u3001\u8017\u65f6\u53ca\u5360\u7528\u5185\u5b58 \u5728footer.php\u4e2d \u524d\u6dfb\u52a0\u4ee5\u4e0b\u4ee3\u7801\uff1a &lt;!&#8211;\u8017\u65f6\u53ca\u5360\u7528\u5185\u5b58\u5f00\u59cb&#8211;&#038;g [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5],"tags":[],"class_list":["post-223","post","type-post","status-publish","format-standard","hentry","category-bookshelf"],"_links":{"self":[{"href":"https:\/\/levin.ink\/index.php?rest_route=\/wp\/v2\/posts\/223","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/levin.ink\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/levin.ink\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/levin.ink\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/levin.ink\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=223"}],"version-history":[{"count":1,"href":"https:\/\/levin.ink\/index.php?rest_route=\/wp\/v2\/posts\/223\/revisions"}],"predecessor-version":[{"id":224,"href":"https:\/\/levin.ink\/index.php?rest_route=\/wp\/v2\/posts\/223\/revisions\/224"}],"wp:attachment":[{"href":"https:\/\/levin.ink\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=223"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/levin.ink\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=223"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/levin.ink\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=223"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}