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

common-ui-asdiver

v1.0.11

Published

for study

Downloads

5

Readme

common-ui-asdiver

a simple UI Library for study。

Installing

Using npm:

$ npm install common-ui-asdiver

Example

At present, there are only rotation charts

Suppose you need one rotation at a dom just set size and give it to package

<body>
  <div class="total">

  </div>
</body>

<style>
/* The recommended size is the same as the reserved image */
  .total{
    width: 600px;
    height: 400px;
    background-color: pink;
  }
</style>

use->

const UI = require("common-ui-asdiver")
const retation = new UI.Rotation(".total",
//source imgs
[{
  src:"https://gimg2.baidu.com/image_search/src=http%3A%2F%2Fimg.jj20.com%2Fup%2Fallimg%2F1113%2F052420110515%2F200524110515-1-1200.jpg&refer=http%3A%2F%2Fimg.jj20.com&app=2002&size=f9999,10000&q=a80&n=0&g=0n&fmt=auto?sec=1665314220&t=dc9d86b9b54d484143dd424bf5447b01",
  clickFunction:(e)=>{
  console.log(e);
  }
},{
  src:"https://gimg2.baidu.com/image_search/src=http%3A%2F%2Fwww.2008php.com%2F09_Website_appreciate%2F10-07-11%2F1278861720_g.jpg&refer=http%3A%2F%2Fwww.2008php.com&app=2002&size=f9999,10000&q=a80&n=0&g=0n&fmt=auto?sec=1665452390&t=60a46609e614183e2d972f32f4ad50b0",
  clickFunction:(e)=>{
  console.log(e);
  }
},{
  src:"https://imgcps.jd.com/ling4/100037199897/5Lqs6YCJ5aW96LSn/5L2g5YC85b6X5oul5pyJ/p-5bd8253082acdd181d02fa1b/ec752cb5/cr/s/q.jpg",
  clickFunction:(e)=>{
  console.log(e);
  }
}],{
//about move set up(required)
move:{
  //speed
  moveTime:"0.5s",
  // is auto move
  autoMoveOpen:true,
  //the direction of auto move ,negative to left, positive number to right
  autoMoveDirection:1,
  //movement interval
  autoMoveTime:2000,
  //slide move in mobile terminal (warning : user active movement only be one mode,it means touchMove and buttonStyle just choose one)
  touchMove:true

},
//buttonType (is optional. Without this attribute, it means that it is not used)
// buttonStyle:{
//   //whether to display when the mouse is not on the box
//   mouseOutDisplay:true,
//   //button size
//   height:"30px",
//   width:"21px",
//   //button color
//   buttonColor:"yellow",
//   LeftButtonDomFunc(buttonDom){
//     const img =  document.createElement("img")
//     buttonDom.appendChild(img)
//     //...
//   },
//   RightButtonDomFunc(buttonDom){
//     const img =  document.createElement("img")
//     buttonDom.appendChild(img)
//     //...
//   }
// },
//The button list at the bottom (is optional. Without this attribute, it means that it is not used)
dotStyle:{
  //color when not selected
  unSelectColor:"black",
  //color when selected
  selectColor:"yellow",
  //button transparency
  opacity:0.5,
  //size of button
  size:"20px",
  //style of button
  borderRadius:"50px",
  //spacing
  margin:"0px 5px",
  //provide dom to height customization, you can even change the default style
  dotDomFunc(dotDomTotal){
    dotDomTotal.style.bottom = "5px"
    dotDomTotal.childNodes.forEach(element => {
      element.style.transition =  `width 0.5s ease-in-out`;
    });
  },
  //if you want have a prettier transition when dot been checked , I suggest add transition in dotDomFunc,this provide a case
  //Called when select
  selectFunc(dotDom){
    dotDom.style.width = "60px"
  },
  //Called when unSelect
  unSelectFunc(dotDom){
    dotDom.style.width = "20px"
  },


}
})

than work.

If you want to abandon this rotation,especially when vue switch router onBeforeUnmount. (in fact, I need release package for vue,this is the last word)

//it will clear dom element and automove interval
retation.abandon()

let me know if you have any questions.

heistory

1.0.10

add abandon function to clear itself

1.0.6 - 1.0.9

fix bug

1.0.5

buttonStyle change to not required

add move.touchMove (mobile terminal)

rich dotStyle

1.0.4

add dotStyle.dotDomFunc and buttonStyle.LeftButtonDomFunc / RightButtonDomFunc to provide height customization, you can even change the default style

1.0.3

  • Info property

    ButtonType change to buttonStyle, dots change to dotStyle.

  • Source code notes user jsdoc (chinese)

  • other patch...