-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.html
179 lines (161 loc) · 4.97 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
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Redirecting ...</title>
<meta name="description"
content="This page will redirect you to our app in the app store.">
<script type="text/javascript">
function executeRedirect() {
// Enable / disable debugging for testing:
var debug = true;
var googleStoreUrl = document.getElementById('google-store-link');
var appleStoreUrl = document.getElementById('apple-store-link');
// Use Google Play Store as fallback by default (may be changed)!
var fallbackStoreUrl = googleStoreUrl;
var userAgent = navigator.userAgent || navigator.vendor || window.opera;
// Android devices:
if (googleStoreUrl && /android/i.test(userAgent)) {
if (debug) { alert('Detected: Android device'); }
window.location.href = googleStoreUrl;
}
// Apple devices:
else if (appleStoreUrl && /iPad|iPhone|iPod/.test(userAgent) && !window.MSStream) {
if (debug) { alert('Detected: Apple device'); }
window.location.href = appleStoreUrl;
}
// Fallback: Windows and other devices:
else if (fallbackStoreUrl) {
if (debug) { alert('Detected: Unknown device. Redirecting to fallback.'); }
// Otherwise redirct to the fallback store URL:
window.location.href = fallbackStoreUrl;
} else {
// Log error to console if no redirect was possible.
console.error('NO REDIRECT: User agent could not be detected and fallback app store url was not set.');
}
}
</script>
<style>
.ci-color,
a {
background-color: #2E90D0 !important;
color: #FFF;
}
html,
body {
margin: 0;
padding: 0;
width: 100%;
height: 100vh;
display: flex;
flex-direction: row;
justify-content: center;
align-items: center;
background-color: #6b6b6b;
color: #FFF;
font-family: 'Verdana', 'Arial', sans-serif;
font-size: 14px;
overflow: hidden;
}
body {
background: linear-gradient(160deg, rgba(71, 71, 71, 0.8) 20%,
rgba(119, 119, 119, 0.5) 20%,
rgba(77, 77, 77, 0.5) 35%,
rgba(53, 53, 53, 0.6) 35%,
rgba(56, 56, 56, 0.8) 45%,
rgba(43, 43, 43, 0.5) 45%,
rgba(46, 46, 46, 0.8) 75%,
rgba(82, 82, 82, 0.5) 75%),
linear-gradient(45deg, rgba(31, 31, 31, 0.8) 0%,
rgba(46, 46, 46, 0.8) 50%,
rgba(128, 128, 128, 0.8) 50%,
rgba(133, 146, 173, 0.8) 100%) #6b6b6b;
}
h1 {
font-size: 1.6em;
}
div#container {
width: 100%;
max-width: 920px;
text-align: center;
overflow: visible;
}
.subtitle {
font-style: italic;
}
.button-wrapper {
border: 1px #000 solid;
/* border-radius: 20px; */
margin: 20px;
padding: 20px;
background-color: #FFF;
text-align: center;
transition: 1s;
box-shadow: 6px 6px 0 #000;
transform: skewX(-15deg);
}
.button-wrapper::after {
content: '';
width: 60px;
height: 30px;
transform: skewX(-15deg);
border: 1px solid #FFF;
position: absolute;
z-index: -1;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
animation: pulse 3s infinite;
}
@keyframes pulse {
0% {
width: 100%;
height: 100%;
opacity: 0.8;
}
100% {
width: 300%;
max-width: 100vw;
height: 300%;
max-height: 100vh;
opacity: 0;
}
}
.row {
display: flex;
flex-direction: row;
flex-wrap: wrap;
}
.column {
flex: 50%;
min-width: 300px;
}
</style>
</head>
<body>
<div id="container">
<h1>You will now be redirected to our Apps, based on your device ...</h1>
<p class="subtitle">Otherwise select one of:</p>
<div id="stores" class="row">
<div class="store column" id="g">
<div class="button-wrapper ci-color">
<a href="https://play.google.com/store/apps/details?id=[PACKAGE-NAME]"
id="google-store-link"><strong>[APP-NAME]</strong><br />in Google Play
Store</a>
</div>
</div>
<div class="store column" id="a">
<div class="button-wrapper ci-color">
<a href="http://apps.apple.com/[COUNTRY]/app/[APP-NAME]/id[STORE-ID]]"
id="apple-store-link"><strong>[APP-NAME]</strong><br />in Apple App
Store</a>
</div>
</div>
</div>
</div>
<script type="text/javascript">
executeRedirect();
</script>
</body>
</html>