-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathindex.html
More file actions
119 lines (110 loc) · 4.92 KB
/
index.html
File metadata and controls
119 lines (110 loc) · 4.92 KB
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
<html>
<head>
<title>Email Image Placeholder</title>
<link href='http://fonts.googleapis.com/css?family=Gudea|Rancho' rel='stylesheet' type='text/css'>
<link href="styles/eip.css" rel="stylesheet" />
<link rel="shortcut icon" href="./favicon.ico" />
</head>
<body>
<div id="wrapper">
<div id="content">
<h1>Email Image Placeholder</h1>
<img src="images/alt-text.png" id="logo" />
<p>
alt text is super lame.
</p>
<p>
wouldn't it be nice if you could <strong>replace blocked or broken images</strong> with the suggestion of the image?
</p>
<p>
sure, you can embed images in your email, but that can make email very large very quickly.
</p>
<p>
start by putting your image's url in the field below.
</p>
</div>
<form action="javascript:void(0);" id="inputs">
<div class="ui-label">inputs</div>
<div class="input-wrapper url">
<label for="image-to-placehold" title="url for the image you would like to placehold"><strong>image to placehold:</strong></label>
<input type="text" id="image-to-placehold" name="imagetoplacehold" placeholder="image url..." />
</div>
<div class="input-wrapper">
<label for="closing-tags" title="whether to include closing html tags">closing tags?</label>
<input type="checkbox" checked="checked" id="closing-tags" />
</div>
<div class="input-wrapper">
<label for="pixel-size" title="the smaller the pixels, the larger in size the email will become">pixel size:</label>
<select id="pixel-size">
<option value="2">2 - caution: content length!</option>
<option value="5">5 - caution: content length!</option>
<option value="10" selected="selected">10</option>
<option value="15">15</option>
<option value="20">20</option>
<option value="25">25</option>
<option value="50">50</option>
</select>
</div>
<div class="input-wrapper placeholder-html">
<label for="placeholder-html" title="(optional) instead of using the pixelated image, use this html">placeholder html:</label>
<textarea id="placeholder-html"></textarea>
</div>
</form>
<div id="results">
<div class="ui-label">results</div>
<div class="output-wrapper content-length">
<label for="content-length" title="content length of resulting markup">content-length:</label>
<input id="content-length" value="" />
</div>
<div class="output-wrapper markup">
<label for="email-code" title="paste this into your email in place of your image">resulting markup:</label>
<textarea id="email-code"></textarea>
</div>
</div>
<div id="preview">
<div class="ui-label">preview</div>
<div class="looks">
<div id="what-it-looks-like-blocked"></div>
<h6>when images are blocked</h6>
</div>
<div class="looks">
<div id="what-it-looks-like-enabled"></div>
<h6>when images are enabled</h6>
</div>
<p id="transparency-warning">
<em>
a word of warning: image transparency yields some unfortunate results.
</em>
</p>
</div>
<div id="afterword">
<div class="ui-label">how it works</div>
<p>
<strong>a 0x0 div with overflow visible</strong> contans a table which uses your image as a background image. if it doesn't load, this table is transparent, showing the underlying markup.
</p>
<p>
<strong>the underlying image</strong> is a table whose cells are <pixel-size> x <pixel-size> and bgcolor is a sample of the image. the result is a pixelated version of your image.
</p>
<p>
<strong>if you can "draw" your image with html</strong>, or something that is close enough to make your point, enter that html into the <label for="placeholder-html">"placeholder html" field</label>.
</p>
<p id="hat-tip">
<strong>h/t</strong> to <a href="http://www.emailonacid.com/">Email on Acid</a> for their <a href="http://www.emailonacid.com/email-preview/mozify">Mozify</a> tool which inspired this. #emailgeniuses. another to <a href="http://www.corsproxy.com/">CORS Proxy</a> which allows this javascript code to access your images (on domains other than this one) otherwise blocked by the <a href="http://en.wikipedia.org/wiki/Same_origin_policy">same-origin policy</a>.
</p>
</div>
</div>
<script src="scripts/email-image-placeholder.js"></script>
<script src="scripts/eip.js"></script>
<a href="https://github.com/pmn4/EmailImagePlaceholder"><img style="position: absolute; top: 0; left: 0; border: 0;" src="https://s3.amazonaws.com/github/ribbons/forkme_left_darkblue_121621.png" alt="Fork me on GitHub"></a>
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-12173862-10']);
_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>