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

@iota-cn/avatar

v0.1.13

Published

``` npm install @iota-cn/avatar ```

Downloads

17

Readme

@iota-cn/avatar

Install

npm install @iota-cn/avatar

Use

Import

import Avatar from '@iota-cn/avatar'
import '@iota-cn/avatar/dist/avatar.css'
Vue.use(Avatar)

AvatarViewer

<template>
    <div id="examples">
        <div class='section'>
            <h3>AvatarViewer</h3>
            <code>
            </code>
            <h4>Example</h4>
            <div class='example'>
                <iota-avatar-viewer showUpload
                    nickname="Hi"
                    :img="vueImg"
                    :radius='51' />
            </div>
        </div>
    </div>
</template>

Props

props: {
        showUpload: Boolean,  // Whether show upload icon
        nickname: {           // the name show when image is missing  
            type: String
        },
        img: String,          // avatar image
        width: {              
            type: Number,
            default: 100
        },
        height: {
            type: Number,
            default: 100
        },
        radius: {
            type: Number,
            default: 4
        },
        color: {               // background color
            type: String,
            default: 'gray'
        },
        userStyle: {           // custome styles
            type: Object,
            default() {
                return undefined
            }
        }
    }

RawAvatar

<template>
    <div id="examples">
        <div class='section'>
            <h3>RawAvatar</h3>
            <code>
            </code>
            <h4>Example</h4>
            <div class='example'>
                <iota-rawavatar :img='vueImg'/>
            </div>
        </div>
    </div>
</template>

Props

    props: {
        uploadImg: Function,   // call back to handle image changed(click then select a new image)
        width: Number,         
        height: Number,
        img: String,           // image to show, you can reset it after the 'uploadImg' handler finished.
        tips: Array,           // tips show to the user.
        disabled: Boolean,     // disable click event
    }

AvatarEditor

<template>
    <div id="examples">
        <div class='section'>
            <h3>AvatarEditor</h3>
            <code>
            </code>
            <h4>Example</h4>
            <div class='example'>
                <div class="example-avatar-editor">
                    <iota-avatar-editor :avatarFile='vueImg' />
                </div>
            </div>
        </div>
    </div>
</template>

Props

    props: {
        title: {                           // Editor title, default: Upload Image
            type: String
        },
        previewHint: {                     // hint of preview, default: Preview
            type: String
        },
        selectImgHint: {                   // hint of select image, default: Select Image
            type: String
        },
        cropHint: {                        // hint of crop, default: Best size 'width'x'height', you can cut it.
            type: String
        },
        onAvatarData: Function,            // call back to process the image content.
        radiusPerc: Number,                // radius percent, default: 100 (%)
        width: Number,                     // width of cut window, default: 100 (px)
        height: Number,                    // height of cut window, default: 100 (px)
        avatarFile: {                      // the image to show
            type: [Object, String, File]
        }
    }

Avatar

<template>
    <div id="examples">
        <div class='section'>
            <h3>AvatarEditor with default Modal</h3>
            <code>
            </code>
            <h4>Example</h4>
            <div class='example'>
                <iota-avatar />
            </div>
        </div>
    </div>
</template>

Props

    props: {
        title: String,          // Editor title, default: Upload Image
        previewHint: String,    // hint of preview, default: Preview
        selectImgHint: String,  // hint of select image, default: Select Image
        cropHint: String,       // hint of crop, default: Best size 'width'x'height', you can cut it.
        onAvatarData: Function, // call back to process the image content.
        width: Number,          // width of cut window, default: 100 (px)
        height: Number,         // height of cut window, default: 100 (px)
        radiusPerc: Number      // radius percent, default: 100 (%)
    }

slot

controller                      // replace default 'Select Image' button, for example, you can use an AvataViewer inside the Avatar

head                            // replace the "default header" in opened modal dialog.

Example

git clone [email protected]:iota-cn/vue-iota-avatar.git

cd vue-iota-avatar
npm i
npm run examples
 DONE  Compiled successfully in 9558ms                                                                                                                                                        13:15:45


  App running at:
  - Local:   http://localhost:8080/
  ...