Skip to content

Commit d349097

Browse files
committed
first commit
0 parents  commit d349097

24 files changed

+505
-0
lines changed

.gitignore

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
.idea/
2+
.sass-cache/
3+
.tmp/
4+
tmp/
5+
_site/
6+
node_modules/
7+
bower_components/
8+
npm-debug.log
9+
test/coverage
10+
*.iml

.jshintrc

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"undef": true,
3+
"expr": true,
4+
"globals": {
5+
"console": true,
6+
"require": true,
7+
"module": true,
8+
"process": true,
9+
"setTimeout": true,
10+
"Buffer": true,
11+
"window": true,
12+
"define": true,
13+
"document": true
14+
}
15+
}

CHANGELOG.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Change Log
2+
3+
## 0.0.1
4+
5+
* Created

CONTRIBUTING.md

+42
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
# Contributing
2+
3+
Like most open source projects, we ask that you fork the project and issue a [pull request](#pull-requests) with your changes.
4+
5+
We encourage small change pull requests, the smaller the change the quicker and easier it is merged.
6+
7+
## Dependencies
8+
9+
To build the component locally, you'll need to install these globally :
10+
* [node.js](http://nodejs.org)
11+
* [Bower](http://bower.io)
12+
13+
## Workflow
14+
15+
1. Fork the project
16+
2. Clone your fork
17+
`git clone {{ git.SSH-URL }}`
18+
3. Setup your 'upstream'
19+
`git remote add upstream {{ git.HTTPS-URL }}`
20+
4. Create a topic branch to contain your change
21+
`git checkout -b feature-my-feature`
22+
5. Make sure [CHANGELOG.md](./CHANGELOG.md) includes a summary of your changes in a new version number heading
23+
6. Make sure you are still up to date with master
24+
`git pull upstream master`
25+
7. If necessary, rebase your commits into logical chunks, without errors.
26+
8. Push the branch up
27+
`git push origin my-awesome-feature`
28+
9. Create a pull request and describe what your change does and the why you think it should be merged.
29+
30+
## Running Locally
31+
32+
* `npm start` : Run server on port 3456
33+
* `npm test` : Run the tests once and produce a code coverage report
34+
35+
## Working with dependencies
36+
37+
If you want to make changes to the bower dependencies:
38+
39+
* `cd some-bower-dependency/`
40+
* `bower link`
41+
* `cd gradients/`
42+
* `bower link some-bower-dependency`

LICENSE.md

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
Copyright (c) 2015
2+
All rights reserved.
3+
4+
Redistribution and use in source and binary forms, with or without
5+
modification, are permitted provided that the following conditions are met:
6+
* Redistributions of source code must retain the above copyright
7+
notice, this list of conditions and the following disclaimer.
8+
* Redistributions in binary form must reproduce the above copyright
9+
notice, this list of conditions and the following disclaimer in the
10+
documentation and/or other materials provided with the distribution.
11+
* Neither the name of the <organization> nor the
12+
names of its contributors may be used to endorse or promote products
13+
derived from this software without specific prior written permission.
14+
15+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
16+
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
17+
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
18+
DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY
19+
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
20+
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
21+
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
22+
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
23+
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
24+
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

README.md

+49
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
[Gradients]({{ git.io-URL }}) [![Circle CI](https://circleci.com/gh/{{ git.username }}/gradients/tree/master.svg?style=svg)](https://circleci.com/gh/{{ git.username }}/gradients/tree/master)
2+
========================
3+
4+
> Please take a look at the [demo page]({{ git.io-URL }})
5+
6+
## Quick-Start
7+
8+
Include the Gradients assets in your project either as **Static Resources**
9+
10+
```html
11+
<link rel="stylesheet" href="http:// WEB ADDRESS /gradients/0.0.1/styles/gradients.min.css" />
12+
<script type="text/javascript" src="http:// WEB ADDRESS /gradients/0.0.1/scripts/gradients.min.js"></script>
13+
```
14+
15+
or alternatively, **Via Bower**
16+
17+
* Run: `bower install --save-dev gradients`
18+
* Include Sass: `@import 'bower_components/gradients/src/styles/gradients';`
19+
* Include JS: `var gradients = require('../../bower_components/gradients/src/scripts/gradients');`
20+
21+
22+
#### Dependencies
23+
24+
This component relies on other components and you must also include these in your project.
25+
26+
* [Dependency Name](https://github.com/DependencyName)
27+
28+
#### Developer Notes
29+
30+
Choose a type of Gradients component and copy the relevant html.
31+
* [example](demo/_includes/example.html)
32+
* [example](demo/_includes/example.html),
33+
34+
## Contribution
35+
36+
Components depends on collaboration between developers. Contributions of any size are actively encouraged.
37+
38+
To see how to build this component locally, read the [contribution guidelines](CONTRIBUTING.md).
39+
40+
## Browser Support
41+
42+
(To support IE8 please add [ployfill](https://github.com/skyglobal/polyfill) to your site)
43+
44+
* IE9 +
45+
* Safari 7 +
46+
* Latest Firefox
47+
* Latest Chrome
48+
* Latest Mobile Safari
49+
* Latest Mobile Chrome

bower.json

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
{
2+
"name": "gradients",
3+
"homepage": "{{ git.HTTPS-URL }}",
4+
"authors": [
5+
"{{ git.author }} <{{ git.email }}>"
6+
],
7+
"description": "Gradients",
8+
"main": "dist",
9+
"license": "BSD3",
10+
"ignore": [
11+
"**/*",
12+
"!dist/**/*",
13+
"!src/**/*"
14+
],
15+
"devDependencies": {
16+
"bskyb-core": "~0.0.4"
17+
}
18+
}

caddy.config.js

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
var pkg = require('./package.json');
2+
3+
module.exports = {
4+
pkg: pkg,
5+
paths: {
6+
source: "./src",
7+
"demo": "./demo",
8+
"target": './_site'
9+
},
10+
tasks : {
11+
copy: ['fonts', 'images', 'server-config'],
12+
build: ['sass', 'mustache', 'browserify'],
13+
serve: 'staticApp',
14+
test: 'karma',
15+
release: ['git', 'gh-pages']
16+
},
17+
karma:{
18+
functional: './test/karma.functional.js',
19+
unit: './test/karma.unit.js',
20+
unitCoverage: './test/coverage/summary.json'
21+
}
22+
};

circle.yml

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
test:
2+
pre:
3+
- bower i
4+
post:
5+
- git config --global user.name "circleci"
6+
- git config --global user.email "{{ git.email }}"
7+
general:
8+
artifacts:
9+
- test/coverage
10+
deployment:
11+
production:
12+
branch: master
13+
commands:
14+
- ./node_modules/web-caddy/bin/caddy release
15+
machine:
16+
timezone:
17+
Europe/London
18+
node:
19+
version: v0.10.33

demo/_includes/example1.html

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<h2>Example 1</h2>
2+
3+
Break up the example files if they become too large!
4+
5+
<div id="demo-functional"></div>

demo/images/GitHub-Mark-32px.png

2.32 KB
Loading

demo/index.mustache

+37
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
<!DOCTYPE html>
2+
<!--To put correct ie classes on document root to essentially enable css conditionals-->
3+
<!--[if IE 7]> <html class="lt-ie10 lt-ie9 lt-ie8" > <![endif]-->
4+
<!--[if IE 8]> <html class="lt-ie10 lt-ie9" > <![endif]-->
5+
<!--[if IE 9]> <html class="lt-ie10" > <![endif]-->
6+
<!--[if gt IE 9]><!--> <html lang="en" > <!--<![endif]-->
7+
<!--end css conditionals-->
8+
<head lang="en">
9+
<meta charset="UTF-8"/>
10+
<title>Gradients</title>
11+
12+
<link rel="stylesheet" href="styles/demo.css"/>
13+
<link rel="stylesheet" href="styles/gradients.css"/>
14+
<script type="text/javascript" src="scripts/vendor.js"></script>
15+
<script type="text/javascript" src="scripts/demo.js"></script>
16+
<script type="text/javascript" src="scripts/gradients.js"></script>
17+
</head>
18+
<body>
19+
20+
<div class="demo-container">
21+
<h1>Gradients
22+
<small class="demo-version text--secondary">v{{ version }}
23+
<a href="{{ git.HTTPS-URL }}" class="text--secondary">
24+
<span class="demo-icon demo-icon--github" aria-hidden=true></span>
25+
<span class="speak">Github Repo</span>
26+
</a></small>
27+
</h1>
28+
29+
<p>
30+
Demo project here!
31+
</p>
32+
</div>
33+
34+
35+
<div class="demo-container">
36+
{{> _includes/**/*.html }}
37+
</div>

demo/scripts/demo.js

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
//if you need to intialise anything to get the demo to work...
2+
var local = {}; local['gradients'] = require('../../src/scripts/gradients.js');

demo/styles/_base.scss

+59
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
@import 'bower_components/bskyb-core/src/styles/core';
2+
3+
/* Common demo Sass here */
4+
.demo-container {
5+
width: 94.059%;
6+
max-width: 1140px;
7+
margin: 0 auto;
8+
clear: left;
9+
overflow: visible; }
10+
11+
.demo-updated {
12+
display: block;
13+
font-size: 0.3em;
14+
}
15+
.demo-block{
16+
margin-bottom: 20px;
17+
display: block;
18+
clear: both;
19+
}
20+
.demo-version{
21+
font-size: 0.5em;
22+
}
23+
.demo-icon{
24+
display: inline-block;
25+
width: 20px;
26+
height: 20px
27+
}
28+
.demo-icon--github{
29+
background: url(../images/GitHub-Mark-32px.png) no-repeat 0px 0px;
30+
background-size: 100%;
31+
}
32+
33+
.speak {
34+
position: absolute !important;
35+
clip: rect(1px, 1px, 1px, 1px);
36+
clip: rect(1px 1px 1px 1px);
37+
padding: 0;
38+
border: 0;
39+
height: 1px;
40+
width: 1px;
41+
overflow: hidden;
42+
display: block;
43+
}
44+
45+
body {
46+
margin: 0;
47+
padding: 0;
48+
}
49+
50+
code{
51+
font: 12px Consolas, "Liberation Mono", Menlo, Courier, monospace;
52+
padding: 0;
53+
padding-top: 0.2em;
54+
padding-bottom: 0.2em;
55+
margin: 0;
56+
font-size: 85%;
57+
background-color: rgba(0,0,0,0.04);
58+
border-radius: 3px;
59+
}

demo/styles/demo.scss

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
@import 'base';
2+
3+
//your demo specific scss here

package.json

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
{
2+
"name": "gradients",
3+
"version": "0.0.0",
4+
"description": "Example package.json. Feel free to copy!",
5+
"main": "src/scripts/gradients.js",
6+
"repository": {
7+
"type": "git",
8+
"url": "{{ git.SSH-URL }}"
9+
},
10+
"scripts": {
11+
"copy": "caddy copy",
12+
"build": "caddy build",
13+
"bump": "caddy bump",
14+
"release": "npm test && caddy release",
15+
"report": "caddy serve test/coverage/phantomjs/",
16+
"start": "caddy copy && caddy build -dev && caddy serve",
17+
"tdd": "caddy test tdd",
18+
"test": "jshint src && caddy build && caddy test"
19+
},
20+
"devDependencies": {
21+
"browserify-istanbul": "^0.2.1",
22+
"web-caddy" : "2.0.0-beta.3",
23+
"jshint": "^2.6.3"
24+
},
25+
"author": "{{ git.author }}"
26+
}

src/scripts/gradients.js

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
// By default JS dependency is handled using CommonJS and browserify
2+
// please see 'docs/API.md#scripts' for more info
3+
//
4+
// You may need other components. i.e. Run and uncomment the following :
5+
// $ bower install dependency-name --save
6+
// var dependency = require('../../bower_components/dependency-name/src/scripts/index');
7+
8+
9+
//example function
10+
function Main(){
11+
this.version = require('./utils/version.js');//keep this : each component exposes its version
12+
}
13+
14+
Main.prototype.sum = function(args){
15+
var total = 0;
16+
args.forEach(function(int){
17+
total += int;
18+
});
19+
return total;
20+
};
21+
22+
Main.prototype.write = function(args){
23+
document.getElementById('demo-functional').innerHTML = this.sum(args);
24+
};
25+
26+
27+
//example export
28+
module.exports = Main;

src/scripts/utils/version.js

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
module.exports = "0.0.0";

0 commit comments

Comments
 (0)