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

text-roll

v1.0.3

Published

the plugin to rolling the long text.

Downloads

5

Readme

text-roll

the vue plugin to rolling the long text.

Demo

https://ockhamrazor.github.io/vue-text-roll/#/

Installtion

install npm adn use it as a vue plugin in your app

npm install --save text-roll

How to import

// amd or commonjs
var VueTextRoll = require('text-roll')
Vue.use(VueTextRoll)

// global component
import VueTextRoll from 'text-roll'
Vue.use(VueTextRoll)

// partial component
import {VueTextRoll} from 'text-roll'
export default {
  // ...
  components: {
    VueTextRoll
  }
  // ...
}

Usage

  • Wrap the element in an <vue-text-roll> tag
  • Set the width of the element

Example below:

html

<vue-text-roll class="text-roll-demo">
  <p>〇〇の笑颜 えがお は俺 おれ (私 わたし )が守 まも る</p>
</vue-text-roll>

css

.text-roll-demo {
  width: 300px;
}

How the plugin works

First, it copies the incoming slot contents, defined as A and B. (Note: if the initial state is "display: none", you need to call the refresh () method to recalculate the width) by calculating the width of the parent and the content to determine whether the need to scroll The text is scrolled by the following animation

@keyframes left-rolling {
   to {
     transform: translateX (-100%);
   }
}

Props

// auto rolling
auto: {
  type: Boolean,
  default: true
},
// mouseenter stop and mouseleave start
handleHover: {
  type: Boolean,
  default: false
},
// spacing size
gutter: {
  type: Number,
  default: 30
},
// animation duration
duration: {
  default: null
},
// the content wrapper style
wrapperStyle: {
  type: Object,
  default: () => {
    return {}
  }
},
// animation play speed
speed: {
  type: String,
  default: 'normal' // quick normal slow
}

Methods

// Recalculate the animation duration, and start Roll
refresh()

// start rolling 
startRoll()

// stop rolling
stopRoll()

More

// TODO // test

License

MIT