mirror of
https://github.com/janishutz/color-thief.git
synced 2025-11-25 05:44:24 +00:00
Updated demo page. Added package.json and bower.json.
This commit is contained in:
173
index.html
173
index.html
@@ -6,113 +6,122 @@
|
||||
|
||||
<title>Color Thief</title>
|
||||
|
||||
<meta name="description" content="Color Thief is a script for grabbing the color palette from an image. It uses Javacript and the canvas tag.">
|
||||
<meta name="description" content="Get the dominant color or color palette from an image.">
|
||||
<meta name="author" content="Lokesh Dhakar">
|
||||
<meta name="viewport" content="width=device-width,initial-scale=1">
|
||||
|
||||
<script src="js/libs/modernizr.custom.js"></script>
|
||||
<link href='http://fonts.googleapis.com/css?family=Karla:400,700' rel='stylesheet' type='text/css'>
|
||||
<link rel="stylesheet" href="css/app.css">
|
||||
<link rel="stylesheet" href="http://fonts.googleapis.com/css?family=Karla%7CMontserrat:700">
|
||||
<link rel="stylesheet" href="css/screen.css">
|
||||
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<div class="wrapper">
|
||||
<header>
|
||||
<div class="container">
|
||||
<h1 class="logo">Color Thief</h1>
|
||||
<p class="lead">
|
||||
Grab the color palette from an image.<br /> Uses Javascript and the canvas tag to make it happen.
|
||||
</p>
|
||||
|
||||
<section class="intro">
|
||||
<header>
|
||||
<h1 class="logo">Color Thief</h1>
|
||||
</header>
|
||||
<h4><a href="http://lokeshdhakar.com">by Lokesh Dhakar</a></small></h4>
|
||||
<p class="description">A script for grabbing the color palette from an image. Uses Javascript and the canvas tag to make it happen.</p>
|
||||
<p class="read-more-links"><a href="http://www.lokeshdhakar.com/color-thief/">Read more about it on my blog</a> or <a href="https://github.com/lokesh/color-thief">get the code on Github</a></p>
|
||||
</section>
|
||||
<a href="https://github.com/lokesh/color-thief/" class="button">
|
||||
Download from Github</small>
|
||||
</a>
|
||||
|
||||
<section id="examples" class="examples">
|
||||
<header>
|
||||
<h2 class="section-header">Examples</h2>
|
||||
</header>
|
||||
</section>
|
||||
|
||||
<section id="drag-drop" class="drag-drop">
|
||||
<header>
|
||||
<h2 class="section-header">Try it yourself</h2>
|
||||
</header>
|
||||
<div id="drop-zone" class="drop-zone">
|
||||
<div class="drop-zone-label default-label">Drag an image here</div>
|
||||
<div class="drop-zone-label dragging-label">Drop it here!</div>
|
||||
</div>
|
||||
<div id="dragged-images" class="dragged-images"></div>
|
||||
</header>
|
||||
|
||||
<section id="examples" class="examples-section">
|
||||
<div class="container">
|
||||
<h2>Examples</h2>
|
||||
<div id="example-images"></div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section id="sharing" class="sharing">
|
||||
<section id="drag-drop" class="drag-drop-section">
|
||||
<div class="container">
|
||||
<h2>Try it yourself</h2>
|
||||
<div id="drop-zone" class="drop-zone">
|
||||
<div class="drop-zone-label default-label">Drag an image here</div>
|
||||
<div class="drop-zone-label dragging-label">Drop it!</div>
|
||||
</div>
|
||||
<div id="dragged-images" class="dragged-images"></div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<footer>
|
||||
<div class="container">
|
||||
<p>
|
||||
Created by Lokesh Dhakar<br />
|
||||
<a href="https://twitter.com/lokesh" class="button button-minor">Follow me on Twitter</a>
|
||||
</p>
|
||||
</div>
|
||||
</footer>
|
||||
|
||||
<div id="sharing" class="sharing-section">
|
||||
<a href="https://twitter.com/share" class="twitter-share-button" data-via="lokesh" data-size="large">Tweet</a>
|
||||
<script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0],p=/^http:/.test(d.location)?'http':'https';if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src=p+'://platform.twitter.com/widgets.js';fjs.parentNode.insertBefore(js,fjs);}}(document, 'script', 'twitter-wjs');</script>
|
||||
</section>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<script src="js/libs/jquery-2.0.2.min.js"></script>
|
||||
<script src="js/libs/jquery.lettering.js"></script>
|
||||
<script src="js/libs/mustache.js"></script>
|
||||
<script src="js/color-thief.js"></script>
|
||||
|
||||
|
||||
<!-- Mustache templates -->
|
||||
<script id='image-section-template' type='text/x-mustache'>
|
||||
{{#images}}
|
||||
<div class="image-section {{class}}">
|
||||
<div class="image-wrap">
|
||||
<button class="run-functions-button">
|
||||
<span class="no-touch-label">Click</span>
|
||||
<span class="touch-label">Tap</span>
|
||||
</button>
|
||||
<img class="target-image" src="{{file}}" />
|
||||
</div>
|
||||
<div class="color-thief-output"></div>
|
||||
</div>
|
||||
{{/images}}
|
||||
</script>
|
||||
|
||||
<script id="color-thief-output-template" type="text/x-mustache">
|
||||
<div class="function get-color">
|
||||
<h3 class="function-title">Dominant Color</h3>
|
||||
<div class="swatches">
|
||||
<div class="swatch" style="background-color: rgb({{color.0}}, {{color.1}}, {{color.2}})"></div>
|
||||
|
||||
<!-- Mustache templates -->
|
||||
<script id='image-section-template' type='text/x-mustache'>
|
||||
{{#images}}
|
||||
<div class="image-section {{class}}">
|
||||
<div class="image-wrap">
|
||||
<button class="run-functions-button">
|
||||
<span class="no-touch-label">Click</span>
|
||||
<span class="touch-label">Tap</span>
|
||||
</button>
|
||||
<img class="target-image" src="{{file}}" />
|
||||
</div>
|
||||
<div class="color-thief-output"></div>
|
||||
</div>
|
||||
<div class="function-code">
|
||||
<code>colorThief.getColor(image):{{elapsedTimeForGetColor}}ms</code>
|
||||
</div>
|
||||
</div>
|
||||
<div class="function get-palette">
|
||||
<h3 class="function-title">Palette</h3>
|
||||
<div class="function-output">
|
||||
{{/images}}
|
||||
</script>
|
||||
|
||||
<script id="color-thief-output-template" type="text/x-mustache">
|
||||
<div class="function get-color">
|
||||
<h3 class="function-title">Dominant Color</h3>
|
||||
<div class="swatches">
|
||||
{{#palette}}
|
||||
<div class="swatch" style="background-color: rgb({{0}}, {{1}}, {{2}})"></div>
|
||||
{{/palette}}
|
||||
<div class="swatch" style="background-color: rgb({{color.0}}, {{color.1}}, {{color.2}})"></div>
|
||||
</div>
|
||||
<div class="function-code">
|
||||
<code>colorThief.getColor(image):{{elapsedTimeForGetColor}}ms</code>
|
||||
</div>
|
||||
</div>
|
||||
<div class="function-code">
|
||||
<code>colorThief.getPalette(image):{{elapsedTimeForGetPalette}}ms</code>
|
||||
<div class="function get-palette">
|
||||
<h3 class="function-title">Palette</h3>
|
||||
<div class="function-output">
|
||||
<div class="swatches">
|
||||
{{#palette}}
|
||||
<div class="swatch" style="background-color: rgb({{0}}, {{1}}, {{2}})"></div>
|
||||
{{/palette}}
|
||||
</div>
|
||||
</div>
|
||||
<div class="function-code">
|
||||
<code>colorThief.getPalette(image):{{elapsedTimeForGetPalette}}ms</code>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</script>
|
||||
</script>
|
||||
|
||||
|
||||
<script src="demo.js"></script>
|
||||
<script type="text/javascript">
|
||||
var _gaq = _gaq || [];
|
||||
_gaq.push(['_setAccount', 'UA-2196019-1']);
|
||||
_gaq.push(['_trackPageview']);
|
||||
<script src="js/jquery.js"></script>
|
||||
<script src="js/mustache.js"></script>
|
||||
<script src="js/color-thief.js"></script>
|
||||
<script src="js/demo.js"></script>
|
||||
|
||||
(function() {
|
||||
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
|
||||
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
|
||||
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
|
||||
})();
|
||||
</script>
|
||||
<script type="text/javascript">
|
||||
var _gaq = _gaq || [];
|
||||
_gaq.push(['_setAccount', 'UA-2196019-1']);
|
||||
_gaq.push(['_trackPageview']);
|
||||
|
||||
(function() {
|
||||
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
|
||||
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
|
||||
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
|
||||
})();
|
||||
</script>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
||||
Reference in New Issue
Block a user