-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
200 lines (177 loc) · 5.66 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
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
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
<meta http-equiv="Content-Security-Policy" content="default-src * data: gap: content: https://ssl.gstatic.com; style-src * 'unsafe-inline'; script-src * 'unsafe-inline' 'unsafe-eval'">
<style>
.loader {
width: 90px;
height: 20px;
position: absolute;
top: 50%;
left: 50%;
margin-left: -10px;
-webkit-transform: translate(-50%, -50%);
transform: translate(-50%, -50%);
font-size: 0;
}
.loader-item {
display: inline-block;
width: 20px;
height: 20px;
margin-left: 10px;
border-radius: 50%;
background: black;
-webkit-animation: anim .8s infinite linear;
animation: anim .8s infinite linear;
}
.loader-item:nth-child(2) {
-webkit-animation-delay: -.6s;
animation-delay: -.6s;
}
.loader-item:nth-child(3) {
-webkit-animation-delay: -.4s;
animation-delay: -.4s;
}
@-webkit-keyframes anim {
0% {
-webkit-transform: translateY(0);
transform: translateY(0);
opacity: .2;
}
50% {
-webkit-transform: translateY(-10px);
transform: translateY(-10px);
opacity: .6;
}
100% {
-webkit-transform: translateY(0);
transform: translateY(0);
opacity: .2;
}
}
@keyframes anim {
0% {
-webkit-transform: translateY(0);
transform: translateY(0);
opacity: .2;
}
50% {
-webkit-transform: translateY(-10px);
transform: translateY(-10px);
opacity: .6;
}
100% {
-webkit-transform: translateY(0);
transform: translateY(0);
opacity: .2;
}
}
.p-main {
padding: 2rem;
text-align: center;
}
.error-title {
font-family: -apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,"Noto Sans",sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";
font-size: 2rem;
color: #dc3545;
}
.eror-subtitle {
font-family: -apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,"Noto Sans",sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";
font-size: 1.3rem;
}
.button {
font-family: -apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,"Noto Sans",sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";
display: inline-block;
background: #007bff;
color: #fff;
text-transform: uppercase;
padding: 20px 30px;
border-radius: 5px;
box-shadow: 0 17px 10px -10px rgba(0, 0, 0, 0.4);
cursor: pointer;
transition: all ease-in-out 300ms;
}
.fixed {
position: fixed;
bottom: 0;
right: 0;
left: 0;
}
</style>
<script src="cordova.js"></script>
<script src="lib/jquery-3.3.1.js"></script>
<script>
document.addEventListener('deviceready', function () {
var notificationOpenedCallback = function(jsonData) {
console.log('notificationOpenedCallback: ' + JSON.stringify(jsonData));
};
window.plugins.OneSignal
.startInit('ffe000cc-4573-4082-9d14-48d29bee1129')
.handleNotificationOpened(notificationOpenedCallback)
.endInit();
}, false)
</script>
<script>
$.ajax({
type: "GET",
url: "https://www.google.com/",
success: function (suc) {
document.addEventListener("deviceready", onDeviceReady, false);
function onDeviceReady() {
inAppBrowserRef = cordova.InAppBrowser.open('http://getguard.ru', '_blank', 'location=no,toolbar=no,zoom=no');
inAppBrowserRef.addEventListener('exit', exitCallBack);
}
function exitCallBack() {
navigator.app.exitApp();
}
},
error: function (err) {
$(".loader").hide();
$("#offline").fadeIn();
}
});
function reLoad()
{
$(".loader").fadeIn();
$("#offline").hide();
$.ajax({
type: "GET",
url: "https://www.google.com/",
success: function (suc) {
document.addEventListener("deviceready", onDeviceReady, false);
function onDeviceReady() {
inAppBrowserRef = cordova.InAppBrowser.open('http://getguard.ru', '_blank', 'location=no,toolbar=no');
inAppBrowserRef.addEventListener('exit', exitCallBack);
}
function exitCallBack() {
navigator.app.exitApp();
}
},
error: function (err) {
$(".loader").hide();
$("#offline").fadeIn();
}
});
}
</script>
</head>
<body>
<div class="loader">
<div class="loader-item"></div>
<div class="loader-item"></div>
<div class="loader-item"></div>
</div>
<div id="offline" style="display:none">
<div class="p-main">
<img src="img/off.svg" style="width:100%">
<h1 class="error-title">Упс :(</h1>
<p class="eror-subtitle">Похоже Вы оффлайн</p>
</div>
<div class="p-main fixed">
<div class="button" onclick="reLoad()">Проверить снова</div>
</div>
</div>
</body>
</html>