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

overflow-marquee

v0.2.0

Published

Angular directive to turn long elements to a marquee only if it overflows.

Downloads

10

Readme

Overflow Marquee

Angular directive to make text marquee if it overflows its container, in the style of old iOS music app. Instead of fully scrolling off-screen then looping, it only scrolls until the overflowed text is shown (i.e., the entire string has been displayed to its last character).

Run npm start to see the demo.

Dependencies

  • Angular 1.6
  • jQuery 3.3

Usage

Via NPM: npm install --save overflow-marquee

This will also give you the demo and the tests.

If you simply want to include the code, get the overflow-marquee.min.js and overflow-marquee.min.css from the /build folder, and include it in your page.

Example

Rollcall for all options!

<html>
    <head>
        <!-- Include jQuery, Angular, and the overflow-marquee code here -->

        <script>
            angular.module('Stuff', ['overflow-marquee']);
            angular.module('Stuff').controller(function($scope) {
                $scope.woo = false;
            });
        </script>

        <style>
            html, body {
                margin: 0; padding: 0; background: #E9967A; font-family: Helvetica, Arial, sans-serif;
            }
            #content {
                width: 400px; height: 40px; line-height: 40px; position: relative; top: calc(50% - 20px); margin: 8px auto; background: #FFF;
            }
        </style>
    </head>

    <body ng-app="Stuff">
        <div id="content">
            <span overflow-marquee
                overflow-marquee-speed=1
                overflow-marquee-pause="foo"
                ng-click="foo = !foo"
                ng-init="foo = false">Mama just killed a man; put a gun against his head, pulled the trigger now he's dead. 
        </div>
    <body>
</html>

Options

All options are optional. :wink:

overflow-marquee-speed (Integer)

Pixels shifted per 25 milliseconds. Default is 1.

overflow-marquee-pause (Angular Expression)

Use overflow-marquee-pause to pause conditionally. Bind it to a variable or an expression. Go crazy with as many as 50 marquees on one page!

Tests

The tests are made with Karma, Mocha, and Chai. Run them with:

npm test

Development

Contributions are welcome!