@daybrush/utils
Advanced tools
Comparing version 0.0.1 to 0.0.2
{ | ||
"name": "@daybrush/utils", | ||
"version": "0.0.1", | ||
"version": "0.0.2", | ||
"description": "utils for daybrush", | ||
@@ -5,0 +5,0 @@ "main": "dist/utils.js", |
@@ -1,60 +0,32 @@ | ||
# shape-poly [![npm version](https://badge.fury.io/js/shape-poly.svg)](https://badge.fury.io/js/shape-poly) | ||
# @daybrush/utils [![npm version](https://badge.fury.io/js/%40daybrush$2Futils.svg)](https://badge.fury.io/js/%40daybrush$2Futils) | ||
![](./polygon.png) | ||
Make CSS Polygon Shape | ||
utils for daybrush | ||
* [Polygons & Stars Demo](https://codepen.io/daybrush/pen/qJoagW) | ||
### consts | ||
* RGB | ||
* RGBA | ||
* HSL | ||
* HSLA | ||
* TRANSFORM | ||
* FILTER | ||
* ANIMATION | ||
* KEYFRAMES | ||
```sh | ||
$ npm install shape-poly | ||
``` | ||
## Options | ||
```ts | ||
import {poly, be, dom} from "shape-poly"; | ||
interface PolyInterface { | ||
side?: number; | ||
split?: number; | ||
strokeWidth: number | string; | ||
className?: string; | ||
starRadius?: number; // inner-radius(0 ~ 100%) | ||
container?: HTMLElement; | ||
direction?: DIRECTION; | ||
stroke?: string; // color | ||
} | ||
function poly(options: PolyInterface); | ||
function dom(el: HTMLElement); | ||
function be(el: HTMLElement, options: PolyInterface); | ||
``` | ||
## How to Use | ||
```html | ||
<script src="//daybrush.github.io/shape-poly/release/latest/shapepoly.min.js"></script> | ||
``` | ||
```html | ||
<div class="triangle" data-side="5" data-stroke-width="11px" style="width: 100px"></div> | ||
``` | ||
```js | ||
import {poly, be, dom} from "shape-poly"; | ||
// 10 star | ||
const el = poly({starRadius: 50, side: 10, strokeWidth: "5px"}); | ||
document.body.appendChild(el); | ||
// change 10 star to 5 polygon | ||
be(el, {side: 5, strokeWidth: "5px"}) | ||
// data-side | ||
// data-star-radius | ||
// data-stroke-width | ||
// data-stroke | ||
// data-fill | ||
// data-direction | ||
dom(document.querySelector(".triangle")); | ||
``` | ||
### functions | ||
* splitUnit | ||
* splitComma | ||
* splitSpace | ||
* hexToRGBA | ||
* hex3to6 | ||
* hslToRGBA | ||
* isUndefined | ||
* isObject | ||
* isArray | ||
* isString | ||
* camelize, | ||
* decamelize, | ||
* hasClass | ||
* removeClass, | ||
* addClass, | ||
* fromCSS, |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
63976
22
32