MRX.LAFuck the Rules!

PHP中将中文字符转换为HTML实体

方便使用不同编码浏览器的人查看你的网页内容.不过这本身就是PHP自带的函数,不需要什么其他玩意的支持

echo mb_convert_encoding (’哟嗬嗬嗬’, ’HTML-ENTITIES’, ’gb2312′);

此时别人查看网页源码中的”哟嗬嗬嗬”显示为:哟嗬嗬嗬阅读全文 →

live2d看板娘可还行

网上类似的wordpress插件很多,但是这个我感觉简洁也方便,只需要在你想加入的页面加个JS就成.当然你也可以百度搜一下live2d看板娘,修改版也挺多.


<script src=”https://l2dwidget.js.org/lib/L2Dwidget.min.js”></script>
<script type=”text/javascript”>
  L2Dwidget
  .on(’*', (name) => {
  console.log(’%c EVENT ’ + ’%c -> ’ + name, ’background: #222; color: yellow’, ’background: #fff; color: #000′)
  })
  .init({
    display: {
      // 居左
      ”position”: ”left”,
      // 宽度
      ”width”: 200,
      // 高度
      ”height”: 400,
      // 距左右
      ”hOffset”: 35,
      // 距下
      ”vOffset”: -20
    },
 
    mobile: {
      // 移动端,false为关闭
      ”show”: true,
      ”scale”: 0.5
    },
 
    dialog: {
    // 开启对话框,false为关闭
      enable: true,
      script: {
        // 每空闲 10 秒钟,显示一条一言
        ’every idle 10s’: ’$hitokoto$’,
        // 当触摸到角色身体
        ’tap body’: ’哎呀!别碰我!’,
        // 当触摸到角色头部
        ’tap face’: ’人家已经不是小孩子了!’
      }
    }
  });
</script>

用JS替换网页中失效的图片

😁这个很多地方可以用上.直接检查网页中的IMG标签,如果失效就替换成指定图片

<script language=”JavaScript”>var hateimg=document.getElementsByTagName(”img”);for(i=0;i<hateimg.length;i++){hateimg[i].onerror=function(){this.src=”https://www.baidu.com/logo.png”}}</script>

Enlighter插件MAC风格自定义CSS分享

在你的主题后台自定义css部分插入如下css,欸不过好像有点问题,算了回头检查下.

.enlighter::-webkit-scrollbar {
    width: 8px;
    height: 6px;
}
.enlighter::-webkit-scrollbar-thumb {
    background-color: #1E90FF;
    background-image:-webkit-linear-gradient(45deg, rgba(50,205,50) 25%, transparent 25%, transparent 50%, rgba(        50,205,50) 50%, rgba(    50,205,50) 75%, transparent 75%, transparent);
}
.enlighter::-webkit-scrollbar-track-piece {
    background: #444;
}
.enlighter-default {
    border-radius: 8px;
    padding-top: 34px!important;
    margin-bottom: 20px!important;
    background: #444;
}
.enlighter-default .enlighter {
    max-height: 510px;
    overflow: auto;
    white-space: nowrap;
    display: block;
    background: #444;
}
.enlighter-default::after {
    content: ” ”;
    position: absolute;
    -webkit-border-radius: 50%;
    border-radius: 50%;
    background: #c7c7c7;
    width: 12px;
    height: 12px;
    top: 0;
    left: 15px;
    margin-top: 11px;
    -webkit-box-shadow: 20px 0 #c7c7c7, 40px 0 #c7c7c7;
    box-shadow: 20px 0 #c7c7c7, 40px 0 #c7c7c7;
    transition-duration: .3s;
}
.enlighter-default:hover::after {
    background: #fc625d;
    -webkit-box-shadow: 20px 0 #fdbc40, 40px 0 #35cd4b;
    box-shadow: 20px 0 #fdbc40, 40px 0 #35cd4b;
}
.enlighter-t-monokai.enlighter-linenumbers div.enlighter>div::before {
    color: #ccc;
    background: #555;
}
.enlighter-default.enlighter-hover div.enlighter>div:hover:before {
    color: #fff;
}

顺便解释下是嘛意思:阅读全文 →