Skip to content

Commit

Permalink
Clean and update
Browse files Browse the repository at this point in the history
  • Loading branch information
radiium committed Nov 8, 2018
1 parent 4bfc37a commit 59c5c12
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 13 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,13 @@ then use it for add css "clip-path" rules

[https://radiium.github.io/polydiv/](https://radiium.github.io/polydiv/)


## Download:

[polydiv.js](https://raw.githubusercontent.com/radiium/polydiv/master/polydiv.js)
[polydiv.min.js](https://raw.githubusercontent.com/radiium/polydiv/master/polydiv.min.js)


## Usage:

1 - In html
Expand All @@ -35,6 +37,7 @@ then use it for add css "clip-path" rules
<script type="text/javascript" src="./polydiv.min.js"></script>
```


2 - In javascript
```javascript
// Init Polydiv
Expand All @@ -51,6 +54,7 @@ polydivInstance.unClipItems(function(err) {
});
```


## Development:

```bash
Expand Down
26 changes: 13 additions & 13 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -92,30 +92,38 @@
}
</style>

<!-- Github banner -->
<a href="https://github.com/radiium/polydiv"><img style="position: absolute; top: 0; right: 0; border: 0;" src="https://s3.amazonaws.com/github/ribbons/forkme_right_white_ffffff.png" alt="Fork me on GitHub"></a>


<div class="wrapper">

<!-- Header -->
<div class="header">
<div class="title"><a href="https://github.com/radiium/polydiv#polydiv">Polydiv</a></div>
<div class="title"><a href="https://github.com/radiium/polydiv">Polydiv</a></div>
<div class="description">Clipping html element in random polygon with the css 'clip-path' rule.</div>
<div class="description">
<a href="https://github.com/radiium/polydiv#polydiv">Documentation</a>
</div>
<div class="description"><a href="https://github.com/radiium/polydiv#polydiv">Documentation</a></div>
</div>

<!-- Control buttons demo -->
<div class="control">
<button onclick="randomize()">Random clip</button>
<button onclick="remove()">Remove clip</button>
</div>

<!-- Items -->
<div class="polydivContainer"></div>

</div>

<!-- Import polydiv -->
<script type="text/javascript" src="./polydiv.min.js"></script>

<!-- Demo scrpt -->
<script type="text/javascript">

var callback = function() { console.log('Done'); }

// Generate and add items to the DOM
function appendPolydivItems(n) {
var container = document.getElementsByClassName('polydivContainer')[0];
for (var i = 0; i < n + 1; i++) {
Expand All @@ -131,19 +139,11 @@

}
}

appendPolydivItems(12)


// Create and init polydiv instance
var polys = new Polydiv({ itemClass: 'poylidivItem'});
console.log('polydiv instance:');
console.log(polys);


var callback = function() {
console.log('Done');
}

// Clip items
var randomize = function() {
Expand Down

0 comments on commit 59c5c12

Please sign in to comment.