Code Monkey home page Code Monkey logo

laravel-l2d's Introduction

laravel-l2d

A live2d widget for laravel.

为Laravel定制的live2d widget

安装

  1. 使用composer安装
    $ composer require sinonjzh/laravel-l2d
  2. 发布资源文件
    $ php artisan vendor:publish --provider "SinonJZH\LaravelL2d\ServiceProvider"
  3. 加载js和css
    /resources/js/app.js
    //……
    require('./laravel-l2d/live2d.min.js');
    require('./laravel-l2d/autoload.js');
    /resources/sass/app.scss
    @import 'laravel-l2d/waifu';
    然后使用终端运行
    $ npm run watch-poll

配置

  1. (必须)修改live2d_api路径
    /resources/js/laravel-l2d/autoload.js
    if (screen.width >= 768) {
        initWidget({
     	   waifuPath: window.location.origin + "/vendor/laravel-l2d/waifu-tips.json",
     	   apiPath: "",  //Add your API path here
        });
    }
    //……
    关于自己搭建api服务器以及模型添加请参阅live2d-api
  2. 修改对话
    只需在/resources/js/laravel-l2d/autoload.js以及/public/vendor/laravel-l2d/waifu-tips.json中修改即可。

用法

安装完成后即可在站点显示live2d看板娘。

License

GNU v3.0

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.