-
Notifications
You must be signed in to change notification settings - Fork 0
/
remote.html
163 lines (138 loc) · 4.22 KB
/
remote.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
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="x-ua-compatible" content="ie=edge,chrome=1">
<meta name="renderer" content="webkit">
<meta name="viewport"
content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
<title>Title</title>
<!--载入所有的静态资源-->
<script src="js/lib/jquery.js"></script>
<script src="js/lib/jquery-ui.min.js"></script>
<script src="js/lib/jquery.fullPage.js"></script>
<!--H5对象:进行内容管理-->
<script src="js/H5.js"></script>
<link rel="stylesheet" href="css/H5.css">
<link rel="stylesheet" href="css/H5_loading.css">
<script src="js/H5_loading.js"></script>
<!--页面逻辑的样式-->
<style>
body {
margin: 0;
padding: 0;
}
.h5_page {
background-image: url(img/page_bg.png);
}
.h5_page_face {
background-image: url(img/face_bg.png);
}
.h5_component_name_slogan {
animation: rock 2s infinite 2s;
}
@keyframes rock {
0% {
transform: rotate(0deg);
}
5% {
transform: rotate(3deg);
}
10% {
transform: rotate(-4deg);
}
15% {
transform: rotate(3deg);
}
20% {
transform: rotate(-2deg);
}
25% {
transform: rotate(1deg);
}
30% {
transform: rotate(0deg);
}
70% {
transform: rotate(0deg);
}
100% {
transform: rotate(0deg)
}
}
.h5_component_name_caption {
background-image: url(img/page_caption_bg.png);
width: 283px;
height: 160px;
text-align: center;
line-height: 140px;
font-size: 20px;
color: #fff;
}
@keyframes back {
50% {
top: 20px;
}
}
.h5_component_name_back {
top: 30px;
animation: back 2s infinite 2s;
}
</style>
</head>
<body>
<div class="loading">
<div class="double-bounce1"></div>
<div class="double-bounce2"></div>
<div id="rate">0%</div>
</div>
<!--和loading不想关的内容放到下面-->
<!--加载H5组件相关资源-->
<script type="text/javascript">
var res = ['Base', 'Bar', 'Bar_v', 'Point', 'Polyline', 'Radar', 'Pie', 'Ring'];
var html = [];
for (s in res) {
html.push('<script src="js/H5Component' + res[s] + '.js"><\/script>');
html.push('<link rel="stylesheet" href="css/H5Component' + res[s] + '.css">');
}
document.write(html.join(' '));
</script>
<!--主要逻辑-->
<script>
$(function () {
var h5 = new H5();
// 每添加一页,都加一个同样的组件
h5.whenAddPage = function () {
this.addComponent('slide_up', {
bg: 'img/footer.png',
css: {
opacity: 0,
left: 0, bottom: -20,
width: '100%', height: 20, zIndex: 999
},
animateIn: {
opacity: 1, bottom: 0
},
animateOut: {
opacity: 0, bottom: -20
},
delay: 500
})
return this;
}
// 先考虑调用方式,再考虑编码方式,自顶向下
// 调用方式:链式调用
$.getJSON('data.json', function (json) {
$.each(json, function (i,item) {
if(item.isPage){
h5.addPage(item.name, item.text);
}else{
h5.addComponent(item.name, item.cfg);
}
})
h5.loader(['img/face_bg.png', 'img/face_logo.png', 'img/face_slogan.png', 'img/face_img_left.png', 'img/face_img_right.png', 'img/p1_people.png', 'img/tail_slogan.png', 'img/tail_share.png', 'img/tail_back.png'], 4);
})
})
</script>
</body>
</html>