-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
77 lines (69 loc) · 2.64 KB
/
index.html
File metadata and controls
77 lines (69 loc) · 2.64 KB
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
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Cotpear Account</title>
<script src="https://code.jquery.com/jquery-3.3.1.min.js"></script>
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/3.4.1/css/bootstrap.min.css">
<script src="https://stackpath.bootstrapcdn.com/bootstrap/3.4.1/js/bootstrap.min.js"></script>
<!-- Firebase App (the core Firebase SDK) is always required and must be listed first -->
<script src="https://www.gstatic.com/firebasejs/6.3.5/firebase-app.js"></script>
<!-- Add Firebase products that you want to use -->
<script src="https://www.gstatic.com/firebasejs/6.3.5/firebase-auth.js"></script>
<script src="https://www.gstatic.com/firebasejs/6.3.5/firebase-messaging.js"></script>
<script>
// Your web app's Firebase configuration
var firebaseConfig = {
apiKey: "AIzaSyC2coGnkX5hcFe0p3XjyiWQYvPZzdfAiVk",
authDomain: "yisblog.firebaseapp.com",
databaseURL: "https://yisblog.firebaseio.com",
projectId: "yisblog",
storageBucket: "yisblog.appspot.com",
messagingSenderId: "521466218776",
appId: "1:521466218776:web:d4c64bd9ec1bd0a2"
};
// Initialize Firebase
firebase.initializeApp(firebaseConfig);
</script>
</head>
<body>
<h1>歡迎使用Cotpear帳號系統</h1>
<div id="memberSystem_status" class="alert alert-info" style="display:none;"></div>
<div id="buttons_LoginedPart" class="card" style="width: 18rem;display:none;" >
<div class="card-body">
<div id="memberSystem_cash" class="btn btn-success">我的Cotpear幣</div>
<div id="memberSystem_info" class="btn btn-success">個人資料</div>
<div id="memberSystem_logout" class="btn btn-success">登出</div>
</div>
</div>
<div id="buttons_nonLoginedPart" class="card" style="width: 18rem;display:none;">
<div class="card-body">
<div id="memberSystem_login" class="btn btn-success">登入</div>
<div id="memberSystem_register" class="btn btn-success">註冊</div>
</div>
</div>
<script>
window.LoginedUser = null;
firebase.auth().onAuthStateChanged(function(user) {
if (user) {
// 已登入的用戶
window.LoginedUser = user;
$("#memberSystem_status").text("您屬於登入狀態")
$("#memberSystem_status").show()
$("#buttons_LoginedPart").show()
} else {
// 未登入
$("#memberSystem_status").text("您不在登入狀態")
$("#memberSystem_status").show()
$("#buttons_nonLoginedPart").show()
}
});
$("#memberSystem_login").click(function(){
location.href="/login"
})
$("#memberSystem_register").click(function(){
location.href="/register"
})
</script>
</body>
</html>