Skip to content
This repository has been archived by the owner on Jun 1, 2021. It is now read-only.

Commit

Permalink
bespoke-active skeleton by generator-bespokeplugin
Browse files Browse the repository at this point in the history
  • Loading branch information
joelpurra committed Nov 11, 2013
0 parents commit b38affc
Show file tree
Hide file tree
Showing 16 changed files with 455 additions and 0 deletions.
13 changes: 13 additions & 0 deletions .editorconfig
@@ -0,0 +1,13 @@
# http://editorconfig.org
root = true

[*]
indent_style = space
indent_size = 2
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true

[*.md]
trim_trailing_whitespace = false
1 change: 1 addition & 0 deletions .gitattributes
@@ -0,0 +1 @@
* text=auto
2 changes: 2 additions & 0 deletions .gitignore
@@ -0,0 +1,2 @@
node_modules
bower_components
21 changes: 21 additions & 0 deletions .jshintrc
@@ -0,0 +1,21 @@
{
"node": true,
"esnext": true,
"bitwise": true,
"camelcase": true,
"curly": true,
"eqeqeq": true,
"immed": true,
"indent": 4,
"latedef": true,
"newcap": true,
"noarg": true,
"quotmark": "single",
"regexp": true,
"undef": true,
"unused": true,
"strict": true,
"trailing": true,
"smarttabs": true,
"white": true
}
4 changes: 4 additions & 0 deletions .travis.yml
@@ -0,0 +1,4 @@
language: node_js
node_js:
- '0.8'
- '0.10'
27 changes: 27 additions & 0 deletions CONTRIBUTING.md
@@ -0,0 +1,27 @@
# Contributing

## Important notes
Please don't edit files in the `dist` subdirectory as they are generated via [Grunt](http://gruntjs.com/). You'll find source code in the `src` subdirectory!

### Code style
Regarding code style like indentation and whitespace, **follow the conventions you see used in the source already.**

## Modifying the code
First, ensure that you have the latest [Node.js](http://nodejs.org/) and [npm](http://npmjs.org/) installed.

Test that Grunt's CLI is installed by running `grunt --version`. If the command isn't found, run `npm install -g grunt-cli`. For more information about installing Grunt, see the [getting started with Grunt guide](http://gruntjs.com/getting-started).

1. Fork and clone the repo.
1. Run `npm install` to install all build dependencies (including Grunt).
1. Run `grunt` to grunt this project.

Assuming that you don't see any red, you're ready to go. Just be sure to run `grunt` after making any changes, to ensure that nothing is broken.

## Submitting pull requests

1. Create a new branch, please don't work in your `master` branch directly.
1. Add failing tests for the change you want to make. Run `grunt` to see the tests fail.
1. Fix stuff.
1. Run `grunt` to see if the tests pass. Repeat steps 2-4 until done.
1. Update the documentation to reflect any changes.
1. Push to your fork and submit a pull request.
85 changes: 85 additions & 0 deletions Gruntfile.js
@@ -0,0 +1,85 @@
// Generated on 2013-11-11 using generator-bespokeplugin v0.1.3

module.exports = function(grunt) {

grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
meta: {
banner: '/*!\n' +
' * <%= pkg.title || pkg.name %> v<%= pkg.version %>\n' +
' * <%= pkg.homepage %>\n' +
' *\n' +
' * Copyright <%= grunt.template.today("yyyy") %>, <%= pkg.author.name %>\n' +
' * This content is released under the' +
' <%= _.pluck(pkg.licenses, "type").join(", ") %> license<%= pkg.licenses.length === 1 ? "" : "s" %>\n' +
'' +
' */\n\n',
microbanner: '/*! <%= pkg.title || pkg.name %> v<%= pkg.version %> ' +
'© <%= grunt.template.today("yyyy") %> <%= pkg.author.name %>, ' +
'Licensed <%= _.pluck(pkg.licenses, "type").join(", ") %> */\n'
},
clean: {
files: ['dist']
},
concat: {
options: {
banner: '<%= meta.banner %>',
stripBanners: true
},
dist: {
src: ['src/<%= pkg.name %>.js'],
dest: 'dist/<%= pkg.name %>.js'
}
},
uglify: {
options: {
banner: '<%= meta.microbanner %>'
},
dist: {
src: ['<%= concat.dist.dest %>'],
dest: 'dist/<%= pkg.name %>.min.js'
}
},
jasmine: {
src: ['src/**/*.js'],
options: {
vendor: ['node_modules/bespoke/dist/bespoke.js'],
specs: 'spec/*Spec.js',
helpers: 'spec/*Helper.js'
}
},
jshint: {
src: [
'Gruntfile.js',
'src/**/*.js',
'spec/**/*.js',
'demo/**/*.js'
],
options: {
jshintrc: '.jshintrc'
}
},
micro: {
src: '<%= uglify.dist.dest %>',
options: {
limit: 1024,
gzip: true
}
},
watch: {
files: '<%= jshint.src %>',
tasks: ['default']
}
});

grunt.loadNpmTasks('grunt-contrib-clean');
grunt.loadNpmTasks('grunt-contrib-concat');
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-jasmine');
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-micro');

grunt.registerTask('default', ['clean', 'jasmine', 'concat', 'uglify', 'micro']);

};
20 changes: 20 additions & 0 deletions LICENSE
@@ -0,0 +1,20 @@
Copyright 2013 Joel Purra

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:

The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
53 changes: 53 additions & 0 deletions README.md
@@ -0,0 +1,53 @@
[![Build Status](https://secure.travis-ci.org/joelpurra/bespoke-active.png?branch=master)](https://travis-ci.org/joelpurra/bespoke-active)

# bespoke-active

Keep track of the active slide in [Bespoke.js](http://markdalgleish.com/projects/bespoke.js)

## Download

Download the [production version][min] or the [development version][max], or use a [package manager](#package-managers).

[min]: https://raw.github.com/joelpurra/bespoke-active/master/dist/bespoke-active.min.js
[max]: https://raw.github.com/joelpurra/bespoke-active/master/dist/bespoke-active.js

## Usage

First, include both `bespoke.js` and `bespoke-active.js` in your page.

Then, simply include the plugin when instantiating your presentation.

```js
bespoke.horizontal.from('article', {
active: true
});
```

## Package managers

### Bower

```bash
$ bower install bespoke-active
```

### npm

```bash
$ npm install bespoke-active
```

The bespoke-active npm package is designed for use with [browserify](http://browserify.org/), e.g.

```js
require('bespoke');
require('bespoke-active');
```

## Credits

This plugin was built with [generator-bespokeplugin](https://github.com/markdalgleish/generator-bespokeplugin).

## License

[MIT License](http://en.wikipedia.org/wiki/MIT_License)
7 changes: 7 additions & 0 deletions bower.json
@@ -0,0 +1,7 @@
{
"name": "bespoke-active",
"version": "0.0.0",
"dependencies": {
"bespoke.js": ">=0.3.0"
}
}
3 changes: 3 additions & 0 deletions demo/demo.js
@@ -0,0 +1,3 @@
bespoke.horizontal.from('article', {
active: true
});
34 changes: 34 additions & 0 deletions demo/index.html
@@ -0,0 +1,34 @@
<!doctype html>
<html>
<head>
<meta name="viewport" content="width=device-width" />
<title>bespoke-active demo</title>
<link rel="stylesheet" type="text/css" href="style.css" />
</head>
<body>

<h1>bespoke-active</h1>

<article>
<section>
<p>Slide 1</p>
</section>
<section>
<p>Slide 2</p>
</section>
<section>
<p>Slide 3</p>
</section>
<section>
<p>Slide 4</p>
</section>
<section>
<p>Slide 5</p>
</section>
</article>

<script src="../bower_components/bespoke.js/dist/bespoke.js"></script>
<script src="../src/bespoke-active.js"></script>
<script src="demo.js"></script>
</body>
</html>
64 changes: 64 additions & 0 deletions demo/style.css
@@ -0,0 +1,64 @@
body {
font-family: helvetica, arial, sans-serif;
font-size: 16px;
line-height: 28px;
}

* {
box-sizing: border-box;
-moz-box-sizing: border-box;
margin: 0;
padding: 0;
color: #303030;
}

h1 {
height: 25px;
width: 640px;
position: absolute;
top: 50%;
left: 50%;
margin-left: -322px;
margin-top: -290px;
font-size: 32px;
letter-spacing: -1px;
}

section {
display: none;
}

.bespoke-parent {
position: absolute;
top: 0;
bottom: 0;
left: 0;
right: 0;
}

.bespoke-slide {
width: 640px;
height: 480px;
position: absolute;
top: 50%;
margin-top: -240px;
left: 50%;
margin-left: -320px;
}

section.bespoke-slide {
-webkit-transition: all .3s ease;
-moz-transition: all .3s ease;
-ms-transition: all .3s ease;
-o-transition: all .3s ease;
transition: all .3s ease;
display: block;
}

.bespoke-inactive {
opacity: 0;
}

.bespoke-active {
opacity: 1;
}
45 changes: 45 additions & 0 deletions package.json
@@ -0,0 +1,45 @@
{
"name": "bespoke-active",
"version": "0.0.0",
"description": "Keep track of the active slide in Bespoke.js",
"homepage": "https://github.com/joelpurra/bespoke-active",
"bugs": "https://github.com/joelpurra/bespoke-active/issues",
"author": {
"name": "Joel Purra",
"url": "https://github.com/joelpurra"
},
"main": "./dist/bespoke-active.js",
"repository": {
"type": "git",
"url": "git://github.com/joelpurra/bespoke-active.git"
},
"scripts": {
"test": "grunt"
},
"peerDependencies": {
"bespoke": ">=0.3.0"
},
"devDependencies": {
"grunt-cli": "~0.1.9",
"grunt": "~0.4.1",
"grunt-contrib-jshint": "~0.6.4",
"grunt-contrib-jasmine": "~0.5.2",
"grunt-contrib-concat": "~0.3.0",
"grunt-contrib-uglify": "~0.2.4",
"grunt-contrib-clean": "~0.5.0",
"grunt-contrib-watch": "~0.5.3",
"grunt-micro": "~0.1.0",
"bespoke": ">=0.3.0"
},
"engines": {
"node": ">=0.8.0"
},
"licenses": [
{
"type": "MIT"
}
],
"keywords": [
"bespoke.js-plugin"
]
}

0 comments on commit b38affc

Please sign in to comment.