-
Notifications
You must be signed in to change notification settings - Fork 9
/
index.html
73 lines (55 loc) · 2.52 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
<!DOCTYPE html>
<html>
<head>
<meta name="description" content="Adaptive Backgrounds.js - a JavaScript plugin for extracting the dominant color from images and applying the color to their parent." />
<meta charset=utf-8 />
<title>Adaptive Backgrounds.js - a JavaScript plugin for extracting the dominant color from images and applying the color to their parent.</title>
<link rel="stylesheet" href="style.css" />
</head>
<body>
<header>
<div class="wrap">
<h1><a href="/">Adaptive Backgrounds.js</a></h1>
<span><b>A JavaScript plugin for extracting the dominant color from images and applying the color to their parent.</b></span>
<div class="clearfix"></div>
</div>
</header>
<div class="wrap">
<div class="centerChildren">
<a class="button" href="https://github.com/benhowdle89/Adaptive-Backgrounds">GitHub</a>
<a class="button" href="https://github.com/benhowdle89/Adaptive-Backgrounds/archive/gh-pages.zip">Download</a>
</div>
<ul>
<li><b>Simply set a data attribute on desired images and the plugin will apply the image's dominant color to it's parent element's background.</b></li>
<li><b>Caveat:</b> Doesn't work with remote images if the respective server has CORS disabled, ie. it won't work with Flickr URLs...</li>
<li><b>Credit</b>: Heavily inspired by <a href="https://github.com/briangonzalez/jquery.adaptive-backgrounds.js">jquery.adaptive-backgrounds.js</a> - basically, it's the jQuery free version.</li>
<li>Browser support: IE9+</li>
</ul>
<hr />
<h3>Usage</h3>
<script src="https://gist.github.com/benhowdle89/d43a36f4a5f184d0f5ce.js"></script>
<h3>Example</h3>
<script src="https://gist.github.com/benhowdle89/96f290fa34b11b9d8b69.js"></script>
<h3>Demo</h3>
<div class="imgWrap">
<img class="center" src="6.jpg" data-adaptive-background="1" />
</div>
<div class="centerChildren">
<a class="button" href="https://github.com/benhowdle89/Adaptive-Backgrounds">GitHub</a>
<a class="button" href="https://github.com/benhowdle89/Adaptive-Backgrounds/archive/gh-pages.zip">Download</a>
</div>
</div>
</div>
<footer>
<hr />
<div class="wrap">
<p class="fLeft">Made by <a href="http://benhowdle.im">Ben Howdle</a></p>
<p class="fRight"><a class="btn" href="https://twitter.com/intent/tweet?text=Adaptive Backgrounds.js&url=http://cl.ly/Szcp" target="_BLANK">Tweet →</a></p>
</div>
</div>
<script type="text/javascript" src="adaptive-backgrounds.js"></script>
<script type="text/javascript">
AdaptiveBackgrounds();
</script>
</body>
</html>