live2d-widget-webcomponent
v0.1.1
Published
A webcomponent for playing live2d models as a widget.
Downloads
4
Readme
Live2D Widget Web Component
Usage
- Load Live2D Cubism SDK 2.1 (i.e.
live2d.min.js
) which this project depends. - Create an element
<live2d-widget>
with an optional string attributeconfig
which consumes a JSON string with typeLive2DWidgetConfig
. - Load
live2d-widget.umd.js
(orlive2d-widget.es.js
at your choice) indist
folder.
See the document of Live2DWidgetConfig
for more details.
Example Usage
<div class="widget-container">
<live2d-widget
config='{"width":1280,"height":1380,"models":[{"src":"https://cdn.jsdelivr.net/gh/guansss/pixi-live2d-display/test/assets/shizuku/shizuku.model.json"}]}'
/>
</div>
Build
Run in terminal
# NPM
npm run build
# Bun
bun run build