Skip to content

Commit

Permalink
Added the Zurb Foundation CSS framework and SASS support
Browse files Browse the repository at this point in the history
  • Loading branch information
ivanbreet committed Jul 30, 2013
1 parent 9dcf59a commit f40bbbd
Show file tree
Hide file tree
Showing 19 changed files with 1,982 additions and 121 deletions.
3 changes: 1 addition & 2 deletions .bowerrc
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
{
"directory": "app/components",
"json": "bower.json"
"directory": "app/bower_components"
}
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ node_modules
dist
.tmp
.sass-cache
app/components
app/bower_components
4 changes: 2 additions & 2 deletions .jshintrc
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
{
"node": true,
"browser": true,
"es5": true,
"esnext": true,
"bitwise": true,
"camelcase": true,
Expand All @@ -20,6 +19,7 @@
"trailing": true,
"smarttabs": true,
"globals": {
"angular": false
"angular": true,
"agoraApp": true
}
}
203 changes: 131 additions & 72 deletions Gruntfile.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,17 @@
// Generated on 2013-07-29 using generator-angular 0.3.1
'use strict';
var lrSnippet = require('grunt-contrib-livereload/lib/utils').livereloadSnippet;
var LIVERELOAD_PORT = 35729;
var lrSnippet = require('connect-livereload')({ port: LIVERELOAD_PORT });
var mountFolder = function (connect, dir) {
return connect.static(require('path').resolve(dir));
};

// # Globbing
// for performance reasons we're only matching one level down:
// 'test/spec/{,*/}*.js'
// use this if you want to recursively match all subfolders:
// 'test/spec/**/*.js'

module.exports = function (grunt) {
// load all grunt tasks
require('matchdep').filterDev('grunt-*').forEach(grunt.loadNpmTasks);
Expand All @@ -15,7 +23,7 @@ module.exports = function (grunt) {
};

try {
yeomanConfig.app = require('./component.json').appPath || yeomanConfig.app;
yeomanConfig.app = require('./bower.json').appPath || yeomanConfig.app;
} catch (e) {}

grunt.initConfig({
Expand All @@ -31,16 +39,18 @@ module.exports = function (grunt) {
},
compass: {
files: ['<%= yeoman.app %>/styles/{,*/}*.{scss,sass}'],
tasks: ['compass']
tasks: ['compass:server']
},
livereload: {
options: {
livereload: LIVERELOAD_PORT
},
files: [
'<%= yeoman.app %>/{,*/}*.html',
'{.tmp,<%= yeoman.app %>}/styles/{,*/}*.css',
'{.tmp,<%= yeoman.app %>}/scripts/{,*/}*.js',
'<%= yeoman.app %>/images/{,*/}*.{png,jpg,jpeg,gif,webp,svg}'
],
tasks: ['livereload']
]
}
},
connect: {
Expand Down Expand Up @@ -69,6 +79,15 @@ module.exports = function (grunt) {
];
}
}
},
dist: {
options: {
middleware: function (connect) {
return [
mountFolder(connect, yeomanConfig.dist)
];
}
}
}
},
open: {
Expand Down Expand Up @@ -98,12 +117,6 @@ module.exports = function (grunt) {
'<%= yeoman.app %>/scripts/{,*/}*.js'
]
},
karma: {
unit: {
configFile: 'karma.conf.js',
singleRun: true
}
},
coffee: {
dist: {
files: [{
Expand All @@ -126,13 +139,18 @@ module.exports = function (grunt) {
},
compass: {
options: {
require: 'zurb-foundation',
sassDir: '<%= yeoman.app %>/styles',
cssDir: '.tmp/styles',
generatedImagesDir: '.tmp/images/generated',
imagesDir: '<%= yeoman.app %>/images',
javascriptsDir: '<%= yeoman.app %>/scripts',
fontsDir: '<%= yeoman.app %>/styles/fonts',
importPath: '<%= yeoman.app %>/components',
relativeAssets: true
importPath: '<%= yeoman.app %>/bower_components',
httpImagesPath: '/images',
httpGeneratedImagesPath: '/images/generated',
httpFontsPath: '/styles/fonts',
relativeAssets: false
},
dist: {},
server: {
Expand All @@ -141,12 +159,19 @@ module.exports = function (grunt) {
}
}
},
concat: {
// not used since Uglify task does concat,
// but still available if needed
/*concat: {
dist: {}
},*/
rev: {
dist: {
files: {
'<%= yeoman.dist %>/scripts/scripts.js': [
'.tmp/scripts/{,*/}*.js',
'<%= yeoman.app %>/scripts/{,*/}*.js'
src: [
'<%= yeoman.dist %>/scripts/{,*/}*.js',
'<%= yeoman.dist %>/styles/{,*/}*.css',
'<%= yeoman.dist %>/images/{,*/}*.{png,jpg,jpeg,gif,webp,svg}',
'<%= yeoman.dist %>/styles/fonts/*'
]
}
}
Expand Down Expand Up @@ -174,16 +199,29 @@ module.exports = function (grunt) {
}]
}
},
cssmin: {
svgmin: {
dist: {
files: {
'<%= yeoman.dist %>/styles/main.css': [
'.tmp/styles/{,*/}*.css',
'<%= yeoman.app %>/styles/{,*/}*.css'
]
}
files: [{
expand: true,
cwd: '<%= yeoman.app %>/images',
src: '{,*/}*.svg',
dest: '<%= yeoman.dist %>/images'
}]
}
},
cssmin: {
// By default, your `index.html` <!-- Usemin Block --> will take care of
// minification. This option is pre-configured if you do not wish to use
// Usemin blocks.
// dist: {
// files: {
// '<%= yeoman.dist %>/styles/main.css': [
// '.tmp/styles/{,*/}*.css',
// '<%= yeoman.app %>/styles/{,*/}*.css'
// ]
// }
// }
},
htmlmin: {
dist: {
options: {
Expand All @@ -205,6 +243,55 @@ module.exports = function (grunt) {
}]
}
},
// Put files not handled in other tasks here
copy: {
dist: {
files: [{
expand: true,
dot: true,
cwd: '<%= yeoman.app %>',
dest: '<%= yeoman.dist %>',
src: [
'*.{ico,png,txt}',
'.htaccess',
'bower_components/**/*',
'images/{,*/}*.{gif,webp}',
'styles/fonts/*',
'config.js'
]
}, {
expand: true,
cwd: '.tmp/images',
dest: '<%= yeoman.dist %>/images',
src: [
'generated/*'
]
}]
}
},
concurrent: {
server: [
'coffee:dist',
'compass:server'
],
test: [
'coffee',
'compass'
],
dist: [
'coffee',
'compass:dist',
'imagemin',
'svgmin',
'htmlmin'
]
},
karma: {
unit: {
configFile: 'karma.conf.js',
singleRun: true
}
},
cdnify: {
dist: {
html: ['<%= yeoman.dist %>/*.html']
Expand All @@ -225,78 +312,50 @@ module.exports = function (grunt) {
files: {
'<%= yeoman.dist %>/scripts/scripts.js': [
'<%= yeoman.dist %>/scripts/scripts.js'
],
}
}
},
rev: {
dist: {
files: {
src: [
'<%= yeoman.dist %>/scripts/{,*/}*.js',
'<%= yeoman.dist %>/styles/{,*/}*.css',
'<%= yeoman.dist %>/images/{,*/}*.{png,jpg,jpeg,gif,webp}',
'<%= yeoman.dist %>/styles/fonts/*'
]
}
}
},
copy: {
dist: {
files: [{
expand: true,
dot: true,
cwd: '<%= yeoman.app %>',
dest: '<%= yeoman.dist %>',
src: [
'*.{ico,txt}',
'.htaccess',
'components/**/*',
'images/{,*/}*.{gif,webp}'
]
}]
}
}
});

grunt.renameTask('regarde', 'watch');
grunt.registerTask('server', function (target) {
if (target === 'dist') {
return grunt.task.run(['build', 'open', 'connect:dist:keepalive']);
}

grunt.registerTask('server', [
'clean:server',
'coffee:dist',
'compass:server',
'livereload-start',
'connect:livereload',
'open',
'watch'
]);
grunt.task.run([
'clean:server',
'concurrent:server',
'connect:livereload',
'open',
'watch'
]);
});

grunt.registerTask('test', [
'clean:server',
'coffee',
'compass',
'concurrent:test',
'connect:test',
'karma'
]);

grunt.registerTask('build', [
'clean:dist',
'jshint',
'test',
'coffee',
'compass:dist',
'useminPrepare',
'imagemin',
'cssmin',
'htmlmin',
'concurrent:dist',
'concat',
'copy',
'cdnify',
'ngmin',
'cssmin',
'uglify',
'rev',
'usemin'
]);

grunt.registerTask('default', ['build']);
grunt.registerTask('default', [
'jshint',
'test',
'build'
]);
};
2 changes: 1 addition & 1 deletion app/config.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
'use strict';

app.constant('TITLE', 'Your meetup group title').
agoraApp.constant('TITLE', 'Your meetup group title').
constant('DESC', 'A brief description of this group').
constant('API', '/');
24 changes: 15 additions & 9 deletions app/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,32 +3,38 @@
<!--[if IE 7]> <html class="no-js lt-ie9 lt-ie8"> <![endif]-->
<!--[if IE 8]> <html class="no-js lt-ie9"> <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js"> <!--<![endif]-->
<head ng-app="agora">
<head>
<meta charset="utf-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"/>
<title>Agora</title>
<title></title>
<meta name="description" content="">
<meta name="viewport" content="width=device-width">
<!-- Place favicon.ico and apple-touch-icon.png in the root directory -->

<!-- build:css({.tmp,app}) styles/main.css -->
<link rel="stylesheet" href="styles/app.css">
<link rel="stylesheet" href="styles/main.css">
<!-- endbuild -->
</head>
<body>
<body ng-app="agora">
<!--[if lt IE 7]>
<p class="chromeframe">You are using an outdated browser. <a href="http://browsehappy.com/">Upgrade your browser today</a> or <a href="http://www.google.com/chromeframe/?redirect=true">install Google Chrome Frame</a> to better experience this site.</p>
<![endif]-->

<!--[if lt IE 9]>
<script src="components/es5-shim/es5-shim.js"></script>
<script src="components/json3/lib/json3.min.js"></script>
<script src="bower_components/es5-shim/es5-shim.js"></script>
<script src="bower_components/json3/lib/json3.min.js"></script>
<![endif]-->

<!-- Add your site or application content here -->
<div class="container" ng-view></div>
<div class="row">
<div class="container" ng-view></div>
</div>

<script src="components/angular/angular.js"></script>
<script src="components/angular-sanitize/angular-sanitize.js"></script>
<script src="bower_components/angular/angular.js"></script>
<script src="bower_components/angular-sanitize/angular-sanitize.js"></script>

<!-- build:js scripts/scripts.js -->
<!-- build:js({.tmp,app}) scripts/scripts.js -->
<script src="scripts/app.js"></script>
<script src="scripts/controllers/main.js"></script>
<script src="scripts/services/configService.js"></script>
Expand Down
Loading

0 comments on commit f40bbbd

Please sign in to comment.