2022-09-27 17:59:05 +08:00
<!DOCTYPE html>
< html >
< head >
< meta charset = "utf-8" / >
2023-04-20 15:08:55 +08:00
< meta name = "viewport" content = "width=device-width, initial-scale=1, viewport-fit=cover" / >
2023-05-19 12:50:23 +08:00
< meta name = "theme-color" / >
2023-02-16 12:14:00 +08:00
< meta name = "generator" content = "Answer - https://github.com/answerdev/answer" >
2022-09-27 17:59:05 +08:00
< link rel = "manifest" href = "%PUBLIC_URL%/manifest.json" / >
< / head >
< body >
< noscript > You need to enable JavaScript to run this app.< / noscript >
2022-11-10 18:06:18 +08:00
< div id = "root" >
2023-05-19 12:50:23 +08:00
2022-12-19 14:56:26 +08:00
< div id = "spin-mask" >
< noscript >
< style >
#spin-mask {
display: none !important;
}
2023-02-09 16:32:24 +08:00
2023-05-19 12:50:23 +08:00
#protect-browser {
2023-02-09 16:32:24 +08:00
display: none;
}
2022-12-19 14:56:26 +08:00
< / style >
< / noscript >
2022-12-18 09:24:16 +08:00
< style >
@keyframes _doc-spin {
to { transform: rotate(360deg) }
}
#spin-mask {
position: fixed;
top: 0;
right: 0;
bottom: 0;
left: 0;
background-color: white;
z-index: 9999;
}
#spin-container {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
}
#spin-container .spinner {
box-sizing: border-box;
display: inline-block;
width: 2rem;
height: 2rem;
vertical-align: -.125em;
border: .25rem solid currentColor;
border-right-color: transparent;
color: rgba(108, 117, 125, .75);
border-radius: 50%;
animation: 0.75s linear infinite _doc-spin;
}
2023-02-09 16:32:24 +08:00
2023-05-19 12:50:23 +08:00
#protect-browser {
2023-02-09 16:32:24 +08:00
padding: 20px;
text-align: center;
}
2022-12-18 09:24:16 +08:00
< / style >
< div id = "spin-container" >
< div class = "spinner" > < / div >
< / div >
2023-05-19 12:50:23 +08:00
< div id = "protect-browser" > < / div >
2022-11-10 18:06:18 +08:00
< / div >
2023-05-19 12:50:23 +08:00
2022-11-10 18:06:18 +08:00
< / div >
2022-09-27 17:59:05 +08:00
< / body >
2023-02-09 16:32:24 +08:00
< script >
/**
* @description: Prompt that the browser version is too low
*/
const defaultList = [
{
name: 'Edge',
version: '100'
},
{
name: 'Firefox',
version: '100'
},
{
name: 'Chrome',
version: '90'
},
{
name: 'Safari',
version: '15'
2023-03-27 18:18:57 +08:00
},
{
name: 'IE',
2023-02-09 16:32:24 +08:00
}
];
2023-05-19 12:50:23 +08:00
function getBrowserTypeAndVersion(){
var browser = {
2023-02-09 16:32:24 +08:00
name: '',
version: ''
};
var ua = navigator.userAgent.toLowerCase();
var s;
2023-05-19 12:50:23 +08:00
((ua.indexOf("compatible") > -1 & & ua.indexOf("MSIE") > -1) || (ua.indexOf('Trident') > -1 & & ua.indexOf("rv:11.0") > -1)) ? browser = { name: 'IE', version: '' } :
(s = ua.match(/edge\/([\d\.]+)/)) ? browser = { name: 'Edge', version: s[1] } :
(s = ua.match(/firefox\/([\d\.]+)/)) ? browser = { name: 'Firefox', version: s[1] } :
(s = ua.match(/chrome\/([\d\.]+)/)) ? browser = { name: 'Chrome', version: s[1] } :
(s = ua.match(/version\/([\d\.]+).*safari/)) ? browser = { name: 'Safari', version: s[1] } : browser = { name: 'unknown', version: '' };
2023-02-09 16:32:24 +08:00
// 根据关系进行判断
2023-05-19 12:50:23 +08:00
return browser;
2023-02-09 16:32:24 +08:00
}
function compareVersion(version1, version2) {
var v1 = version1.split('.');
var v2 = version2.split('.');
var len = Math.max(v1.length, v2.length);
while (v1.length < len ) {
v1.push('0');
}
while (v2.length < len ) {
v2.push('0');
}
for (var i = 0; i < len ; i + + ) {
var num1 = parseInt(v1[i]);
var num2 = parseInt(v2[i]);
if (num1 >= num2) {
return 1;
} else if (num1 < num2 ) {
return -1;
}
}
return 0;
}
2023-05-19 12:50:23 +08:00
const browserInfo = getBrowserTypeAndVersion();
2023-02-09 16:32:24 +08:00
2023-05-19 12:50:23 +08:00
if (browserInfo.name === 'IE') {
const div = document.getElementById('protect-browser');
2023-03-27 18:22:21 +08:00
div.innerText = 'Sorry, this site does not support Internet Explorer. In order to avoid affecting the normal use of our features, please use a more modern browser such as Edge, Firefox, Chrome, or Safari.'
2023-03-27 18:18:57 +08:00
} else {
const notSupport = defaultList.some(item => {
2023-05-19 12:50:23 +08:00
if (item.name === browserInfo.name) {
return compareVersion(browserInfo.version, item.version) === -1;
2023-03-27 18:18:57 +08:00
}
return false;
});
if (notSupport) {
2023-05-19 12:50:23 +08:00
const div = document.getElementById('protect-browser');
2023-03-27 18:18:57 +08:00
div.innerText = 'The current browser version is too low, in order not to affect the normal use of the function, please upgrade the browser to the latest version.'
}
2023-02-09 16:32:24 +08:00
}
2023-03-27 18:18:57 +08:00
2023-02-09 16:32:24 +08:00
< / script >
2022-09-27 17:59:05 +08:00
< / html >