| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485 |
- <!doctype html>
- <html lang="en">
- <head>
- <meta charset="UTF-8" />
- <link rel="icon" type="image/svg+xml" href="/vite.svg" />
- <meta
- name="viewport"
- content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, viewport-fit=cover"
- />
- <title>h5</title>
- <style>
- #splash {
- position: fixed;
- top: 0;
- left: 0;
- width: 100%;
- height: 100%;
- background: #fff url('src/assets/img.png') no-repeat center center;
- background-size: contain;
- z-index: 9999;
- }
- </style>
- </head>
- <body>
- <div id="app"></div>
- <div id="splash"></div>
- <script type="module" src="/src/main.ts"></script>
- <script>
- window.onload = function() {
- document.getElementById('splash').style.display = 'none'; // 隐藏启动页
- }
- function getBrowserInfo() {
- const userAgent = navigator.userAgent;
- let browserName = "Unknown";
- let browserVersion = "Unknown";
- // 检查浏览器类型及版本
- if (userAgent.includes("Chrome")) {
- browserName = "Chrome";
- // 提取 Chrome 版本
- const match = userAgent.match(/Chrome\/([0-9]+)/);
- if (match) {
- browserVersion = match[1];
- }
- } else if (userAgent.includes("Firefox")) {
- browserName = "Firefox";
- // 提取 Firefox 版本
- const match = userAgent.match(/Firefox\/([0-9]+)/);
- if (match) {
- browserVersion = match[1];
- }
- } else if (userAgent.includes("MSIE") || userAgent.includes("Trident")) {
- browserName = "Internet Explorer";
- // 提取 IE 版本
- const match = userAgent.match(/(?:MSIE |rv:)([0-9]+)/);
- if (match) {
- browserVersion = match[1];
- }
- } else if (userAgent.includes("Edge")) {
- browserName = "Edge";
- // 提取 Edge 版本
- const match = userAgent.match(/Edge\/([0-9]+)/);
- if (match) {
- browserVersion = match[1];
- }
- } else if (userAgent.includes("Safari")) {
- browserName = "Safari";
- // 提取 Safari 版本
- const match = userAgent.match(/Version\/([0-9]+)/);
- if (match) {
- browserVersion = match[1];
- }
- }
- return {
- browserName,
- browserVersion,
- };
- }
- // const browserInfo = getBrowserInfo();
- // console.log(`Browser: ${browserInfo.browserName}, Version: ${browserInfo.browserVersion}`);
- </script>
- </body>
- </html>
|