Reorganize files for Bower distro

This commit is contained in:
Lokesh Dhakar
2014-04-17 11:07:23 -07:00
parent cb5c9c6ca8
commit 9cbad46067
19 changed files with 54 additions and 39 deletions

View File

@@ -5,8 +5,8 @@ module.exports = function(grunt) {
compass: { compass: {
dist: { dist: {
options: { options: {
sassDir: 'sass', sassDir: 'examples/sass',
cssDir: 'css', cssDir: 'examples/css',
environment: 'production' environment: 'production'
} }
} }
@@ -27,21 +27,15 @@ module.exports = function(grunt) {
src: '.', src: '.',
dest: '<%- host_config.directory %>', dest: '<%- host_config.directory %>',
exclusions: [ exclusions: [
'.DS_Store', '**/.*',
'.sass-cache', '.*',
'.git*', 'bower_components',
'.host_config', 'node_modules'
'.ftppass',
'node_modules',
'sass',
'Gruntfile.js',
'package.json',
'README.markdown'
] ]
} }
}, },
jshint: { jshint: {
files: ['js/color-thief.js'] files: ['src/color-thief.js']
}, },
uglify: { uglify: {
options: { options: {
@@ -50,13 +44,13 @@ module.exports = function(grunt) {
}, },
dist: { dist: {
files: { files: {
'js/color-thief.min.js': ['js/color-thief.js'] 'dist/color-thief.min.js': ['src/color-thief.js']
} }
} }
}, },
watch: { watch: {
sass: { sass: {
files: ['sass/*.sass'], files: ['examples/sass/*.sass'],
tasks: ['compass'], tasks: ['compass'],
options: { options: {
livereload: true, livereload: true,
@@ -64,7 +58,7 @@ module.exports = function(grunt) {
}, },
}, },
test: { test: {
files: ['js/color-thief.js'], files: ['src/color-thief.js'],
tasks: ['jshint'] tasks: ['jshint']
} }
} }

12
HISTORY.md Normal file
View File

@@ -0,0 +1,12 @@
v2.0.0
---
- Embed quantize into color thief file
- Strip out jQuery requirement
- Credit those who helped with edits - Nathan Spady for drag and drop support.
#### Examples
- Don't show yellow circle buttons till images have loaded
- Add FB and Twitter buttons
- Add drag n drop support
- Make design responsive
- Touch support on demo page

View File

@@ -1,23 +1,24 @@
{ {
"name": "color-thief", "name": "color-thief",
"version": "2.1.0", "version": "2.0.0",
"homepage": "http://lokeshdhakar.com/projects/color-thief/", "homepage": "http://lokeshdhakar.com/projects/color-thief/",
"authors": [ "authors": [
"Lokesh Dhakar <lokesh.dhakar@gmail.com>" "Lokesh Dhakar"
], ],
"description": "Grab the dominant color or color palette from an image.", "description": "Grab the dominant color or color palette from an image.",
"main": "js/color-thief.js", "main": "js/color-thief.js",
"keywords": [ "keywords": [
"color", "color",
"palette", "palette",
"picker", "sampling",
"thief", "image",
"dominant" "picture",
"photo",
"canvas"
], ],
"license": "CC BY 2.5", "license": "CC BY 2.5",
"ignore": [ "ignore": [
"**/.*", "**/.*",
"Gruntfile.js",
"node_modules", "node_modules",
"bower_components", "bower_components",
"test", "test",

1
dist/color-thief.min.map vendored Normal file

File diff suppressed because one or more lines are too long

View File

Before

Width:  |  Height:  |  Size: 75 KiB

After

Width:  |  Height:  |  Size: 75 KiB

View File

Before

Width:  |  Height:  |  Size: 137 KiB

After

Width:  |  Height:  |  Size: 137 KiB

View File

Before

Width:  |  Height:  |  Size: 80 KiB

After

Width:  |  Height:  |  Size: 80 KiB

View File

@@ -9,9 +9,9 @@ $(document).ready(function () {
// Color Thief demo code // Color Thief demo code
// --------------------- // ---------------------
var imageArray = {images: [ var imageArray = {images: [
{'file': 'img/photo1.jpg'}, {'file': 'examples/img/photo1.jpg'},
{'file': 'img/photo2.jpg'}, {'file': 'examples/img/photo2.jpg'},
{'file': 'img/photo3.jpg'} {'file': 'examples/img/photo3.jpg'}
]}; ]};
// Render example images // Render example images
@@ -47,8 +47,10 @@ $(document).ready(function () {
elapsedTimeForGetPalette: elapsedTimeForGetPalette elapsedTimeForGetPalette: elapsedTimeForGetPalette
}; };
var colorThiefOuputHTML = Mustache.to_html($('#color-thief-output-template').html(), colorThiefOutput); var colorThiefOuputHTML = Mustache.to_html($('#color-thief-output-template').html(), colorThiefOutput);
$imageSection.addClass('with-color-thief-output'); $imageSection.addClass('with-color-thief-output');
$imageSection.find('.run-functions-button').addClass('hide'); $imageSection.find('.run-functions-button').addClass('hide');
setTimeout(function(){ setTimeout(function(){
$imageSection.find('.color-thief-output').append(colorThiefOuputHTML).slideDown(); $imageSection.find('.color-thief-output').append(colorThiefOuputHTML).slideDown();
// If the color-thief-output div is not in the viewport or cut off, scroll down. // If the color-thief-output div is not in the viewport or cut off, scroll down.
@@ -59,7 +61,6 @@ $(document).ready(function () {
$('body').animate({scrollTop: outputOffsetTop - windowHeight + 200 + "px"}); $('body').animate({scrollTop: outputOffsetTop - windowHeight + 200 + "px"});
} }
}, 300); }, 300);
}; };
// Drag'n'drop demo // Drag'n'drop demo

View File

@@ -10,9 +10,8 @@
<meta name="author" content="Lokesh Dhakar"> <meta name="author" content="Lokesh Dhakar">
<meta name="viewport" content="width=device-width,initial-scale=1"> <meta name="viewport" content="width=device-width,initial-scale=1">
<script src="js/libs/modernizr.custom.js"></script>
<link rel="stylesheet" href="http://fonts.googleapis.com/css?family=Karla%7CMontserrat:700"> <link rel="stylesheet" href="http://fonts.googleapis.com/css?family=Karla%7CMontserrat:700">
<link rel="stylesheet" href="css/screen.css"> <link rel="stylesheet" href="examples/css/screen.css">
</head> </head>
<body> <body>
@@ -106,10 +105,10 @@
</script> </script>
<script src="js/jquery.js"></script> <script src="src/color-thief.js"></script>
<script src="js/mustache.js"></script> <script src="examples/js/jquery.js"></script>
<script src="js/color-thief.js"></script> <script src="examples/js/mustache.js"></script>
<script src="js/demo.js"></script> <script src="examples/js/demo.js"></script>
<script type="text/javascript"> <script type="text/javascript">
var _gaq = _gaq || []; var _gaq = _gaq || [];

File diff suppressed because one or more lines are too long

View File

@@ -1,14 +1,21 @@
{ {
"name": "color-thief", "name": "color-thief",
"version": "2.1.0", "version": "2.0.0",
"author": "Lokesh Dhakar", "private": true,
"author": {
"name": "Lokesh Dhakar",
"email": "lokesh.dhakar@gmail.com",
"url": "http://lokeshdhakar.com/"
},
"description": "Get the dominant color or color palette from an image.", "description": "Get the dominant color or color palette from an image.",
"keywords": [ "keywords": [
"color", "color",
"palette", "palette",
"picker", "sampling",
"thief", "image",
"dominant" "picture",
"photo",
"canvas"
], ],
"homepage": "http://lokeshdhakar.com/projects/color-thief/", "homepage": "http://lokeshdhakar.com/projects/color-thief/",
"repository": { "repository": {
@@ -24,6 +31,7 @@
"url": "http://creativecommons.org/licenses/by/2.5/" "url": "http://creativecommons.org/licenses/by/2.5/"
} }
], ],
"main": "dist/color-thief.min.js",
"devDependencies": { "devDependencies": {
"grunt": "~0.4.2", "grunt": "~0.4.2",
"grunt-contrib-compass": "^0.7.2", "grunt-contrib-compass": "^0.7.2",