This repository has been archived by the owner on Nov 18, 2017. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
81 lines (59 loc) · 4.65 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
<!DOCTYPE html>
<html lang="en-us">
<head>
<meta charset="UTF-8">
<title>Simple-webp by ymatuhin</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" type="text/css" href="stylesheets/normalize.css" media="screen">
<link href='http://fonts.googleapis.com/css?family=Open+Sans:400,700' rel='stylesheet' type='text/css'>
<link rel="stylesheet" type="text/css" href="stylesheets/stylesheet.css" media="screen">
<link rel="stylesheet" type="text/css" href="stylesheets/github-light.css" media="screen">
</head>
<body>
<section class="page-header">
<h1 class="project-name">Simple-webp</h1>
<h2 class="project-tagline"></h2>
<a href="https://github.com/ymatuhin/simple-webp" class="btn">View on GitHub</a>
<a href="https://github.com/ymatuhin/simple-webp/zipball/master" class="btn">Download .zip</a>
<a href="https://github.com/ymatuhin/simple-webp/tarball/master" class="btn">Download .tar.gz</a>
</section>
<section class="main-content">
<h2><a id="user-content-about" class="anchor" href="#about" aria-hidden="true"><span class="octicon octicon-link"></span></a>About</h2>
<p>This micro lib replace images with attr <code>webp</code> to webp image if webp supported.
And if image is loaded — do nothing, else change src to <code>.webp</code>.</p>
<h2><a id="user-content-examples" class="anchor" href="#examples" aria-hidden="true"><span class="octicon octicon-link"></span></a>Usage</h2>
<p>Via Bower</p><div class="highlight highlight-bash"><pre>bower install simple-webp --save</pre></div>
<p>or <a href="https://github.com/ymatuhin/simple-webp/archive/master.zip">download the zip</a>.</p>
<p>Put in header</p>
<div class="highlight highlight-html"><pre><span class="pl-s1"> <<span class="pl-ent">script</span> <span class="pl-e">async</span> <span class="pl-e">src</span>=<span class="pl-s"><span class="pl-pds">"</span>simple-webp.min.js<span class="pl-pds">"</span></span>></<span class="pl-ent">script</span>></span></pre></div>
<p>Wrap your image in noscript with data-webp attribute</p>
<div class="highlight highlight-html">
<pre> <<span class="pl-ent">noscript</span> <span class="pl-e">data-webp</span>><<span class="pl-ent">img</span> <span class="pl-e">src</span>=<span class="pl-s"><span class="pl-pds">"</span>example.jpg<span class="pl-pds">"</span></span> <span class="pl-e">alt</span>=<span class="pl-s"><span class="pl-pds">"</span><span class="pl-pds">"</span></span>></<span class="pl-ent">noscript</span>></pre>
</div>
<button><a href="./example/">Live preview</a></button>
<h2><a id="user-content-license" class="anchor" href="#license" aria-hidden="true"><span class="octicon octicon-link"></span></a>License</h2>
<p>(The MIT License)</p>
<p>Copyright (c) 2015 Yury <a href="mailto:[email protected]">[email protected]</a></p>
<p>Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
'Software'), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:</p>
<p>The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.</p>
<p>THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.</p>
<footer class="site-footer">
<span class="site-footer-owner"><a href="https://github.com/ymatuhin/simple-webp">Simple-webp</a> is maintained by <a href="https://github.com/ymatuhin">ymatuhin</a>. More about author in <a href="//ymatuhin.ru">blog</a>.</span>
<span class="site-footer-credits">This page was generated by <a href="https://pages.github.com">GitHub Pages</a> using the <a href="https://github.com/jasonlong/cayman-theme">Cayman theme</a> by <a href="https://twitter.com/jasonlong">Jason Long</a>.</span>
</footer>
</section>
</body>
</html>