-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
167 lines (163 loc) · 6.08 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
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1.0">
<link rel="manifest" href="./manifest.json">
<link rel="icon" href="./favicon.png"/>
<title>我要自习 - ISCNU</title>
<script>
// 暴力跳转
if (location.pathname === '/zixi') {
location.href = '/zixi/';
}
var _hmt = _hmt || [];
(function() {
var hm = document.createElement("script");
hm.src = "https://hm.baidu.com/hm.js?27e9ff3910a0106317bb3a6897cc0fa2";
var s = document.getElementsByTagName("script")[0];
s.parentNode.insertBefore(hm, s);
})();
</script>
</head>
<body>
<div class="container">
<!--复制 vue 生成的代码-->
<nav role="navigation" aria-label="main navigation" class="navbar">
<div class="navbar-brand">
<div class="navbar-item">
<a href="./" style="padding-top: .4rem;">
<img src="static/logo.png" style="width: 13rem;" alt="logo">
</a>
</div>
<div data-target="navMenu" class="navbar-burger"><span></span><span></span><span></span></div>
</div>
<div id="navMenu" class="navbar-menu">
<div class="navbar-end">
<a href="./about.html" class="navbar-item">关于</a>
<a id="pwaBtn" class="navbar-item" style="display: none">添加到主屏</a>
<a id="shortcutBtn" class="navbar-item" href="https://www.icloud.com/shortcuts/153b40b7e63c4b25bee77891a0b3d0cd" style="display: none">添加到捷径</a>
<div class="navbar-item has-dropdown is-hoverable" style="padding-left: 0;">
<a class="navbar-link">
更多
</a>
<div class="navbar-dropdown">
<a class="navbar-item" href="https://i.scnu.edu.cn/" target="_blank">
ISCNU主页
</a>
<a class="navbar-item" href="https://bbs.scnu.edu.cn/" target="_blank">
新陶园论坛
</a>
<a class="navbar-item" href="https://pt.scnu.edu.cn/" target="_blank">
陶园PT
</a>
<a class="navbar-item" href="https://wiki.scnu.edu.cn/" target="_blank">
华师百科
</a>
</div>
</div>
</div>
</div>
</nav>
</div>
<div class="container main-container">
<div id="app">
<div class="is-flex loaderContainer">
<div class="loader"></div>
</div>
</div>
</div>
<!-- built files will be auto injected -->
<div class="modal">
<div class="modal-background"></div>
<div class="modal-content">
<div class="image is-flex" style="align-items: center;justify-content: center">
<img src="static/qr.png" style="width: 300px;height:360px" alt="wechat_scnu">
</div>
</div>
<button class="modal-close is-large" aria-label="close"></button>
</div>
<footer class="footer">
<div class="container">
<div class="content is-pulled-right">
<a href="https://weibo.com/iscnu" class="contact contact-weibo" target="_blank"></a>
<a class="contact contact-wechat wechat_link" target="_blank"></a>
</div>
<div class="content is-small has-text-left">
<p>Copyright © 2008-2019 <a href="https://i.scnu.edu.cn/about" target="_blank">ISCNU</a> All rights Reserved.</br><a href="https://i.scnu.edu.cn/about" target="_blank" style="color:#38485a; text-decoration:none">华南师范大学网络协会</a>技术部出品</p>
</div>
</div>
</footer>
<script>
(function() {
let wechat = document.querySelector('.wechat_link');
if (navigator.userAgent.toLowerCase().indexOf('micromessenger') !== -1) {
wechat.setAttribute('href', 'https://mp.weixin.qq.com/mp/profile_ext?action=home&__biz=MzA5OTcwMzIxNA==&scene=124#wechat_redirect')
} else {
let wechat_close = document.querySelector('.modal-close')
let modal = document.querySelector('.modal');
wechat.onclick = function() {
modal.classList.toggle('is-active')
}
}
let $navbarBurger = document.querySelectorAll('.navbar-burger');
$navbarBurger.forEach(($el) => {
$el.onclick = function () {
let target = $el.dataset.target;
let $target = document.getElementById(target);
$el.classList.toggle('is-active');
$target.classList.toggle('is-active');
}
})
let $modalClose = document.querySelectorAll('.modal-close');
$modalClose.forEach($el => {
$el.onclick = function () {
$el.parentNode.classList.toggle('is-active');
}
})
})()
</script>
<script>
// Check that service workers are registered
if ('serviceWorker' in navigator) {
// Use the window load event to keep the page load performant
window.addEventListener('load', () => {
navigator.serviceWorker.register('./service-worker.js');
});
}
</script>
<script>
let deferredPrompt;
const pwaBtn = document.querySelector('#pwaBtn');
window.addEventListener('beforeinstallprompt', (e) => {
console.log("beforeinstallprompt")
// Prevent Chrome 67 and earlier from automatically showing the prompt
e.preventDefault();
// Stash the event so it can be triggered later.
deferredPrompt = e;
pwaBtn.style.display = 'flex';
});
pwaBtn.addEventListener('click', (e) => {
pwaBtn.style.display = 'none';
deferredPrompt.prompt();
deferredPrompt.userChoice
.then((choiceResult) => {
if (choiceResult.outcome === 'accepted') {
console.log('User accepted the A2HS prompt');
} else {
console.log('User dismissed the A2HS prompt');
}
deferredPrompt = null;
});
})
</script>
<script>
const userAgent = navigator.userAgent.toLowerCase();
const isIOS = (userAgent.indexOf('iphone') != -1) || (userAgent.indexOf('ipad') != -1);
const shortcutBtn = document.querySelector('#shortcutBtn');
if(isIOS && !window.BeforeInstallPromptEvent) {
shortcutBtn.style.display = 'flex';
}
</script>
</body>
</html>