-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Detail |-- Added standard repository files using slush generator
- Loading branch information
Showing
8 changed files
with
263 additions
and
0 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,19 @@ | ||
# EditorConfig helps developers define and maintain consistent | ||
# coding styles between different editors and IDEs | ||
# http://editorconfig.org | ||
|
||
root = true | ||
|
||
[*] | ||
# 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 | ||
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,3 @@ | ||
bower_components/ | ||
node_modules/ | ||
.tmp/ |
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,105 @@ | ||
# <x-carousel> | ||
|
||
> My awesome Custom Element | ||
## Demo | ||
|
||
[Check it live!](http://Nevraeka.github.io/x-carousel) | ||
|
||
## Install | ||
|
||
Install the component using [Bower](http://bower.io/): | ||
|
||
```sh | ||
$ bower install x-carousel --save | ||
``` | ||
|
||
Or [download as ZIP](https://github.com/Nevraeka/x-carousel/archive/master.zip). | ||
|
||
## Usage | ||
|
||
1. Import Web Components' polyfill: | ||
|
||
```html | ||
<script src="bower_components/webcomponentsjs/webcomponents.min.js"></script> | ||
``` | ||
|
||
2. Import Custom Element: | ||
|
||
```html | ||
<link rel="import" href="bower_components/x-carousel/dist/x-carousel.html"> | ||
``` | ||
|
||
3. Start using it! | ||
|
||
```html | ||
<x-carousel></x-carousel> | ||
``` | ||
|
||
## Options | ||
|
||
Attribute | Options | Default | Description | ||
--- | --- | --- | --- | ||
`foo` | *string* | `bar` | Lorem ipsum dolor. | ||
|
||
## Methods | ||
|
||
Method | Parameters | Returns | Description | ||
--- | --- | --- | --- | ||
`unicorn()` | None. | Nothing. | Magic stuff appears. | ||
|
||
## Events | ||
|
||
Event | Description | ||
--- | --- | ||
`onsomething` | Triggers when something happens. | ||
|
||
## Development | ||
|
||
In order to run it locally you'll need to fetch some dependencies and a basic server setup. | ||
|
||
* Install [Bower](http://bower.io/) & [Gulp](http://gulpjs.com/): | ||
|
||
```sh | ||
$ [sudo] npm install -g bower gulp | ||
``` | ||
|
||
* Install local dependencies: | ||
|
||
```sh | ||
$ bower install && npm install | ||
``` | ||
|
||
* To test your project, start the development server and open `http://localhost:8000`. | ||
|
||
```sh | ||
$ gulp server | ||
``` | ||
|
||
* To build the distribution files before releasing a new version. | ||
|
||
```sh | ||
$ gulp build | ||
``` | ||
|
||
* To provide a live demo, send everything to `gh-pages` branch. | ||
|
||
```sh | ||
$ gulp deploy | ||
``` | ||
|
||
## Contributing | ||
|
||
1. Fork it! | ||
2. Create your feature branch: `git checkout -b my-new-feature` | ||
3. Commit your changes: `git commit -m 'Add some feature'` | ||
4. Push to the branch: `git push origin my-new-feature` | ||
5. Submit a pull request :D | ||
|
||
## History | ||
|
||
For detailed changelog, check [Releases](https://github.com/Nevraeka/x-carousel/releases). | ||
|
||
## License | ||
|
||
[MIT License](http://opensource.org/licenses/MIT) |
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,20 @@ | ||
{ | ||
"name": "x-carousel", | ||
"version": "0.0.0", | ||
"description": "My awesome Custom Element", | ||
"license": "MIT", | ||
"main": "dist/x-carousel.html", | ||
"keywords": [ | ||
"x-tag", | ||
"web-components" | ||
], | ||
"ignore": [ | ||
"**/.*", | ||
"node_modules", | ||
"bower_components" | ||
], | ||
"dependencies": { | ||
"x-tag-core": "^1.0.0", | ||
"webcomponentsjs": "^0.5.1" | ||
} | ||
} |
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,62 @@ | ||
var gulp = require('gulp'); | ||
var connect = require('gulp-connect-multi')(); | ||
var replace = require('gulp-replace'); | ||
var ghpages = require('gh-pages'); | ||
var clean = require('gulp-clean'); | ||
var path = require('path'); | ||
|
||
var copy = function (){ | ||
gulp.src([ | ||
'bower_components/**/*', | ||
'demo/*', | ||
'src/*', | ||
'index.html' | ||
], { | ||
base: './' | ||
}) | ||
.pipe(gulp.dest('./.tmp/')); | ||
} | ||
|
||
var build = function (){ | ||
gulp.src(['src/*']) | ||
.pipe(replace(/bower_components/g, '..')) | ||
.pipe(gulp.dest('dist/')); | ||
} | ||
var ignore = function (){ | ||
gulp.src(['./.tmp/bower_components/x-carousel']) | ||
.pipe(clean()); | ||
} | ||
|
||
gulp.task('server', connect.server({ | ||
root: [__dirname], | ||
port: 8000, | ||
livereload: true | ||
})); | ||
|
||
gulp.task('build', ['beforebuild'],function(){ | ||
build() | ||
}); | ||
gulp.task('beforebuild', function(){ | ||
copy() | ||
ignore() | ||
}); | ||
|
||
gulp.task('deploy', ['beforebuild'], function () { | ||
|
||
ghpages.publish(path.join(__dirname, '.tmp/'), { | ||
clone: 'bower_components/x-carousel', | ||
logger: function(message) { | ||
console.log(message); | ||
} | ||
} , function(err) { | ||
|
||
console.log(""); | ||
if(err.errno == 34){ | ||
console.log("Error: You need run 'gulp build' before deploy your custom element in gh-pages.\n"); | ||
} else if(typeof err.errno == "undefined"){ | ||
console.log("Error: You need add a remote repository before deploy your custom element in gh-pages.\n"); | ||
} | ||
|
||
}, true); | ||
|
||
}); |
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 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<meta charset="UTF-8"> | ||
<title><x-carousel></title> | ||
|
||
<!-- Importing Web Component's Polyfill --> | ||
<script src="bower_components/webcomponentsjs/webcomponents.min.js"></script> | ||
|
||
<!-- Importing Custom Elements --> | ||
<link rel="import" href="src/x-carousel.html"> | ||
</head> | ||
<body> | ||
|
||
<!-- Using Custom Elements --> | ||
<x-carousel></x-carousel> | ||
|
||
</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,10 @@ | ||
{ | ||
"private": true, | ||
"devDependencies": { | ||
"gulp": "^3.8.7", | ||
"gulp-replace": "^0.4.0", | ||
"gulp-connect-multi": "^1.0.8", | ||
"gulp-clean": "^0.3.1", | ||
"gh-pages": "^0.2.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,25 @@ | ||
<!-- Import X-Tag --> | ||
<script src="../bower_components/x-tag-core/src/core.js"></script> | ||
|
||
<script> | ||
(function() { | ||
xtag.register('x-carousel', { | ||
lifecycle: { | ||
// Fires when an instance of the element is created | ||
created: function() {}, | ||
|
||
// Fires when an instance was inserted into the document | ||
inserted: function() {}, | ||
|
||
// Fires when an instance was removed from the document | ||
removed: function() {}, | ||
|
||
// Fires when an attribute was added, removed, or updated | ||
attributeChanged: function(attr, oldVal, newVal) {} | ||
}, | ||
events: {}, | ||
accessors: {}, | ||
methods: {} | ||
}); | ||
}()); | ||
</script> |