This repository has been archived by the owner on Mar 31, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
113 lines (107 loc) · 5.02 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
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>PyConTW Pass</title>
<meta httpEquiv="X-UA-Compatible" content="IE=edge,chrome=1" />
<meta name="description" content="" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
<meta name="apple-itunes-app" content="app-id=1387312806, app-argument=" />
<meta name="google-play-app" content="app-id=org.pycontw.ccip" />
<link rel="shortcut icon" href="favicon.ico" />
<link rel="manifest" href="" />
<link rel="stylesheet" href="css/normalize.css" />
<link rel="stylesheet" href="css/main.css" />
</head>
<body style="overflow:hidden;">
<div id="block">
<img id="icon" src="img/AppIcon.png" />
<div id="background"></div>
<h1>PyConTW Pass</h1>
<p id='desc'>下載應用程式後,即可登入使用。</p>
<div id="store">
<a href="#" id="goosrc"></a><a href="#" id="appsrc"></a>
<a href="#" id="iosLogin">iOS 安裝完 App 後,請點此登入!</a>
<!-- <a href="https://ccip-app.github.io/CCIP-Web-Bueno/" id="websrc">Web App (PWA)</a> -->
</div>
</div>
<div id="background-house-container">
<!-- <div class="subpage--banner">
<div id="hero">
<div class="layer-bg layer"></div>
<div class="layer-1 layer"></div>
<div class="layer-2 layer"></div>
<div class="layer-3 layer"></div>
</div>
</div> -->
</div>
<script>
function parameters() {
return location.search.split('?').pop().split('&').map(function(p) {
var ps = p.split('=');
var o = {};
o[ps.shift()] = ps.join('=');
return o;
}).reduce(function(a, b) {
var o = a;
for (var k in b) {
o[k] = b[k];
}
return o;
});
}
window.onload = function () {
var appsrc = document.getElementById('appsrc');
var goosrc = document.getElementById('goosrc');
var iosLogin = document.getElementById('iosLogin');
// var websrc = document.getElementById('websrc');
appsrc.setAttribute('href', 'https://itunes.apple.com/app/id' + document.querySelector('meta[name="apple-itunes-app"]').content.split(',').shift().trim().split('=').pop().trim());
goosrc.setAttribute('href', 'https://play.google.com/store/apps/details?id=' + document.querySelector('meta[name="google-play-app"]').content.split('=').pop());
if ((parameters().token || '').length != 0) {
// websrc.setAttribute('href', 'https://ccip-app.github.io/CCIP-Web-Bueno/?token=' + parameters().token);
iosLogin.setAttribute('href', 'https://ccip-app.github.io/CCIP-Web-Bueno/?token=' + parameters().token);
}
var mobile = {
iOS: navigator.userAgent.match(/iPhone|iPad|iPod/i) ? true : false,
Android: navigator.userAgent.match(/Android/i) ? true : false
};
if (mobile.iOS) {
goosrc.style.display = 'none';
appsrc.classList.add('one');
if ((parameters().token || '').length != 0) {
iosLogin.setAttribute('href', 'ccip://login/?token=' + parameters().token);
iosLogin.style.display = 'block';
}
} else if (mobile.Android) {
appsrc.style.display = 'none';
goosrc.classList.add('one');
if ((parameters().token || '').length != 0) {
iosLogin.setAttribute('href', 'ccip://login/?token=' + parameters().token);
iosLogin.style.display = 'block';
}
}
// var move = document.getElementById('background-house-container');
// move.addEventListener('touchstart', function () {
// var top = move.scrollTop
// var totalScroll = move.scrollHeight
// var currentScroll = top + move.offsetHeight
// if (top === 0) {
// move.scrollTop = 1
// } else if (currentScroll === totalScroll) {
// move.scrollTop = top - 1
// }
// })
var language = (navigator.languages[0] || navigator.language || navigator.browserLanguage).toLowerCase();
if (language != 'zh-tw') {
document.getElementById('desc').textContent = 'Download the app and use it for login.';
iosLogin.textContent = 'Click \'Login\' after you install the app.';
// websrc.textContent = 'Simple Web app';
}
}
</script>
<noscript>
<center>如有任何問題 請打開 JavaScript 和 關閉廣告攔截</center>
<center>If any problem, please enable JavaScript and turn off any AD blocker.</center>
</noscript>
</body>
</html>