mirror of
https://github.com/janishutz/color-thief.git
synced 2025-11-25 05:44:24 +00:00
Reorganize files for Bower distro
This commit is contained in:
26
Gruntfile.js
26
Gruntfile.js
@@ -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
12
HISTORY.md
Normal 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
|
||||||
13
bower.json
13
bower.json
@@ -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
1
dist/color-thief.min.map
vendored
Normal file
File diff suppressed because one or more lines are too long
|
Before Width: | Height: | Size: 75 KiB After Width: | Height: | Size: 75 KiB |
|
Before Width: | Height: | Size: 137 KiB After Width: | Height: | Size: 137 KiB |
|
Before Width: | Height: | Size: 80 KiB After Width: | Height: | Size: 80 KiB |
@@ -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
|
||||||
0
js/jquery.js → examples/js/jquery.js
vendored
0
js/jquery.js → examples/js/jquery.js
vendored
11
index.html
11
index.html
@@ -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
18
package.json
18
package.json
@@ -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",
|
||||||
|
|||||||
Reference in New Issue
Block a user