JSPM

barrage-canvas-ui

1.0.5
    • ESM via JSPM
    • ES Module Entrypoint
    • Export Map
    • Keywords
    • License
    • Repository URL
    • TypeScript Types
    • README
    • Created
    • Published
    • Downloads 2
    • Score
      100M100P100Q14811F
    • License ISC

    canvas 弹幕

    Package Exports

    • barrage-canvas-ui
    • barrage-canvas-ui/lib/index.js

    This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (barrage-canvas-ui) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

    Readme

    弹幕

    目前该组件只是雏形,只适合内部自行使用,不太适合其他项目。文档也都没有完善

    Install

        npm install barrage-canvas-ui -S

    Use page

        const barrage = new Barrage({
            element:'#app',
            backgroundImg:'',//该属性目前还未添加
            barrageArea:'all',//
            width,height,//画布宽,可不传 默认取设定元素的宽
    
            
        })
    
        barrage.draw();
    
        const barrageList = [{
            value:{
                content:'弹幕内容',
                ...后续会添加头像/点赞数等参数
            }
        }]
        barrageList.forEach(item=>{
            barrage.add(t);
        })
        barrage.destory(fun)//销毁,可传递回调

    Demo

    npm install 
    npm run start

    期待后续会持续更新