implement pinch to zoom
This commit is contained in:
+7
@@ -0,0 +1,7 @@
|
||||
webpack:
|
||||
@webpack-dev-server 'mocha!./test/test.js' --hot --inline
|
||||
|
||||
test:
|
||||
@karma start
|
||||
|
||||
.PHONY: test
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
# transition-property
|
||||
|
||||
## Install
|
||||
|
||||
npm i transition-property -S
|
||||
|
||||
## Usage
|
||||
|
||||
``` js
|
||||
var transitionProperty = require('transition-property')
|
||||
el.style[transitionProperty] = '100ms -webkit-transform linear'
|
||||
```
|
||||
+20
@@ -0,0 +1,20 @@
|
||||
var styles = [
|
||||
'webkitTransition',
|
||||
'MozTransition',
|
||||
'OTransition',
|
||||
'msTransition',
|
||||
'transition'
|
||||
]
|
||||
|
||||
var el = document.createElement('p')
|
||||
var style
|
||||
|
||||
for (var i = 0; i < styles.length; i++) {
|
||||
if (null != el.style[styles[i]]) {
|
||||
style = styles[i]
|
||||
break
|
||||
}
|
||||
}
|
||||
el = null
|
||||
|
||||
module.exports = style
|
||||
+73
@@ -0,0 +1,73 @@
|
||||
// Karma configuration
|
||||
// npm i karma karma-cli karma-firefox-launcher karma-mocha karma-webpack karma-wrap-preprocessor mocha --save-dev
|
||||
// node_modules/.bin/karma start --single-run
|
||||
module.exports = function(config) {
|
||||
config.set({
|
||||
|
||||
// base path that will be used to resolve all patterns (eg. files, exclude)
|
||||
basePath: '',
|
||||
|
||||
|
||||
// frameworks to use
|
||||
// available frameworks: https://npmjs.org/browse/keyword/karma-adapter
|
||||
frameworks: ['mocha'],
|
||||
|
||||
|
||||
// list of files / patterns to load in the browser
|
||||
files: [
|
||||
'test/test.js'
|
||||
],
|
||||
|
||||
// list of files to exclude
|
||||
exclude: [
|
||||
],
|
||||
|
||||
// preprocess matching files before serving them to the browser
|
||||
// available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor
|
||||
preprocessors: {
|
||||
'test/test.js': ['webpack']
|
||||
},
|
||||
|
||||
// test results reporter to use
|
||||
// possible values: 'dots', 'progress'
|
||||
// available reporters: https://npmjs.org/browse/keyword/karma-reporter
|
||||
reporters: ['progress'],
|
||||
|
||||
|
||||
// web server port
|
||||
port: 9876,
|
||||
|
||||
|
||||
// enable / disable colors in the output (reporters and logs)
|
||||
colors: true,
|
||||
|
||||
|
||||
// level of logging
|
||||
// possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG
|
||||
logLevel: config.LOG_INFO,
|
||||
|
||||
|
||||
// enable / disable watching file and executing tests whenever any file changes
|
||||
autoWatch: true,
|
||||
|
||||
webpack: {
|
||||
module: {
|
||||
loaders: [
|
||||
{test: /\.html$/, loader: 'html'}
|
||||
]
|
||||
}
|
||||
},
|
||||
|
||||
// start these browsers
|
||||
// available browser launchers: https://npmjs.org/browse/keyword/karma-launcher
|
||||
browsers: ['Firefox'],
|
||||
|
||||
webpackMiddleware: {
|
||||
noInfo: true
|
||||
},
|
||||
// Continuous Integration mode
|
||||
// if true, Karma captures browsers, runs the tests and exits
|
||||
singleRun: true
|
||||
});
|
||||
};
|
||||
|
||||
+32
@@ -0,0 +1,32 @@
|
||||
{
|
||||
"name": "transition-property",
|
||||
"version": "1.0.1",
|
||||
"description": "transition property detect",
|
||||
"main": "index.js",
|
||||
"directories": {
|
||||
"test": "test"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "make test"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+ssh://git@github.com/chemzqm/transition-property.git"
|
||||
},
|
||||
"keywords": [
|
||||
"transition",
|
||||
"property"
|
||||
],
|
||||
"author": "chemzqm@gmail.com",
|
||||
"license": "MIT",
|
||||
"bugs": {
|
||||
"url": "https://github.com/chemzqm/transition-property/issues"
|
||||
},
|
||||
"homepage": "https://github.com/chemzqm/transition-property#readme",
|
||||
"devDependencies": {
|
||||
"mocha": "^2.3.3",
|
||||
"mocha-loader": "^0.7.1",
|
||||
"webpack": "^1.12.3",
|
||||
"webpack-dev-server": "^1.12.1"
|
||||
}
|
||||
}
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
/*global describe, it*/
|
||||
var assert = require('assert')
|
||||
var prop = require('..')
|
||||
|
||||
describe('transition-property', function() {
|
||||
it('should be transition', function () {
|
||||
assert.equal(/transition/.test(prop))
|
||||
})
|
||||
})
|
||||
Reference in New Issue
Block a user