Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update project structure using the generator-element template
- Loading branch information
Zeno Rocha
committed
Jun 29, 2014
1 parent
3665181
commit e9279ae
Showing
9 changed files
with
349 additions
and
125 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 |
---|---|---|
@@ -1,11 +1,19 @@ | ||
# This file is for unifying the coding style for different editors and IDEs | ||
# editorconfig.org | ||
# EditorConfig helps developers define and maintain consistent | ||
# coding styles between different editors and IDEs | ||
# http://editorconfig.org | ||
|
||
root = true | ||
|
||
[*] | ||
indent_style = tab | ||
# Change these settings to your own preference | ||
indent_style = space | ||
indent_size = 4 | ||
|
||
# We recommend you to keep these unchanged | ||
end_of_line = lf | ||
charset = utf-8 | ||
trim_trailing_whitespace = true | ||
trim_trailing_whitespace = true | ||
insert_final_newline = true | ||
|
||
[*.md] | ||
trim_trailing_whitespace = false |
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,2 @@ | ||
bower_components/ | ||
node_modules/ |
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,42 @@ | ||
module.exports = function(grunt) { | ||
|
||
grunt.initConfig({ | ||
'connect': { | ||
demo: { | ||
options: { | ||
open: true, | ||
keepalive: true | ||
} | ||
} | ||
}, | ||
'gh-pages': { | ||
options: { | ||
clone: 'bower_components/video-camera-element' | ||
}, | ||
src: [ | ||
'bower_components/**/*', | ||
'!bower_components/video-camera-element/**/*', | ||
'demo/*', 'src/*', 'index.html' | ||
] | ||
}, | ||
'replace': { | ||
example: { | ||
src: ['src/*'], | ||
dest: 'dist/', | ||
replacements: [{ | ||
from: 'bower_components', | ||
to: '..' | ||
}] | ||
} | ||
} | ||
}); | ||
|
||
grunt.loadNpmTasks('grunt-contrib-connect'); | ||
grunt.loadNpmTasks('grunt-gh-pages'); | ||
grunt.loadNpmTasks('grunt-text-replace'); | ||
|
||
grunt.registerTask('build', ['replace']); | ||
grunt.registerTask('deploy', ['gh-pages']); | ||
grunt.registerTask('server', ['connect']); | ||
|
||
}; |
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,19 @@ | ||
{ | ||
"name": "video-camera-element", | ||
"version": "0.1.2", | ||
"description": "Web Component wrapper for getUserMedia API using Polymer", | ||
"license": "MIT", | ||
"main": "dist/video-camera.html", | ||
"keywords": [ | ||
"polymer", | ||
"web-components" | ||
], | ||
"ignore": [ | ||
"**/.*", | ||
"node_modules", | ||
"bower_components" | ||
], | ||
"dependencies": { | ||
"polymer": "Polymer/polymer#~0.3.3" | ||
} | ||
} |
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,102 @@ | ||
<!-- Import Polymer --> | ||
<link rel="import" href="../../polymer/polymer.html"> | ||
|
||
<!-- Define your custom element --> | ||
<polymer-element name="video-camera" extends="video" attributes="audio filter"> | ||
<script> | ||
Polymer('video-camera', { | ||
audio: false, | ||
|
||
created: function() { | ||
if (!window.URL) { | ||
window.URL = window.URL || window.webkitURL || window.msURL || window.oURL; | ||
} | ||
|
||
if (!navigator.getUserMedia) { | ||
navigator.getUserMedia = navigator.getUserMedia || navigator.webkitGetUserMedia || navigator.mozGetUserMedia || navigator.msGetUserMedia; | ||
} | ||
}, | ||
|
||
ready: function() { | ||
var that = this; | ||
|
||
navigator.getUserMedia({ | ||
audio: that.audio, | ||
video: true | ||
}, | ||
function(stream) { | ||
that.src = window.URL.createObjectURL(stream); | ||
}, | ||
function(err) { | ||
throw Error(err); | ||
}); | ||
}, | ||
|
||
filterChanged: function(oldVal) { | ||
var filter = this.filter; | ||
|
||
this.classList.remove(oldVal); | ||
this.classList.add(filter); | ||
} | ||
}); | ||
</script> | ||
|
||
<style> | ||
.blur { | ||
-webkit-filter: blur(3px); | ||
-moz-filter: blur(3px); | ||
-ms-filter: blur(3px); | ||
-o-filter: blur(3px); | ||
filter: blur(3px); | ||
} | ||
.brightness { | ||
-webkit-filter: brightness(5); | ||
-moz-filter: brightness(5); | ||
-ms-filter: brightness(5); | ||
-o-filter: brightness(5); | ||
filter: brightness(5); | ||
} | ||
.contrast { | ||
-webkit-filter: contrast(8); | ||
-moz-filter: contrast(8); | ||
-ms-filter: contrast(8); | ||
-o-filter: contrast(8); | ||
filter: contrast(8); | ||
} | ||
.hue-rotate { | ||
-webkit-filter: hue-rotate(90deg); | ||
-moz-filter: hue-rotate(90deg); | ||
-ms-filter: hue-rotate(90deg); | ||
-o-filter: hue-rotate(90deg); | ||
filter: hue-rotate(90deg); | ||
} | ||
.saturate { | ||
-webkit-filter: saturate(10); | ||
-moz-filter: saturate(10); | ||
-ms-filter: saturate(10); | ||
-o-filter: saturate(10); | ||
filter: saturate(10); | ||
} | ||
.grayscale { | ||
-webkit-filter: grayscale(1); | ||
-moz-filter: grayscale(1); | ||
-ms-filter: grayscale(1); | ||
-o-filter: grayscale(1); | ||
filter: grayscale(1); | ||
} | ||
.sepia { | ||
-webkit-filter: sepia(1); | ||
-moz-filter: sepia(1); | ||
-ms-filter: sepia(1); | ||
-o-filter: sepia(1); | ||
filter: sepia(1); | ||
} | ||
.invert { | ||
-webkit-filter: invert(1); | ||
-moz-filter: invert(1); | ||
-ms-filter: invert(1); | ||
-o-filter: invert(1); | ||
filter: invert(1); | ||
} | ||
</style> | ||
</polymer-element> |
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,19 +1,19 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<meta charset="UTF-8"> | ||
<title><video-camera></title> | ||
<meta charset="UTF-8"> | ||
<title><video-camera-element></title> | ||
|
||
<!-- Importing Web Component's Polyfill --> | ||
<script src="//cdnjs.cloudflare.com/ajax/libs/polymer/0.0.20130816/polymer.min.js"></script> | ||
<!-- Importing Web Component's Polyfill --> | ||
<script src="bower_components/platform/platform.js"></script> | ||
|
||
<!-- Importing Custom Elements --> | ||
<link rel="import" href="src/video-camera.html"> | ||
<!-- Importing Custom Elements --> | ||
<link rel="import" href="src/video-camera.html"> | ||
</head> | ||
<body> | ||
|
||
<!-- Using Custom Elements --> | ||
<video is="video-camera" audio autoplay controls></video> | ||
<!-- Using Custom Elements --> | ||
<video is="video-camera" autoplay></video> | ||
|
||
</body> | ||
</html> | ||
</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,10 @@ | ||
{ | ||
"private": true, | ||
"devDependencies": { | ||
"grunt": "~0.4.1", | ||
"grunt-cli": "~0.1.9", | ||
"grunt-contrib-connect": "~0.8.0", | ||
"grunt-gh-pages": "~0.9.1", | ||
"grunt-text-replace": "~0.3.11" | ||
} | ||
} |
Oops, something went wrong.