-
Notifications
You must be signed in to change notification settings - Fork 36
/
index.html
100 lines (90 loc) · 3.58 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
<html>
<head>
<meta charset="utf8">
<title>Fetch & Streams API Progress Indicators</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="icon" href="favicon.ico" type="image/png" />
<meta name="description" content="Examples for showing progress indicators with Streams, Service Workers, and Fetch">
<meta name="twitter:card" content="summary" />
<meta name="twitter:site" content="@AnthumChris" />
<meta name="og:title" content="Progress Indicators using Streams, Service Workers, and Fetch" />
<meta name="twitter:title" content="Progress Indicators using Streams, Service Workers, and Fetch" />
<meta name="og:description" content="Examples for showing progress indicators with Streams, Service Workers, and Fetch" />
<meta name="twitter:description" content="Examples for showing progress indicators with Streams, Service Workers, and Fetch" />
<meta name="og:image" content="https://fetch-progress.anthum.com/images/logo-streams-300.png" />
<meta name="twitter:image" content="https://fetch-progress.anthum.com/images/logo-streams-300.png" />
<style>
html, body {
margin: 0;
padding: 0;
color: #333;
}
body {
padding: 0 1em;
text-align: left;
font-family: sans-serif;
display: flex;
flex-flow: column nowrap;
justify-content: space-between;
max-width: 600px;
margin: 0 auto;
}
a {
text-decoration: underline;
}
footer {
padding: 1rem 0;
text-align: center;
}
footer a {
padding: .5em 1em;
display: inline-block;
}
p {
text-align: left;
line-height: 1.5em;
margin: 0 auto 1.5em auto;
}
code {
line-height: 1em;
}
h1 {
margin-bottom: 3rem;
font-size: 130%
}
h2 {
font-size: 110%;
margin-bottom: .25em;
}
</style>
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-50610215-6"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'UA-50610215-6');
</script>
</head>
<body>
<main>
<h1>Fetch & Streams API Progress Indicator Examples</h1>
<h2><a href="sw-basic/">Service Worker - Basic</a></h2>
<p>
An inline <code><img></code> tag renders on the page while a Service Worker and <code>ReadableStream</code> simultaneously provide download progress. Minimal code is used to exemplify the basic JavaScript requirements.
</p>
<h2><a href="fetch-basic/">Fetch - Basic</a></h2>
<p>
A <code>ReadableStream</code> shows progress while a remote image is downloaded with <code>fetch()</code>. Minimal code is used to exemplify the basic JavaScript requirements.
</p>
<h2><a href="fetch-enhanced/">Fetch - Enhanced</a></h2>
<p>
Similar to above with progress bars and robust code to handle real-world UI interactions. Downloads can be cancelled/restarted, multiple downloads are prevented, race conditions don't exist, errors edge cases are handled.
</p>
<h2>Service Worker - Enhanced UI</h2>
<p>[not yet started]. This will exemplify progress for multiple <code><img></code> tags, download cancellations, and other real-world UI interactions.</p>
</main>
<footer>
<a href="https://github.com/AnthumChris/fetch-progress-indicators">View on GitHub</a>
</footer>
</body>
</html>