Skip to content

Commit

Permalink
Merge branch 'release/5.0.2'
Browse files Browse the repository at this point in the history
  • Loading branch information
CrazyTim committed Oct 2, 2024
2 parents c40e443 + dd7c46d commit 819c1c1
Show file tree
Hide file tree
Showing 6 changed files with 1,303 additions and 5,999 deletions.
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,13 @@ An easy to use, themeable component for randomising choices and prizes.
### ESM

```javascript
import {Wheel} from 'https://cdn.jsdelivr.net/npm/[email protected].1/dist/spin-wheel-esm.js';
import {Wheel} from 'https://cdn.jsdelivr.net/npm/[email protected].2/dist/spin-wheel-esm.js';
```

### IIFE

```html
<script src="https://cdn.jsdelivr.net/npm/[email protected].1/dist/spin-wheel-iife.js"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected].2/dist/spin-wheel-iife.js"></script>
```

### Local
Expand Down Expand Up @@ -142,7 +142,7 @@ Name | Default Value | Description
`borderColor` | `'#000'` | The [CSS color](https://developer.mozilla.org/en-US/docs/Web/CSS/color_value) for the line around the circumference of the wheel.
`borderWidth` | `0` | The width (in pixels) of the line around the circumference of the wheel.
`debug` | `false` | If debugging info will be shown.</p><p>This is helpful when positioning labels.
`image` | `null` | The image (HTMLImageElement) to draw on the wheel and rotate with the wheel.</p><p>It will be centered and scaled to fit `Wheel.radius`.
`image` | `null` | The [HTMLImageElement](https://developer.mozilla.org/en-US/docs/Web/API/HTMLImageElement) to draw on the wheel and rotate with the wheel.</p><p>It will be centered and scaled to fit `Wheel.radius`.
`isInteractive` | `true` | If the user will be allowed to spin the wheel using click-drag/touch-flick.</p><p>User interaction will only be detected within the bounds of `Wheel.radius`.
`itemBackgroundColors` | `['#fff']` | The [CSS colors](https://developer.mozilla.org/en-US/docs/Web/CSS/color_value) to use as a repeating pattern for the background colors of all items.</p><p>Overridden by `Item.backgroundColor`.</p><p>Example: `['#fff','#000']`.
`itemLabelAlign` | `'right'` | The alignment of all item labels.</p><p>Possible values: `'left'`,`'center'`,`'right'`.
Expand All @@ -162,7 +162,7 @@ Name | Default Value | Description
`onCurrentIndexChange` | `null` | The callback for the `onCurrentIndexChange` event.
`onRest` | `null` | The callback for the `onRest` event.
`onSpin` | `null` | The callback for the `onSpin` event.
`overlayImage` | `null` | The image (HTMLImageElement) to draw over the top of the wheel.</p><p>It will be centered and scaled to fit the container's smallest dimension.</p><p>Use this to draw decorations around the wheel, such as a stand or pointer.
`overlayImage` | `null` | The [HTMLImageElement](https://developer.mozilla.org/en-US/docs/Web/API/HTMLImageElement) to draw over the top of the wheel.</p><p>It will be centered and scaled to fit the container's smallest dimension.</p><p>Use this to draw decorations around the wheel, such as a stand or pointer.
`pixelRatio` | `0` | The pixel ratio (as a percent) used to draw the wheel.</p><p>Higher values will produce a sharper image at the cost of performance, but the sharpness depends on the current display device.</p><p>A value of `0` will use the pixel ratio of the current display device (see [devicePixelRatio](https://developer.mozilla.org/en-US/docs/Web/API/Window/devicePixelRatio)).
`pointerAngle` | `0` | The angle of the Pointer which will be used to determine the `currentIndex` (or the "winning" item).
`radius` | `0.95` | The radius of the wheel (as a percent of the container's smallest dimension).
Expand Down Expand Up @@ -224,7 +224,7 @@ Note: setting a property to `undefined` will reset it to the default value.
Name | Default Value | Description
------------------------------- | ----------------- | ---------------------------
`backgroundColor` | `null` | The [CSS color](https://developer.mozilla.org/en-US/docs/Web/CSS/color_value) of the item's background.</p><p>When `null`, the color will fall back to `Wheel.itemBackgroundColors`.</p><p>Example: `'#fff'`.
`image` | `null` | The image (HTMLImageElement) to draw on the item.</p><p>Any part of the image that extends outside the item will be clipped. The image will be drawn over the top of `Item.backgroundColor`.
`image` | `null` | The [HTMLImageElement](https://developer.mozilla.org/en-US/docs/Web/API/HTMLImageElement) to draw on the item.</p><p>Any part of the image that extends outside the item will be clipped. The image will be drawn over the top of `Item.backgroundColor`.
`imageOpacity` | `1` | The opacity (as a percent) of `Item.image`.</p><p>Useful if you want to fade the image to make the item's label stand out.
`imageRadius` | `0.5` | The point along the wheel's radius (as a percent, starting from the center) to draw the center of `Item.image`.
`imageRotation` | `0` | The rotation (angle in degrees) of `Item.image`.
Expand Down
4 changes: 2 additions & 2 deletions dist/spin-wheel-esm.js

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions dist/spin-wheel-iife.js

Large diffs are not rendered by default.

Loading

0 comments on commit 819c1c1

Please sign in to comment.