Skip to content
This repository was archived by the owner on Jan 27, 2021. It is now read-only.
This repository was archived by the owner on Jan 27, 2021. It is now read-only.

怎么修改脚本 #10

@Allen-LPL

Description

@Allen-LPL

不知道怎么修改脚本, 自己做了一些尝试:
修改:
\blog\themes\next\node_modules\hexo-helper-live2d\index.js

修改了71行的"right"
修改了72行的"z-index"

修改为:

 hexo.extend.helper.register('live2d', function (config) {
  var config = Object.assign(
    {
      model:"z16",
      width: 150,
      height: 300,
      className: "live2d",
      id: "live2dcanvas",
      bottom: -20
    },
    config, 
    hexo.config.live2d
  );
  return `
    <script type="text/javascript" src="/live2d/script.js"></script>
    <canvas id="${config.id}" width="${config.width}" height="${config.height}" class="${config.className}"></canvas>
    <style>
      #${config.id} {
        position: fixed;
        right: 10px;
        z-index: 9999;
        pointer-events: none;
        bottom: ${config.bottom}px;
      }
    </style>
    <script>loadlive2d(${JSON.stringify(config.id)} ,${JSON.stringify(url.resolve("/live2d/assets/",models[config.model]))})</script>
  `
});

但是在渲染的时候, 没有变化, 这是为什么呢?

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions