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

vue-raffle-wheel

v1.3.2

Published

A raffle wheel component based on Barney Parker's codepen: https://codepen.io/barney-parker/pen/OPyYqy

Downloads

4

Readme

vue-raffle-wheel

A raffle wheel component based on Barney Parker's codepen: https://codepen.io/barney-parker/pen/OPyYqy

Installation

npm i vue-raffle-wheel -S

Usage

Global

import RaffleWheel from "vue-raffle-wheel";
// Some Other Code
Vue.use(RaffleWheel);

Individual Component

import RaffleWHeel from "vue-raffle-wheel";
export default {
  name: "my-component"
  ...otherSetup,
  components: { RaffleWheel },
}

In Template

<template>
  <div class="wrapper">
    <RaffleWheel
      :options="[
        'Shaggy',
        'Scooby',
        'Thelma',
        'Daphne',
        'Fred',
        'The Rest of the Gang',
      ]"
    />
  </div>
</template>

Available Props

| Prop | Type | Name | Default Value | Required | | ------------ | ------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------- | -------- | | options | Array | An array of values to appear in the slices of the wheel. Optionally can be an array of objects with a text value for display color value equal to the hex value of the desired background color for the slice, and fontColor equal to the hex value of the desired font color for the slice (see color options for details). | [] | * | | slicesFont | Object | An object containing 3-4 values: style, size, family, and optionaly color(see color options for details) used to style the font in the slices of the wheel. | { style: "bold", size: "12px", family: "Helvetica, Arial", } | | | hubFont | Object | An object containing 3-4 values: style, size, family, and optionaly color(see color options for details) used to style the font in the hub (center) of the wheel. | { style: "bold", size: "30px", family: "Helvetica, Arial", } | | | blockSpin | Boolean | Used to disable the spin button. | false | | | buttonText | String | Sets the text in the button | "Spin" | | | hideButton | Boolean | Hides the button if true | false | | | startAngle | Number | Set the degrees to which the wheel is initially rotated. | 0 | | | canvasWidth | Number | Set the width of the canvas element. (Defaults to 500) | 500 | | | canvasHeight | Number | Set the height of the canvas element. (Defaults to 500) | 500 | |

Available Events

| Event | Returned Value | Description | | ---------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------ | | spin-start | null | The function governing the spinning of the wheel has started | | spin-stop | value from options array corresponding to where the wheel stopped. Note: the value will be the top level value from the options array by index. I.e. if it's an object with text and color values this return that object. | The function governing the spinning of the wheel has stopped |

Color Options

Fonts

You have a few options to set color values for slices and fonts in the wheel. All fonts default to the css value black and can be overidden as follows.

Slices

Slices will first look for a fontColor value in the corresponding options object, then the color value in the slicesFont prop, and then fall back to black.

Hub

The hub (center of the wheel) will first look for a color value in the hubFont prop.

  • If no color value is present it will defaul to black.
  • If the color value is set to use-slice and a value is set in the color value of the slicesFont prop it will use the slicesFont.color value.
  • If the color value is set to use-option it will look for a fontColor value in the option object that corresponds to the slice the wheel landed on. If no fontColor exists in the landed on option it will use the slicesFont.color value. If no slicesFont.color value exists it will fall back to black.