-
Notifications
You must be signed in to change notification settings - Fork 56
/
index.html
181 lines (112 loc) · 8.11 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
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
<!doctype html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title>tiltShift.js - a jQuery plugin using CSS3 filters to replicate the tilt shift effect</title>
<meta name="description" content="Use this jQuery plugin to mimic the popular tilt-shift photography effect.">
<meta name="viewport" content="width=device-width">
<link rel="stylesheet" href="example/example.css">
<link rel="stylesheet" href="jquery.tiltShift.css">
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
<script src="jquery.tiltShift.js"></script>
<!-- tiltShift plugin start -->
<script>
jQuery(document).ready(function() {
$('.tiltshift').tiltShift();
});
</script>
<!-- tiltShift plugin end (I know, was crazy) -->
</head>
<body>
<article id="main">
<div class="social">
<div style="position:relative;top:35px;display:inline">
<a href="https://twitter.com/share" class="twitter-share-button" data-text="tiltShift.js - a jQuery plugin using CSS3 filters to replicate the tiltshift effect" data-via="noeltock" data-size="large">Tweet</a>
<script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0];if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src="//platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs");</script>
</div>
<div style="position:relative;top:33px;display:inline">
<div class="g-plusone"></div>
</div>
</div>
<header>
<h1>tiltShift.js</h1>
<p>A jQuery plugin that uses the CSS3 image filters to replicate the tilt-shift effect. This is a proof of concept and currently <strong>only works in Chrome & Safari 6</strong>.</p>
</header>
<!-- tiltshift example 1 -->
<div class="frame">
<img src="example/example2.jpg" class="tiltshift" data-position="55" data-blur="2" data-focus="15" data-falloff="10" data-direction="y" alt="See credits at bottom of page for Photograpger link">
</div>
<!-- tiltshift example 2 -->
<div class="frame">
<img src="example/example1.jpg" class="tiltshift" data-position="70" data-blur="1" data-focus="10" data-falloff="20" data-direction="y" alt="See credits at bottom of page for Photograpger link">
</div>
<!-- tiltshift example 3 -->
<div class="frame">
<img src="example/example3.jpg" class="tiltshift" data-position="50" data-blur="2" data-focus="10" data-falloff="10" data-direction="y" alt="See credits at bottom of page for Photograpger link">
</div>
<!-- tiltshift example 4 -->
<div class="frame">
<img src="example/example4.jpg" class="tiltshift" data-position="50" data-blur="2" data-focus="4" data-falloff="6" data-direction="x" alt="See credits at bottom of page for Photograpger link">
</div>
<div class="clear"></div>
<h2>download</h2>
<p>Download <a href="https://github.com/noeltock/tiltShift.js/zipball/master" rel="nofollow">here</a> or go to <a href="https://github.com/noeltock/tiltShift.js">github</a>. Released under <a href="http://www.gnu.org/licenses/" rel="nofollow">GPL</a></p>
<h2>how to use</h2>
<p>Call the plugin on any collection of images you want by adding the following jQuery:</p>
<code>
jQuery(document).ready(function() {<br />
$('.tiltshift').tiltShift();<br />
});
</code>
<p>Parameters on each image must be set using the HTML5 data attributes, like this:</p>
<code><img src="url" class="tiltshift" data-position="50" data-blur="2" data-focus="10" data-falloff="10" data-direction="y"></code>
<p>The attributes will control various variables that influence the tiltshift effect.</p>
<ul>
<li><strong>-position</strong> (0-100), defines the point of focus. 66 would be two thirds of the way in.</li>
<li><strong>-blur</strong> (0-?), the blur radius in pixels. 1 or 2 are usually good numbers.</li>
<li><strong>-focus</strong> (0-100), the amount of area that is in focus. 10 would mean one tenth of the image is sharp.</li>
<li><strong>-falloff</strong> (0-100), the amount of area between complete focus and complete blur. The lower the value, the “tighter” the fade.</li>
<li><strong>-direction</strong> (“x”, “y”, or 0-360), the direction of the effect with zero at right.</li>
</ul>
<h2>notes</h2>
<ul>
<li>As previously stated, currently only supported by <strong>Chrome & Safari 6</strong>. CSS3 filters are not widely supported, and Firefox/Mozilla to my knowledge only support SVG's for it's mask property.</li>
<li>Wraps a DIV around the IMG tag, so you may want to apply to same styling attributes to the selector '.tiltshift-wrap'</li>
<li>Pull requests? Yes, happy to make this more rigid across different browsers.</li>
</ul>
<h2>authors</h2>
<p class="avatar"><img src="https://secure.gravatar.com/avatar/7e494cc062198b60f811d1b5040070d6?s=80"></p>
<p>tiltShift.js is brought to you by <a href="http://www.noeltock.com" rel="author">Noel Tock</a>, a WordPress, front-end and startup dude. I also <a href="http://www.noeltock.com/blog/">blog</a> from time to time. Follow me on Twitter here:</p>
<a href="https://twitter.com/noeltock" class="twitter-follow-button" data-show-count="false" data-size="large">Follow @noeltock</a>
<p class="avatar"><img src="https://secure.gravatar.com/avatar/7867a8448172ae1aff3b2b50e86addb5?s=80"></p>
<p>Additional code by <a href="http://adam.yanalunas.com" rel="author">Adam Yanalunas</a>, a dude who is <a href="http://adam.yanalunas.com/blog">passionate about stuff</a> and things … especially front-end development stuff and JavaScript things.</p>
<a href="https://twitter.com/adamyanalunas" class="twitter-follow-button" data-show-count="false" data-size="large">Follow @adamyanalunas</a>
<script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0];if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src="//platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs");</script>
<div class="clear"></div>
<h2>photo credits</h2>
<p>If you're interested in licensing any of the images, please contact the photographers by following the links below:</p>
<a href="http://www.flickr.com/photos/stevec77/2841222052/in/photostream" rel="nofollow" target="_blank">Airplane</a> /
<a href="http://www.flickr.com/photos/seattlemunicipalarchives/3836684671/" rel="nofollow" target="_blank">Stadium</a> /
<a href="http://www.flickr.com/photos/nattu/2691652187/" rel="nofollow" target="_blank">Ocean</a> /
<a href="http://www.flickr.com/photos/hyunlab/309527428/" rel="nofollow" target="_blank">Skyscraper</a>
</article>
<!-- Place this tag after the last +1 button tag. -->
<script type="text/javascript">
(function() {
var po = document.createElement('script'); po.type = 'text/javascript'; po.async = true;
po.src = 'https://apis.google.com/js/plusone.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(po, s);
})();
</script>
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-10064035-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>