npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

yzhandanmu

v1.0.23

Published

Y站弹幕插件,适应任意高度、长度、速度弹幕,支持多种不重叠策略,CSS 3 动画,高效极简(2KB),兼容绝大多数设备。通道算法受专利权保护。Y station barrage plug-in, suitable for barrages of any height, length and speed, CSS 3 animation, 2KB size, compatible with most devices. The channel algorithm is protected by patent.

Downloads

9

Readme

Y 站弹幕插件 Y station barrage plug-in

npm npm bundle size (version) npm ie10+
Y 站弹幕插件,适应任意高度、长度、速度弹幕,支持多种不重叠策略
CSS 3 动画,高效极简(2kB),兼容绝大多数设备和 IE10+
Y station barrage plug-in, suitable for barrages of any height, length and speed
CSS 3 animation, 2kB size, compatible with most devices and IE10+

Preview 预览

Y 站弹幕插件预览图 Y station barrage plug-in Preivew GIF

Quick Start 快速开始

Node.js

npm i yzhandanmu
import YZhanDanMu from 'yzhandanmu'

Browser

<script src="https://cdn.jsdelivr.net/npm/yzhandanmu/dist/yzhandanmu.min.js"></scirpt>

Demo 演示

  • Native Javascipt Demo: https://mantoufan.github.io/yzhanDanmu/demo/
  • React with styled-components Demo: https://mantoufan.github.io/yzhanDanmu/demo/react.html

It could be used with any JS / TS Library 可以与任意 JS 和 TS 库搭配使用

API

/** Step 1 Initialize */
const yZhanDanMu = new YZhanDanMu({
  p: document.getElementById('app') // Select an element on the page as the container
})
/** Step 2 Create Barrage */
// Native JS
const o = document.createElement('DIV')
o.innerText = 'Text'
// React
const o = ReactDOM.render(<div>Text</div>, document.createDocumentFragment())
/** Step 3 Add Barrage to the container */
yZhanDanMu.add(o, {
  duration: 2000, // ms,Barrage display time
  speed: .2, // px / ms, Barrage display speed, it will override the duration, keep barrages of different lengths at the same speed
  prior: 'time' /** Display strategy of new barrage when Barrage is full:
  1. time - Barrage will appear on time, even if it overlaps
  2. nooverlap - Barrage will be delayed until a space is available
  3. nooverlap-highest - Barrage will be delayed until a space is available as soon as possible
  */
}
/** Step 4 destroy */
yZhanDanMu.destroy()

Features 功能

  • Adapt to barrage at any height and length
    弹幕高度、长度任意
  • Barrage can be displayed at a fixed time or at a fixed speed (uniform speed)
    弹幕可以固定时间或固定速度(匀速)显示
  • When the barrage is full, multiple priority strategies can be added to the new barrage
    弹幕全满时,新弹幕添加可选多种优先策略
    • time - Barrage will appear on time, even if it overlaps
      时间优先:弹幕将准时出现,即使会重叠
    • nooverlap - Barrage will be delayed until a space is available
      不重叠优先:弹幕将延迟出现,直到找到空位
    • nooverlap-highest - Barrage will be delayed until a space is available as soon as possible
      不重叠优先之最高优先级:弹幕将延迟出现,直到找到空位,并且会尽快
  • Automatic power saving
    自动省电
    • On devices that support automatic power saving, when the current window is not active, slow down or stop running
      支持自动省电的设备上,当前窗口不活跃时,降速或停止运行

Patent Right 专利权

The application channel algorithm of the plug-in has obtained the patent right of Chinese invention and is under protection
本插件应用通道算法已获得中国发明专利权,正处于保护期间