Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

ani-clipath

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ani-clipath

js to create css clip-path animation

  • 0.0.8
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
decreased by-100%
Maintainers
1
Weekly downloads
 
Created
Source

For creating clip-path animation, Live Demo

Install

CDN
<script src="https://unpkg.com/ani-clipath/dist/ani-clipath.min.js">
NPM
npm install --save ani-clipath

Usage

Need a container with width and height

<style>
  .shapes{
    width: 800px;
    height: 600px;
  }
</style>
...
<div class="shapes"></div>
Props
PropertytypeDescriptiondefault
elStringDOM containerempty
speedNumberAnimation speed of each triangle1500
delayNumberAnimation delay of each triangle30
autoplayNumberPlay automaticallytrue
autoplayIntervalNumberIntervals of autoplay5000
shapesArrayData of shapesArray
Methods
MethodDescription
next()Switch to next shape
previous()Switch to previous shape
<script>
  var aniClipath = new AniClipath({
    el: '.shapes',
    speed: 1000,
    delay: 30,
    autoplay: true,
    autoplayInterval: 5000,
    shapes: data
  })
  setInterval(function(){
    aniClipath.next()
  },3000)
</script>

Data format of shapes

var data = [
  [
    // item of shapes
    { 
      // color of item
      c: '#1A1A1A',
      // polygon position of item
      p: [ { x: '50%', y: '30%' }, { x: '30%', y: '70%' }, { x: '70%', y: '70%' }]
    }
  ],
  [
    {
      c: '#E6E6E6',
      p: [ { x: '50%', y: '70%' }, { x: '30%', y: '30%' }, { x: '70%', y: '30%' }]
    }
  ]
]

License

MIT

Keywords

FAQs

Package last updated on 13 Oct 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc