Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: create shape from existing DOM nodes
Closes #8.
- Loading branch information
1 parent
e398777
commit 83a1437
Showing
10 changed files
with
184 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
client.dist.js | ||
node_modules/ | ||
npm-debug.log |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
# Wilderness multi example | ||
|
||
## Usage | ||
|
||
``` | ||
npm install | ||
npm run build | ||
``` | ||
|
||
Then open `index.html` in your browser. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import { shape, render, play } from '../../src'; | ||
|
||
const animation = shape( | ||
{ selector: '.positionA' }, | ||
{ selector: '.positionB', duration: 800, reverse: true }, | ||
{ selector: '.positionC', duration: 1200, reverse: true, moveIndex: 2 }, | ||
{ selector: '.positionD', duration: 2000, reverse: true, easing: 'easeOutElastic' }, | ||
{ selector: '.positionA', duration: 3000, easing: 'easeInElastic' } | ||
); | ||
|
||
render({ selector: '.svg' }, animation ); | ||
|
||
play( animation, { | ||
alternate: true, | ||
iterations: Infinity, | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<title>Wilderness multi example</title> | ||
<style> | ||
html, | ||
body { | ||
height: 100%; | ||
} | ||
|
||
body { | ||
margin: 0; | ||
} | ||
|
||
.svg { | ||
height: 100%; | ||
width: 100%; | ||
} | ||
|
||
.hide { | ||
display: none; | ||
} | ||
</style> | ||
</head> | ||
<body> | ||
<svg | ||
class="svg" | ||
height="100" | ||
preserveAspectRatio="xMidYMid meet" | ||
viewBox="0 0 100 100" | ||
width="100" | ||
> | ||
<circle class="positionA" cx="70" cy="80" r="10" fill="#E54"></circle> | ||
<rect class="positionB hide" x="10" y="10" width="50" height="30" fill="#0FA"></rect> | ||
<path class="positionC hide" d="M25,55l20,15h-30z" fill="#E54"></path> | ||
<path class="positionD hide" d="M70,35h10l5,-5,5,5v10l5,5-5,5h-10l-5,5,-5,-5v-10l-5,-5z" fill="#0FA"></path> | ||
</svg> | ||
<script src="./client.dist.js"></script> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
{ | ||
"author": { | ||
"name": "Colin Meinke", | ||
"email": "hello@colinmeinke.com", | ||
"url": "www.colinmeinke.com" | ||
}, | ||
"babel": { | ||
"plugins": [ | ||
"transform-object-rest-spread" | ||
], | ||
"presets": [ | ||
"es2015" | ||
] | ||
}, | ||
"bugs": { | ||
"url": "https://github.com/colinmeinke/wilderness/issues" | ||
}, | ||
"description": "Wilderness multi example", | ||
"devDependencies": { | ||
"babel-plugin-transform-object-rest-spread": "^6.8.0", | ||
"babel-preset-es2015": "^6.9.0", | ||
"babelify": "^7.3.0", | ||
"browserify": "^13.0.1" | ||
}, | ||
"license": "ISC", | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/colinmeinke/wilderness.git" | ||
}, | ||
"scripts": { | ||
"build": "browserify ./client.js -o ./client.dist.js -t babelify" | ||
}, | ||
"version": "0.0.0-semantically-released" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters