forked from chase-moskal/webp-hero
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
30 lines (27 loc) · 912 Bytes
/
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
<!doctype html>
<html>
<head>
<meta charset="utf-8"/>
<title>webp-hero</title>
</head>
<body>
<h1>webp-hero</h1>
<p>view source on <a href="https://github.com/chase-moskal/webp-hero">github</a></p>
<img alt="" src="images/dice.webp"/>
<img alt="" src="images/landscape.webp"/>
<img alt="" src="images/firebreather.webp"/>
<script src="dist-cjs/polyfills.js"></script>
<script src="dist-cjs/webp-hero.bundle.js"></script>
<script>
// for this demo, you can add "?force" to the url to force webp conversion
var webpSupport = location.search.indexOf("force") !== -1
? Promise.resolve(false)
: undefined
// instance the webp machine
var webpMachine = new webpHero.WebpMachine({webpSupport: webpSupport})
// polyfill this entire document's webp images
webpMachine.polyfillDocument()
.catch(function(error) { console.error(error) })
</script>
</body>
</html>