Giter Site home page Giter Site logo

echozhaoh / live2d-widget.js Goto Github PK

View Code? Open in Web Editor NEW

This project forked from devyumao/live2d-widget.js

0.0 0.0 0.0 10.5 MB

Add the Sseexxyyy live2d to webpages. Seperated from hexo-helper-live2d.

Home Page: https://l2dwidget.js.org/

License: Other

JavaScript 98.66% Shell 0.23% HTML 1.10%

live2d-widget.js's Introduction

live2d-widget.js

NOTEICE: This project won't be updated until next year

npm package

jsDelivr dependencies devDependencies build

downloads-total downloads-month

stars forks issues

Maintainability commitizen PRs license

Add the Sseexxyyy live2d to your webpages! Seperated from hexo-helper-live2d.

Demo: Playground

Docs: Click me!

Browser requirements

We use config below as our babel-preset-env's config.

"browsers": [
  "cover 99%",
  "last 2 years",
  "not ie < 9",
  "edge >= 12"
]

Installation

Please have a look at both README and CHANGELOG if you are upgraded from older version.

Yarn

yarn add live2d-widget@4

Sometimes yarn does better job than npm.

NPM

npm i --save live2d-widget@4

Hexo

See hexo-helper-live2d for the hexo plugin.

Webpages

JS code online generator: Click me!

Store script on your own web server

Download the latest release,

then extract and copy the dist folder to your website.

Insert codes into your HTML files using online generator, or make your own code

Making code manually:

import the js(replcae your own js path here in the src):

eg.

<script src="//js/live2d-widget/L2Dwidget.min.js"></script>

Then init it.

eg.

var currL2Dwidget = new L2Dwidget().init({});

Or with your own config

eg.

var currL2Dwidget = new L2Dwidget().init({
  'modelJsonPath': "https://cdn.jsdelivr.net/npm/live2d-widget-model-shizuku/assets/shizuku.model.json",
  'displayWidth': 150,
  'mobileShow': true
});

Using CDN

We have 3 CDNs,

  • Jsdelivr(Recommended) https://cdn.jsdelivr.net/npm/live2d-widget@4/dist/L2Dwidget.min.js

  • Unkpg https://unpkg.com/live2d-widget@4/dist/L2Dwidget.min.js

  • BundleRun https://bundle.run/live2d-widget@4/dist/L2Dwidget.min.js

Select your favourite CDN, and put code like this into your webpage.

eg.

<script src ="//cdn.jsdelivr.net/npm/live2d-widget@4/dist/L2Dwidget.min.js"></script>

Bookmarks

data:text/html,<script src=https://cdn.jsdelivr.net/npm/live2d-widget@4/dist/L2Dwidget.min.js></script><script>const currL2Dwidget = new L2Dwidget().init({});</script>
javascript:function loadScript(c,b){var a=document.createElement("script");a.type="text/javascript";"undefined"!=typeof b&&(a.readyState?a.onreadystatechange=function(){if("loaded"==a.readyState||"complete"==a.readyState)a.onreadystatechange=null,b()}:a.onload=function(){b()});a.src=c;document.body.appendChild(a)};loadScript("https://cdn.jsdelivr.net/npm/live2d-widget@4/dist/L2Dwidget.min.js",function(){const currL2Dwidget = new L2Dwidget().init({});});

Settings

See the document.

Default settings are atconfigStorage.js.

Enjoy!:beer:

This is my first plugin, star โญ and watch ๐Ÿ‘“, pull request is also welcomed.

Github: https://github.com/xiazeyu/live2d-widget.js

issues: https://github.com/xiazeyu/live2d-widget.js/issues

Contribute

Please pay enough attention to this document if you want to commit your changes or submit issues

CONTRIBUTING

Releated projects

About me

author author QQ author email

collaborator0 collaborator0 QQ collaborator0 email

Dependcies

current-device

Special Thanks

Open sourced under the GPL v2.0 license.

live2d-widget.js's People

Contributors

52cik avatar eyhn avatar journey-ad avatar xiazeyu avatar

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.