mirror of
https://github.com/janishutz/color-thief.git
synced 2025-11-25 13:54:25 +00:00
Strip example page. Simplify for test cases
This commit is contained in:
108
index.html
108
index.html
@@ -1,126 +1,44 @@
|
|||||||
<!doctype html>
|
<!doctype html>
|
||||||
<html class="no-js" lang="en">
|
<html lang="en">
|
||||||
<head>
|
<head>
|
||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
|
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
|
||||||
|
|
||||||
<title>Color Thief</title>
|
<title>Color Thief</title>
|
||||||
|
|
||||||
<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">
|
|
||||||
|
|
||||||
<link rel="stylesheet" href="http://fonts.googleapis.com/css?family=Karla%7CMontserrat:700">
|
|
||||||
<link rel="stylesheet" href="examples/css/screen.css">
|
<link rel="stylesheet" href="examples/css/screen.css">
|
||||||
|
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
|
|
||||||
<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>
|
|
||||||
|
|
||||||
<a href="https://github.com/lokesh/color-thief/" class="button">
|
|
||||||
Download from Github</small>
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
</header>
|
|
||||||
|
|
||||||
<section id="examples" class="examples-section">
|
|
||||||
<div class="container">
|
|
||||||
<h2>Examples</h2>
|
|
||||||
<div id="example-images"></div>
|
<div id="example-images"></div>
|
||||||
</div>
|
|
||||||
</section>
|
|
||||||
|
|
||||||
<section id="drag-drop" class="drag-drop-section">
|
<script id='image-tpl' type='text/x-mustache'>
|
||||||
<div class="container">
|
{{#.}}
|
||||||
<h2>Try it yourself</h2>
|
<div class="image-section">
|
||||||
<div id="drop-zone" class="drop-zone">
|
<img class="image" src="examples/img/{{.}}" />
|
||||||
<div class="drop-zone-label default-label">Drag an image here</div>
|
<div class="output"></div>
|
||||||
<div class="drop-zone-label dragging-label">Drop it!</div>
|
|
||||||
</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>
|
|
||||||
</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>
|
|
||||||
{{/images}}
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<script id="color-thief-output-template" type="text/x-mustache">
|
<script id="output-tpl" type="text/x-mustache">
|
||||||
<div class="function get-color">
|
<div class="get-color">
|
||||||
<h3 class="function-title">Dominant Color</h3>
|
<h2>Dominant Color</h3>
|
||||||
<div class="swatches">
|
<div class="swatches"></div>
|
||||||
<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>
|
<code>colorThief.getColor(image):{{elapsedTimeForGetColor}}ms</code>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
<div class="get-palette">
|
||||||
<div class="function get-palette">
|
<h2>Palette</h3>
|
||||||
<h3 class="function-title">Palette</h3>
|
|
||||||
<div class="function-output">
|
|
||||||
<div class="swatches">
|
<div class="swatches">
|
||||||
{{#palette}}
|
{{#palette}}
|
||||||
<div class="swatch" style="background-color: rgb({{0}}, {{1}}, {{2}})"></div>
|
<div class="swatch" style="background-color: rgb({{0}}, {{1}}, {{2}})"></div>
|
||||||
{{/palette}}
|
{{/palette}}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
|
||||||
<div class="function-code">
|
|
||||||
<code>colorThief.getPalette(image):{{elapsedTimeForGetPalette}}ms</code>
|
<code>colorThief.getPalette(image):{{elapsedTimeForGetPalette}}ms</code>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
||||||
<script src="src/color-thief.js"></script>
|
<script src="src/color-thief.js"></script>
|
||||||
<script src="examples/js/jquery.js"></script>
|
|
||||||
<script src="examples/js/mustache.js"></script>
|
<script src="examples/js/mustache.js"></script>
|
||||||
<script src="examples/js/demo.js"></script>
|
<script src="examples/js/demo.js"></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>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|||||||
Reference in New Issue
Block a user