forked from desandro/close-pixelate
-
Notifications
You must be signed in to change notification settings - Fork 1
/
examples.html
253 lines (214 loc) · 9.18 KB
/
examples.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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>Close Pixelate Examples</title>
<!-- IE HTML5 Shiv -->
<!--[if lte IE 8]><script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script><![endif]-->
<style media="screen">
body {
font-family: 'Helvetica Neue', Arial, sans-serif;
background: #111;
overflow-x: hidden;
color: #DDD;
line-height: 1.3em;
}
h1 { text-align: center; }
#portraits-wrap {
width: 960px;
margin: 0 auto;
}
#portraits {
position: relative;
width: 1600px;
left: -320px;
}
a { color: #E58; text-decoration: none; }
a:hover { color: #58E; }
article {
display: block;
margin-bottom: 6.0em;
}
figure { display: block; }
figcaption {
display: block;
text-align: center;
margin-bottom: 1.0em;
font-size: 14px;
}
article pre {
width: 600px;
padding: 1.0em;
margin: 0 auto;
border: 1px solid #222;
}
pre, code {
font-family: Monaco, monospace;
font-size: 12px;
}
.portrait {
background-color: black;
display: block;
margin: 0 auto 1.0em;
}
</style>
</head>
<body>
<h1>Close Pixelate Examples</h1>
<div id="portraits-wrap">
<div id="portraits">
<article>
<figure>
<img id="officer" class="portrait" src="img/officer.jpg" alt="Chinese officer @ Shanghai downtown market by Dusan Simonovic" />
<figcaption>Original photo: <a href="http://www.flickr.com/photos/madciapka/4521134773/"><em>Chinese officer @ Shanghai downtown market</em> by Dusan Simonovic</a></figcaption>
</figure>
<pre><code>{ shape : 'diamond', resolution : 48, size: 50 },
{ shape : 'diamond', resolution : 48, offset : 24 },
{ shape : 'circle', resolution : 8, size: 6 }</code></pre>
</article>
<article>
<figure>
<img id="stanley" class="portrait" src="http://farm5.static.flickr.com/4017/4528382432_454051eaaa_b.jpg" alt="$2 Portrait Project: Stanley by Troy Holden" />
<figcaption>Original photo: <a href="http://www.flickr.com/photos/troyholden/4528382432/"><em>$2 Portrait Project: Stanley</em> by Troy Holden</a></figcaption>
</figure>
<pre><code>{ resolution: 32 },
{ shape : 'circle', resolution : 32, offset: 15 },
{ shape : 'circle', resolution : 32, size: 26, offset: 13 },
{ shape : 'circle', resolution : 32, size: 18, offset: 10 },
{ shape : 'circle', resolution : 32, size: 12, offset: 8 }</code></pre>
</article>
<article>
<figure>
<img id="take-my-portrait" class="portrait" src="img/take-my-portrait.jpg" alt="Take My Portrait by Hamed Saber" />
<figcaption>Original photo: <a href="http://www.flickr.com/photos/hamed/590034637/"><em>Take My Portrait</em> by Hamed Saber</a></figcaption>
</figure>
<pre><code>{ resolution: 48 },
{ shape: 'diamond', resolution: 48, offset: 12, alpha: 0.5 },
{ shape: 'diamond', resolution: 48, offset: 36, alpha: 0.5 },
{ shape: 'circle', resolution: 16, size: 8, offset: 4, alpha: 0.5 }</code></pre>
</article>
<article>
<figure>
<img id="tony" class="portrait" src="img/tony.jpg" />
<figcaption>Original photo: <a href="http://www.flickr.com/photos/jon-luke/4512534558/"><em>Tony deep in thought (B&W)</em> by Jon-Luke</a></figcaption>
</figure>
<pre><code>{ shape: 'circle', resolution: 32, size: 6, offset: 8 },
{ shape: 'circle', resolution: 32, size: 9, offset: 16 },
{ shape: 'circle', resolution: 32, size: 12, offset: 24 },
{ shape: 'circle', resolution: 32, size: 9, offset: 0 }</code></pre>
</article>
<article>
<figure>
<img id="wonder" class="portrait" src="img/wonder.jpg" alt="Wonder by Kyrill Poole" />
<figcaption>Original photo: <em>Wonder</em> by <a href="http://www.flickr.com/photos/poolski/">Kyrill Poole</a></figcaption>
</figure>
<pre><code>{ shape: 'diamond', resolution: 24, size: 25 },
{ shape: 'diamond', resolution: 24, offset: 12 },
{ resolution: 24, alpha: 0.5 }</code></pre>
</article>
<article>
<figure>
<img id="anita" class="portrait" src="http://farm3.static.flickr.com/2045/1708261749_bed1631d31_b.jpg" alt="anita shlosse 04 c studio.es by Vincent Boiteau" />
<figcaption>Original photo: <a href="http://www.flickr.com/photos/2dogs_productions/1708261749/"><em>anita shlosse 04 © studio.es</em> by Vincent Boiteau</a></figcaption>
</figure>
<pre><code>{ shape: 'square', resolution: 32 },
{ shape: 'circle', resolution: 32, offset: 16 },
{ shape: 'circle', resolution: 32, offset: 0, alpha: 0.5 },
{ shape: 'circle', resolution: 16, size: 9, offset: 0, alpha: 0.5 }</code></pre>
</article>
<article>
<figure>
<img id="giraffe" class="portrait" src="http://farm2.static.flickr.com/1226/1300905195_1bd8f2fac0_b.jpg" alt="Giraffe Portrait - Woburn Safari Park - Monday August 27th 2007 by Keven Law" />
<figcaption>Original photo: <a href="http://www.flickr.com/photos/kevenlaw/1300905195/"><em>Giraffe Portrait - Woburn Safari Park - Monday August 27th 2007</em> by Keven Law</a></figcaption>
</figure>
<pre><code>{ shape : 'circle', resolution : 24 },
{ shape : 'circle', resolution : 24, size: 9, offset: 12 }</code></pre>
</article>
<article>
<figure>
<img id="kendra" class="portrait" src="img/kendra.jpg" alt="Kendra by Anna Kreslavskaya" />
<figcaption>Original photo: <a href="http://www.flickr.com/photos/kreslava/4518179955/"><em>Kendra</em> by Anna Kreslavskaya</a></figcaption>
</figure>
<pre><code>{ shape : 'square', resolution : 48, offset: 24 },
{ shape : 'circle', resolution : 48, offset : 0 },
{ shape : 'diamond', resolution : 16, size: 15, offset : 0, alpha : 0.6 },
{ shape : 'diamond', resolution : 16, size: 15, offset : 8, alpha : 0.6 }</code></pre>
</article>
<article>
<figure>
<img id="gavin" class="remote portrait" src="http://farm3.static.flickr.com/2754/4294580760_99624fea6f_b.jpg" alt="Portrait Of A Mayor by Troy Holden" />
<figcaption>Original photo: <a href="http://www.flickr.com/photos/troyholden/4294580760/"><em>Portrait Of A Mayor</em> by Troy Holden</a></figcaption>
</figure>
<pre><code>{ shape : 'square', resolution : 48 },
{ shape : 'diamond', resolution : 12, size: 8 },
{ shape : 'diamond', resolution : 12, size: 8, offset : 6 }</code></pre>
</article>
</div> <!-- #portraits -->
</div> <!-- #portraits-wrap -->
<script src="close-pixelate.js"></script>
<script>
var pixelations = {
'officer' : [
{ shape : 'diamond', resolution : 48, size: 50 },
{ shape : 'diamond', resolution : 48, offset : 24 },
{ shape : 'circle', resolution : 8, size: 6 }
],
'stanley' : [
{ resolution: 32 },
{ shape : 'circle', resolution : 32, offset: 15 },
{ shape : 'circle', resolution : 32, size: 26, offset: 13 },
{ shape : 'circle', resolution : 32, size: 18, offset: 10 },
{ shape : 'circle', resolution : 32, size: 12, offset: 8 }
],
'take-my-portrait' : [
{ resolution: 48 },
{ shape: 'diamond', resolution: 48, offset: 12, alpha: 0.5 },
{ shape: 'diamond', resolution: 48, offset: 36, alpha: 0.5 },
{ shape: 'circle', resolution: 16, size: 8, offset: 4, alpha: 0.5 }
],
'tony' : [
{ shape: 'circle', resolution: 32, size: 6, offset: 8 },
{ shape: 'circle', resolution: 32, size: 9, offset: 16 },
{ shape: 'circle', resolution: 32, size: 12, offset: 24 },
{ shape: 'circle', resolution: 32, size: 9, offset: 0 }
],
'wonder' : [
{ shape: 'diamond', resolution: 24, size: 25 },
{ shape: 'diamond', resolution: 24, offset: 12 },
{ resolution: 24, alpha: 0.5 }
],
'anita' : [
{ shape: 'square', resolution: 32 },
{ shape: 'circle', resolution: 32, offset: 16 },
{ shape: 'circle', resolution: 32, offset: 0, alpha: 0.5 },
{ shape: 'circle', resolution: 16, size: 9, offset: 0, alpha: 0.5 }
],
'giraffe' : [
{ shape : 'circle', resolution : 24 },
{ shape : 'circle', resolution : 24, size: 9, offset: 12 }
],
'kendra' : [
{ shape : 'square', resolution : 48, offset: 24 },
{ shape : 'circle', resolution : 48, offset : 0 },
{ shape : 'diamond', resolution : 16, size: 15, offset : 0, alpha : 0.6 },
{ shape : 'diamond', resolution : 16, size: 15, offset : 8, alpha : 0.6 }
],
'gavin' : [
{ shape : 'square', resolution : 48 },
{ shape : 'diamond', resolution : 12, size: 8 },
{ shape : 'diamond', resolution : 12, size: 8, offset : 6 },
]
};
var docReady = function() {
for ( var key in pixelations ) {
var img = document.getElementById( key ),
options = pixelations[key];
if ( img ) {
img.closePixelate( options )
}
}
};
window.addEventListener( 'DOMContentLoaded', docReady, false);
</script>
</body>
</html>