shape-poly
Make CSS Polygon Shape
Last updated 10 months ago by younkue .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install shape-poly 
SYNC missed versions from official npm registry.

shape-poly npm version

Make CSS Polygon Shape

$ npm install shape-poly

Options

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

<script src="//daybrush.github.io/shape-poly/release/latest/shapepoly.min.js"></script>
<div class="triangle" data-side="5" data-stroke-width="11px" style="width: 100px"></div>
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"));

Current Tags

  • 0.0.9                                ...           latest (10 months ago)

9 Versions

  • 0.0.9                                ...           10 months ago
  • 0.0.8                                ...           10 months ago
  • 0.0.7                                ...           10 months ago
  • 0.0.6                                ...           10 months ago
  • 0.0.5                                ...           10 months ago
  • 0.0.4                                ...           10 months ago
  • 0.0.3                                ...           10 months ago
  • 0.0.2                                ...           10 months ago
  • 0.0.1                                ...           10 months ago
Maintainers (1)
Downloads
Today 9
This Week 9
This Month 10
Last Day 0
Last Week 1
Last Month 0
Dependencies (0)
None
Dev Dependencies (9)
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |