/
ios.html
89 lines (81 loc) · 2.53 KB
/
ios.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
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="user-scalable=no, initial-scale=1, maximum-scale=1, minimum-scale=1, width=device-width">
<link href="../dist/styles/ios/style.css" rel="stylesheet">
<script src="../dist/styles/ios/animates.js"></script>
<script src="../dist/pullToRefresh.js"></script>
<meta name="theme-color" content="#f7f7f8">
<title>Pull to refresh - iOS</title>
<style>
body {
margin: 0;
margin-top: 44px;
font-family: sans-serif;
background: #fafafa;
}
header {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 44px;
line-height: 44px;
font-size: 17px;
font-weight: bold;
color: #000;
text-align: center;
background: #f7f7f8;
z-index: 9999;
border-bottom: 1px solid #c4c4c4;
box-sizing: border-box;
}
main {
height: 1000px;
background: #fff;
padding: 1em;
}
h1 {
font-size: 18px;
text-align: center;
padding-top: 8em;
}
</style>
</head>
<body>
<header>Header</header>
<div class="container pull-to-refresh-ios">
<div class="pull-to-refresh-ios__spinner">
<div class="pull-to-refresh-ios__blade"></div>
<div class="pull-to-refresh-ios__blade"></div>
<div class="pull-to-refresh-ios__blade"></div>
<div class="pull-to-refresh-ios__blade"></div>
<div class="pull-to-refresh-ios__blade"></div>
<div class="pull-to-refresh-ios__blade"></div>
<div class="pull-to-refresh-ios__blade"></div>
<div class="pull-to-refresh-ios__blade"></div>
<div class="pull-to-refresh-ios__blade"></div>
<div class="pull-to-refresh-ios__blade"></div>
<div class="pull-to-refresh-ios__blade"></div>
<div class="pull-to-refresh-ios__blade"></div>
</div>
<main class="pull-to-refresh-ios__main">
<h1>Pull down to refresh</h1>
<p>Pulling up should shrink the address bar in Chrome mobile and Safari mobile</p>
<p>1</p><p>2</p><p>3</p><p>4</p><p>5</p><p>6</p><p>7</p><p>8</p><p>9</p><p>10</p><p>11</p><p>12</p>
</main>
</div>
<script>
pullToRefresh({
container: document.querySelector('.container'),
animates: ptrAnimatesIos,
refresh() {
return new Promise(resolve => {
setTimeout(resolve, 2000)
})
}
})
</script>
</body>
</html>