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

x-acronym

v1.0.2

Published

Acronym is a custom web component. It is a textbox that holds a acronym but if the mouse hovers over it, it will expand to show the whole text

Downloads

5

Readme

Published on webcomponents.org

Acronym:

What is it?

Acronym is a custom web component. It is a text box that holds an acronym. When a mouse is over the element, it will expand and show the meaning of the acronym. When the mouse is no longer over the element, it will contact to just show the acronym again. For example, NASA will expand to National Aeronautics and Space Administration.

Alt text

Click here for Demo

How to use it?

It is quite easy to use it on your webpage. Just follow the below steps:

  1. Include the link to the script file that holds the this custom web component (progress-circle.js) near the bottom of the body section of your webpage. See below
    <script src="./acronym.js"></script>
  1. Then use the custom element tags on your webpage.
    <x-acronym type="vertical" innerstyle="box-shadow: 6px 6px 3px grey; text-shadow: 0 0 3px #FF0000;">
        National Aeronautics and Space Administration
    </x-acronym>

Note: The inner text of this custom element will be used to set the acronym. It will take the first letter of each word and that will display in the text box. When expanded the whole text will be shown. That is all you have to do to use this custom element. There is an example HTML page (acronym.html) that shows how to use it.

    <!DOCTYPE html>
    <html>
      <head>
        <title>Acronym Web Component</title>
        <script>
            function acronymclick(){
                alert("click event has been triggered!!");
            }
        </script>
      </head>
      
      <body>
      
        <h1>This is a template of the web component "acronym"</h1>
        <x-acronym type="vertical" onclick="acronymclick()" innerstyle="box-shadow: 6px 6px 3px grey; text-shadow: 0 0 3px #FF0000; background-color: Beige; border-radius: 15px; border: 3px solid black;">
            Matthew Monroe Grant
        </x-acronym>

        <script src="./acronym.js"></script>

      </body>
      
    </html>

There are only three properties (2 attributes and the innerText) that you can use to customize this element.

  1. innerText - The first letter of each word will be used for the acronym and when expanded the whole text will be shown
  2. type - Is how this custom element will be displayed there are two options (horizontal or veritical)
  3. innerstyle - this attibutes allows you to set the style for the text box (see example to see how this is used)

To Do:

  1. Add a way to ignore words in the innerText that you don't want to add to the acronym. Maybe by using Upper and Lowercase to determine which to ignore. For example: National Aeronautics and Space Administration - "and" will be ignored and the acronym will be NASA
  2. Fix it so that one can use text-align: center. See note below

Note: That each of these attributes have defaults values but you need to a least set the innerText. Also, don't use 'text-align: center' for this element as it mess up the spacing.
Instead use a wrapper div with 'margin: auto', if you want to center the element