-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
60 additions
and
2 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"presets": ["es2015"] | ||
} |
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,4 @@ | ||
.DS_Store | ||
/lib | ||
/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
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 |
---|---|---|
@@ -1 +1,3 @@ | ||
# core | ||
# AnimakitCore | ||
Part of Animakit. | ||
See http://askd.github.io/animakit for more details |
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,23 @@ | ||
{ | ||
"name": "animakit-core", | ||
"version": "1.0.0", | ||
"description": "Animakit core. Not for self-use.", | ||
"main": "lib/index.js", | ||
"scripts": { | ||
"build": "babel --preset es2015 src/ --out-dir lib/", | ||
"prepublish": "npm run build" | ||
}, | ||
"author": "Anna Selezniova", | ||
"license": "MIT", | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/animakit/animakit-core" | ||
}, | ||
"dependencies": { | ||
"lodash": "^4.11.1" | ||
}, | ||
"devDependencies": { | ||
"babel-cli": "^6.7.7", | ||
"babel-preset-es2015": "^6.6.0" | ||
} | ||
} |
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,26 @@ | ||
import { isEqual as lodashIsEqual } from 'lodash'; | ||
|
||
export function isPropertySupported(name, value) { | ||
const propName = name; | ||
|
||
const element = document.createElement('p'); | ||
document.body.insertBefore(element, null); | ||
|
||
element.style[propName] = value; | ||
|
||
const propValue = window | ||
.getComputedStyle(element, null) | ||
.getPropertyValue(propName); | ||
|
||
document.body.removeChild(element); | ||
|
||
return propValue === value; | ||
} | ||
|
||
export function genUniqueString(len = 5) { | ||
return (Math.random() * Math.pow(36, len) << 0).toString(36); | ||
} | ||
|
||
export function isEqual(prevState, nextState) { | ||
return lodashIsEqual(prevState, nextState); | ||
} |