Skip to content

Instantly share code, notes, and snippets.

@doomsbuster
Last active December 28, 2015 13:29
Show Gist options
  • Save doomsbuster/7507710 to your computer and use it in GitHub Desktop.
Save doomsbuster/7507710 to your computer and use it in GitHub Desktop.
usemin task issue
Running "usemin:js" (usemin) task
Processing as JS - dist/scripts/401338d2.modules.js
Replacing reference to ParticleSmoke.png
Processing as JS - dist/scripts/af444208.scripts.js
Replacing reference to ParticleSmoke.png
// Generated on 2013-11-11 using generator-angular 0.6.0-rc.1
'use strict';
// # 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) {
require('load-grunt-tasks')(grunt);
require('time-grunt')(grunt);
grunt.initConfig({
yeoman: {
// configurable paths
app: require('./bower.json').appPath || 'app',
dist: 'dist'
},
watch: {
coffee: {
files: ['<%= yeoman.app %>/scripts/{,*/}*.coffee'],
tasks: ['coffee:dist']
},
coffeeTest: {
files: ['test/spec/{,*/}*.coffee'],
tasks: ['coffee:test']
},
styles: {
files: ['<%= yeoman.app %>/styles/{,*/}*.css'],
tasks: ['copy:styles', 'autoprefixer']
},
livereload: {
options: {
livereload: '<%= connect.options.livereload %>'
},
files: [
'<%= yeoman.app %>/{,*/}*.html',
'.tmp/styles/{,*/}*.css',
'{.tmp,<%= yeoman.app %>}/scripts/{,*/}*.js',
'<%= yeoman.app %>/images/{,*/}*.{png,jpg,jpeg,gif,webp,svg}'
]
}
},
autoprefixer: {
options: ['last 1 version'],
dist: {
files: [{
expand: true,
cwd: '.tmp/styles/',
src: '{,*/}*.css',
dest: '.tmp/styles/'
}]
}
},
connect: {
options: {
port: 9000,
// Change this to '0.0.0.0' to access the server from outside.
hostname: '0.0.0.0',
livereload: 35729
},
livereload: {
options: {
open: true,
base: [
'.tmp',
'<%= yeoman.app %>'
]
}
},
test: {
options: {
port: 9001,
base: [
'.tmp',
'test',
'<%= yeoman.app %>'
]
}
},
dist: {
options: {
base: '<%= yeoman.dist %>'
}
}
},
clean: {
dist: {
files: [{
dot: true,
src: [
'.tmp',
'<%= yeoman.dist %>/*',
'!<%= yeoman.dist %>/.git*'
]
}]
},
server: '.tmp'
},
jshint: {
options: {
jshintrc: '.jshintrc',
reporter: require('jshint-stylish')
},
all: [
'Gruntfile.js',
'<%= yeoman.app %>/scripts/{,*/}*.js'
]
},
coffee: {
options: {
sourceMap: true,
sourceRoot: ''
},
dist: {
files: [{
expand: true,
cwd: '<%= yeoman.app %>/scripts',
src: '{,*/}*.coffee',
dest: '.tmp/scripts',
ext: '.js'
}]
},
test: {
files: [{
expand: true,
cwd: 'test/spec',
src: '{,*/}*.coffee',
dest: '.tmp/spec',
ext: '.js'
}]
}
},
// not used since Uglify task does concat,
// but still available if needed
/*concat: {
dist: {}
},*/
rev: {
dist: {
files: {
src: [
'<%= yeoman.dist %>/scripts/{,*/}*.js',
'<%= yeoman.dist %>/styles/{,*/}*.css',
'<%= yeoman.dist %>/images/{,*/}*.{png,jpg,jpeg,gif,webp,svg}',
'<%= yeoman.dist %>/styles/fonts/*'
]
}
}
},
useminPrepare: {
html: '<%= yeoman.app %>/index.html',
options: {
dest: '<%= yeoman.dist %>'
}
},
usemin: {
html: ['<%= yeoman.dist %>/{,*/}*.html'],
css: ['<%= yeoman.dist %>/styles/{,*/}*.css'],
js: '<%= yeoman.dist %>/scripts/*.js',
options: {
dirs: ['<%= yeoman.dist %>'],
assetsDirs: ['images'],
patterns: {
js: [['/ParticleSmoke\.png/', 'Replacing reference to ParticleSmoke.png']]
}
}
},
imagemin: {
dist: {
options: {
optimizationLevel: 7,
progressive: true
},
files: [{
expand: true,
cwd: '<%= yeoman.app %>/images',
src: '{,*/}*.{png,jpg,jpeg}',
dest: '<%= yeoman.dist %>/images'
}]
}
},
svgmin: {
dist: {
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: {
/*removeCommentsFromCDATA: true,
// https://github.com/yeoman/grunt-usemin/issues/44
//collapseWhitespace: true,
collapseBooleanAttributes: true,
removeAttributeQuotes: true,
removeRedundantAttributes: true,
useShortDoctype: true,
removeEmptyAttributes: true,
removeOptionalTags: true*/
},
files: [{
expand: true,
cwd: '<%= yeoman.app %>',
src: ['*.html', 'views/*.html'],
dest: '<%= yeoman.dist %>'
}]
}
},
// 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}',
'fonts/*',
'data/*'
]
}, {
expand: true,
cwd: '.tmp/images',
dest: '<%= yeoman.dist %>/images',
src: [
'generated/*'
]
}]
},
styles: {
expand: true,
cwd: '<%= yeoman.app %>/styles',
dest: '.tmp/styles/',
src: '{,*/}*.css'
}
},
concurrent: {
server: [
'coffee:dist',
'copy:styles'
],
test: [
'coffee',
'copy:styles'
],
dist: [
'coffee',
'copy:styles',
'imagemin',
'svgmin',
'htmlmin'
]
},
karma: {
unit: {
configFile: 'karma.conf.js',
singleRun: true
}
},
cdnify: {
dist: {
html: ['<%= yeoman.dist %>/*.html']
}
},
ngmin: {
dist: {
files: [{
expand: true,
cwd: '.tmp/concat/scripts',
src: '*.js',
dest: '.tmp/concat/scripts'
}]
}
},
uglify: {
dist: {
files: {
'<%= yeoman.dist %>/scripts/scripts.js': [
'<%= yeoman.dist %>/scripts/scripts.js'
]
}
}
}
});
grunt.registerTask('server', function (target) {
if (target === 'dist') {
return grunt.task.run(['build', 'connect:dist:keepalive']);
}
grunt.task.run([
'clean:server',
'concurrent:server',
'autoprefixer',
'connect:livereload',
'watch'
]);
});
grunt.registerTask('test', [
'clean:server',
'concurrent:test',
'autoprefixer',
'connect:test',
'karma'
]);
grunt.registerTask('build', [
'clean:dist',
'useminPrepare',
'concurrent:dist',
'autoprefixer',
'concat',
'ngmin',
'copy:dist',
'cdnify',
'cssmin',
'uglify',
'rev',
'usemin'
]);
grunt.registerTask('default', [
'jshint',
'test',
'build'
]);
};
"use strict";angular.module("ashishdesaicomApp",["ngRoute"]).config(["$routeProvider",function(a){a.when("/",{templateUrl:"views/home.html",controller:"MainCtrl"}).when("/tech",{templateUrl:"views/technology.html",controller:"MainCtrl"}).when("/training",{templateUrl:"views/training.html",controller:"MainCtrl"}).otherwise({redirectTo:"/"})}]).run(["$rootScope","$location","$window",function(a,b,c){a.$watch(function(){return b.path()},function(a,b){""!=a&&""!=b&&(console.log(a+"::"+b),a!=b&&"/"==a&&(c.location.href="/"))},!0)}]);var SNOW_SCENE=function(){function a(){cancelAnimationFrame(e)}function b(){e=requestAnimationFrame(b),c()}function c(){for(var a=0;a<r.length;a++){var b=r[a];b.updatePhysics(),b.position.y<-1e3&&(b.position.y+=2e3),b.position.x>1e3?b.position.x-=2e3:b.position.x<-1e3&&(b.position.x+=2e3),b.position.z>1e3?b.position.z-=2e3:b.position.z<-1e3&&(b.position.z+=2e3)}i.position.x+=.05*(p-i.position.x),i.position.y+=.05*(-q-i.position.y),i.lookAt(j.position),k.render(j,i)}function d(a,b){return Math.random()*(b-a)+a}var e,f,g,h,i,j,k,l,m,n=$(document).width(),o=$(document).height(),p=0,q=0,r=(window.innerWidth/2,window.innerHeight/2,[]),s=new Image;s.src="images/ParticleSmoke.png",g=function(a){THREE.Particle.call(this,a),this.velocity=new THREE.Vector3(0,-8,0),this.velocity.rotateX(d(-45,45)),this.velocity.rotateY(d(0,360)),this.gravity=new THREE.Vector3(0,0,0),this.drag=1},g.prototype=new THREE.Particle,g.prototype.constructor=g,g.prototype.updatePhysics=function(){this.velocity.multiplyScalar(this.drag),this.velocity.addSelf(this.gravity),this.position.addSelf(this.velocity)};var t=Math.PI/180;return THREE.Vector3.prototype.rotateY=function(a){l=Math.cos(a*t),m=Math.sin(a*t);var b=this.z,c=this.x;this.x=c*l+b*m,this.z=c*-m+b*l},THREE.Vector3.prototype.rotateX=function(a){l=Math.cos(a*t),m=Math.sin(a*t);var b=this.z,c=this.y;this.y=c*l+b*m,this.z=c*-m+b*l},THREE.Vector3.prototype.rotateZ=function(a){l=Math.cos(a*t),m=Math.sin(a*t);var b=this.x,c=this.y;this.y=c*l+b*m,this.x=c*-m+b*l},{reloadSnow:function(){var a=$("#viewport");console.log("reloadSnow()::"+a),a.append(f),console.log("container appended::"+$("#snow"))},updateCanvasDimensions:function(a,b){console.log("updateCanvasDimenstions()::width::"+a+"::height::"+b),k.setSize(a,b)},initializeSnow:function(){console.log("container::"+f),f=document.createElement("div");var a=document.getElementById("viewport");a.appendChild(f),f.id="snow",f.setAttribute("class","snowlayer"),console.log("container::"+f),i=new THREE.PerspectiveCamera(70,n/o,1,1e4),i.position.z=1e3,j=new THREE.Scene,j.add(i),k=new THREE.CanvasRenderer,k.setSize(n,o);for(var c=new THREE.ParticleBasicMaterial({map:new THREE.Texture(s)}),d=0;700>d;d++)h=new g(c),h.position.x=2e3*Math.random()-1e3,h.position.y=2e3*Math.random()-1e3,h.position.z=2e3*Math.random()-1e3,h.scale.x=h.scale.y=1,j.add(h),r.push(h);f.appendChild(k.domElement),b()},stopAnimating:function(){a()}}}();angular.module("ashishdesaicomApp").controller("MainCtrl",["$scope",function(a){a.awesomeThings=["HTML5 Boilerplate","AngularJS","Karma"],a.headingTexts=["T","E","C","H","N","O","L","O","G","Y"],a.$on("$viewContentLoaded",function(){"#/"==window.location.hash?(console.log("Location Hash::"+window.location.hash+SNOW_SCENE),SNOW_SCENE.initializeSnow(),console.log("Snow Reloaded::"+SNOW_SCENE)):SNOW_SCENE.stopAnimating()})}]),angular.module("ashishdesaicomApp").directive("oscillator",function(){return{replate:!0,scope:{text:"@"},template:'<div class="component"><div class="handle"></div><div class="text threed">{{text}}</div></div>',restrict:"E",link:function(){},transclude:!0}}),$(document).ready(function(){var a=Modernizr.cssanimations;if($(window).load(function(){console.log("window.onload snow initialized")}),a){$("#calloutcontainer").hide("fast"),$(window).resize(function(){$("#mainbody").css({height:$(window).height()}),$("#snow").css({height:$(window).height()}),SNOW_SCENE.updateCanvasDimensions($(window).width(),$(window).height()),console.log("update dimensions - window resize::"+$(window).width()+"::height"+$(window).height())});{$.getJSON("data/planetposition.json",function(a){var b,c=[],d=$("#calloutcontainer");$("#mainbody").css({height:$(window).height()}).click(function(a){var b=a.target.id;-1==b.indexOf("planet")&&$("#calloutcontainer").hide("fast")});for(var e=0;e<a.length;e++){var f=a[e];b='<div id="'+f.name+'" class="planet"></div>',c.push(b),$("#mainbody").append(b),$("#"+f.name).css({left:f.left,top:f.top,width:f.width,height:f.height,borderRadius:f.borderRadius,"z-index":f.zindex}).addClass(f["class"]).click(function(a){var b,c,e=$(window).width(),f=$(".callouttriangle");if(f.css({"margin-left":"20px"}),c=a.pageY+10,a.pageX+d.width()>e){var g=d.width()-(parseInt(f.css("border-bottom-width"))+parseInt(f.css("margin-left")));f.css({"margin-left":g-parseInt(f.css("border-bottom-width"))+"px"}),b=a.pageX-d.width()+(d.width()-g+parseInt(f.css("border-bottom-width"))/2)}else b=a.pageX-25;d.show("fast"),d.css({left:b,top:c}).animate({left:b+"px"},"slow")}),d.click(function(){$(".calloutTriangle").css({"margin-left":"20px"}),d.hide("fast")}),"shootingstar"==f.type&&$("#"+f.name).css({width:"5px",height:"5px",borderRadius:"5px"}).addClass("movingstar"),d.hide()}})}}else $(".calloutbubble").hide(),$(".callouttriangle").hide(),$(".pagebackground").css({"background-image":'url("img/ie_killed.png")',"background-position":"top center","background-size":"100% 100%"}),$(".ulink").css({color:"#000"}),$("#footerdiv").css({color:"#000"}),$("#message").show()}),function(){for(var a=0,b=["ms","moz","webkit","o"],c=0;c<b.length&&!window.requestAnimationFrame;++c)window.requestAnimationFrame=window[b[c]+"RequestAnimationFrame"],window.cancelAnimationFrame=window[b[c]+"CancelAnimationFrame"]||window[b[c]+"CancelRequestAnimationFrame"];window.requestAnimationFrame||(window.requestAnimationFrame=function(b){var c=(new Date).getTime(),d=Math.max(0,16-(c-a)),e=window.setTimeout(function(){b(c+d)},d);return a=c+d,e}),window.cancelAnimationFrame||(window.cancelAnimationFrame=function(a){clearTimeout(a)})}();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment