|
48 | 48 | <!-- color-scheme 告诉浏览器支持亮/暗模式--> |
49 | 49 | <meta name="color-scheme" content="light dark"/> |
50 | 50 |
|
51 | | - <!-- Google tag (gtag.js) --> |
52 | | - <script async src="https://www.googletagmanager.com/gtag/js?id=G-50T6DRD837"></script> |
53 | 51 | <script> |
54 | | - |
55 | | - </script> |
56 | | - |
57 | | - <script> |
58 | | - </script> |
59 | | - |
60 | | - <script> |
61 | | - if (!location.href.includes('localhost') |
62 | | - && !location.href.includes('192.168') |
63 | | - && !location.href.includes('172.16') |
64 | | - && !location.href.includes('10.0') |
65 | | - ) { |
66 | | - //https://51.la/ |
67 | | - !function(p){"use strict";!function(t){var s=window,e=document,i=p,c="".concat("https:"===e.location.protocol?"https://":"http://","sdk.51.la/js-sdk-pro.min.js"),n=e.createElement("script"),r=e.getElementsByTagName("script")[0];n.type="text/javascript",n.setAttribute("charset","UTF-8"),n.async=!0,n.src=c,n.id="LA_COLLECT",i.d=n;var o=function(){s.LA.ids.push(i)};s.LA?s.LA.ids&&o():(s.LA=p,s.LA.ids=[],o()),r.parentNode.insertBefore(n,r)}()}({id:"3OH8ITYRgwzo58L2",ck:"3OH8ITYRgwzo58L2",autoTrack:true,hashMode:true}); |
68 | | - |
69 | | - // Cloudflare |
70 | | - (function () { |
71 | | - var cf = document.createElement("script"); |
72 | | - cf.src = 'https://static.cloudflareinsights.com/beacon.min.js' |
73 | | - cf.setAttribute("data-cf-beacon", '{"token": "e5119992696d4155814400dd69781d68"}'); |
74 | | - var s = document.getElementsByTagName("script")[0]; |
75 | | - s.parentNode.insertBefore(cf, s); |
76 | | - })(); |
77 | | - |
78 | | - // google |
79 | | - (function () { |
80 | | - var ana = document.createElement("script"); |
81 | | - ana.src = 'https://www.googletagmanager.com/gtag/js?id=G-50T6DRD837' |
82 | | - ana.onload = function () { |
83 | | - window.dataLayer = window.dataLayer || []; |
84 | | - function gtag(){dataLayer.push(arguments);} |
85 | | - gtag('js', new Date()); |
86 | | - gtag('config', 'G-50T6DRD837'); |
87 | | - } |
88 | | - var s = document.getElementsByTagName("script")[0]; |
89 | | - s.parentNode.insertBefore(ana, s); |
90 | | - })(); |
91 | | - |
92 | | - |
93 | | - // baidu |
94 | | - var _hmt = _hmt || []; |
95 | | - (function () { |
96 | | - var hm = document.createElement("script"); |
97 | | - hm.src = "https://hm.baidu.com/hm.js?3dae52fcd5375a19905462e4ad3eb54e"; |
98 | | - var s = document.getElementsByTagName("script")[0]; |
99 | | - s.parentNode.insertBefore(hm, s); |
100 | | - })(); |
101 | | - |
102 | | - // umami |
103 | | - (function () { |
104 | | - var umami = document.createElement("script"); |
105 | | - umami.src = 'https://typewords.cc/libs/s.js' |
106 | | - umami.setAttribute("data-website-id", "160308c9-7900-4b1d-a0b1-c3b25a9530f6"); |
107 | | - var s = document.getElementsByTagName("script")[0]; |
108 | | - s.parentNode.insertBefore(umami, s); |
109 | | - })(); |
110 | | - |
111 | | - // umami-saas |
112 | | - (function () { |
113 | | - var umami2 = document.createElement("script"); |
114 | | - umami2.src = 'https://stat.typewords.cc/script.js' |
115 | | - umami2.setAttribute("data-website-id", "4d728ae3-5393-4efe-81dc-30dcb4f33c00"); |
116 | | - var s = document.getElementsByTagName("script")[0]; |
117 | | - s.parentNode.insertBefore(umami2, s); |
118 | | - })(); |
119 | | - } |
| 52 | + if ( |
| 53 | + !location.href.includes('localhost') |
| 54 | + && !location.href.includes('192.168') |
| 55 | + && !location.href.includes('172.16') |
| 56 | + && !location.href.includes('10.0') |
| 57 | + ) { |
| 58 | + //51.la |
| 59 | + (function () { |
| 60 | + window.LA = window.LA || { |
| 61 | + ids: [{id: "3OH8ITYRgwzo58L2", ck: "3OH8ITYRgwzo58L2"}], |
| 62 | + id: "3OH8ITYRgwzo58L2", |
| 63 | + ck: "3OH8ITYRgwzo58L2", |
| 64 | + hashMode: true |
| 65 | + }; |
| 66 | + const script = document.createElement('script'); |
| 67 | + script.src = `https://typewords.cc/libs/51.js`; |
| 68 | + document.head.appendChild(script); |
| 69 | + })(); |
| 70 | + |
| 71 | + // Cloudflare |
| 72 | + (function () { |
| 73 | + var cf = document.createElement("script"); |
| 74 | + cf.src = 'https://static.cloudflareinsights.com/beacon.min.js' |
| 75 | + cf.setAttribute("data-cf-beacon", '{"token": "e5119992696d4155814400dd69781d68"}'); |
| 76 | + document.head.appendChild(cf); |
| 77 | + })(); |
| 78 | + |
| 79 | + // google |
| 80 | + (function () { |
| 81 | + var ana = document.createElement("script"); |
| 82 | + ana.src = 'https://www.googletagmanager.com/gtag/js?id=G-50T6DRD837' |
| 83 | + ana.onload = function () { |
| 84 | + window.dataLayer = window.dataLayer || []; |
| 85 | + |
| 86 | + function gtag() { |
| 87 | + dataLayer.push(arguments); |
| 88 | + } |
| 89 | + |
| 90 | + gtag('js', new Date()); |
| 91 | + gtag('config', 'G-50T6DRD837'); |
| 92 | + } |
| 93 | + document.head.appendChild(ana); |
| 94 | + })(); |
| 95 | + |
| 96 | + |
| 97 | + // baidu |
| 98 | + var _hmt = _hmt || []; |
| 99 | + (function () { |
| 100 | + var hm = document.createElement("script"); |
| 101 | + hm.src = "https://hm.baidu.com/hm.js?3dae52fcd5375a19905462e4ad3eb54e"; |
| 102 | + document.head.appendChild(hm); |
| 103 | + })(); |
| 104 | + |
| 105 | + // umami |
| 106 | + // (function () { |
| 107 | + // var umami = document.createElement("script"); |
| 108 | + // umami.src = 'https://typewords.cc/libs/s.js' |
| 109 | + // umami.setAttribute("data-website-id", "160308c9-7900-4b1d-a0b1-c3b25a9530f6"); |
| 110 | + // document.head.appendChild(umami); |
| 111 | + // })(); |
| 112 | + |
| 113 | + // umami-saas |
| 114 | + // (function () { |
| 115 | + // var umami2 = document.createElement("script"); |
| 116 | + // umami2.src = 'https://stat.typewords.cc/script.js' |
| 117 | + // umami2.setAttribute("data-website-id", "4d728ae3-5393-4efe-81dc-30dcb4f33c00"); |
| 118 | + // document.head.appendChild(umami2); |
| 119 | + // })(); |
| 120 | + } |
120 | 121 | </script> |
121 | 122 | </head> |
122 | 123 | <body> |
|
126 | 127 | </noscript> |
127 | 128 | <div id="app"></div> |
128 | 129 | <script> |
129 | | - (function () { |
130 | | - var ua = navigator.userAgent || '' |
131 | | - var isIE = !!document.documentMode || /MSIE|Trident/i.test(ua) |
132 | | - if (!isIE) return |
133 | | - var style = document.createElement('style') |
134 | | - style.type = 'text/css' |
135 | | - style.appendChild(document.createTextNode( |
136 | | - '.ie-mask{position:fixed;left:0;top:0;right:0;bottom:0;background:rgba(0,0,0,.35);z-index:9998}' + |
137 | | - '.ie-dialog{position:fixed;left:50%;top:50%;transform:translate(-50%,-50%);width:28rem;max-width:90vw;background:#fff;color:#111;border-radius:.6rem;box-shadow:0 10px 30px rgba(0,0,0,.15);z-index:9999;padding:1.2rem}' + |
138 | | - '.ie-dialog .title{font-size:1.2rem;font-weight:700;margin-bottom:.6rem}' + |
139 | | - '.ie-dialog .desc{font-size:.95rem;line-height:1.6;color:#555}' + |
140 | | - '.ie-dialog .actions{display:flex;justify-content:flex-end;margin-top:1rem}' + |
141 | | - '.ie-dialog .actions > * + *{margin-left:.6rem}' + |
142 | | - '.ie-dialog .btn{display:inline-flex;align-items:center;justify-content:center;height:2.2rem;padding:0 1rem;border-radius:.4rem;background:#0C8CE9;color:#fff;text-decoration:none}' + |
143 | | - '.ie-dialog .btn-secondary{display:inline-flex;align-items:center;justify-content:center;height:2.2rem;padding:0 .9rem;border-radius:.4rem;background:#eee;color:#333;border:1px solid #ddd}' + |
144 | | - '@media (prefers-color-scheme: dark){.ie-dialog{background:#1e1f22;color:#e6e6e6}.ie-dialog .desc{color:#c6c6c6}.ie-dialog .btn-secondary{background:#2a2b2f;color:#e6e6e6;border-color:#3a3b3f}}' |
145 | | - )) |
146 | | - document.head.appendChild(style) |
147 | | - var mask = document.createElement('div') |
148 | | - mask.className = 'ie-mask' |
149 | | - var dialog = document.createElement('div') |
150 | | - dialog.className = 'ie-dialog' |
151 | | - dialog.innerHTML = '<div class="title">不支持 IE 浏览器</div>' + |
152 | | - '<div class="desc">Type Words 使用现代技术构建,请使用 Chrome、Edge、Firefox 或 Safari 等现代浏览器访问。</div>' + |
153 | | - '<div class="actions">' + |
154 | | - '<a class="btn" href="https://www.google.cn/chrome/" target="_blank" rel="noreferrer">下载 Chrome</a>' + |
155 | | - '<button class="btn-secondary" type="button">我知道了</button>' + |
156 | | - '</div>' |
157 | | - |
158 | | - function close() { |
159 | | - try { |
160 | | - document.body.removeChild(mask) |
161 | | - } catch (e) { |
162 | | - } |
163 | | - try { |
164 | | - document.body.removeChild(dialog) |
165 | | - } catch (e) { |
166 | | - } |
167 | | - } |
168 | | - |
169 | | - mask.addEventListener('click', close) |
170 | | - var btn = null |
171 | | - try { |
172 | | - btn = dialog.querySelector('.btn-secondary') |
173 | | - } catch (e) { |
174 | | - } |
175 | | - if (btn) btn.addEventListener('click', close) |
176 | | - document.body.appendChild(mask) |
177 | | - document.body.appendChild(dialog) |
178 | | - })() |
| 130 | + (function () { |
| 131 | + var ua = navigator.userAgent || '' |
| 132 | + var isIE = !!document.documentMode || /MSIE|Trident/i.test(ua) |
| 133 | + if (!isIE) return |
| 134 | + var style = document.createElement('style') |
| 135 | + style.type = 'text/css' |
| 136 | + style.appendChild(document.createTextNode( |
| 137 | + '.ie-mask{position:fixed;left:0;top:0;right:0;bottom:0;background:rgba(0,0,0,.35);z-index:9998}' + |
| 138 | + '.ie-dialog{position:fixed;left:50%;top:50%;transform:translate(-50%,-50%);width:28rem;max-width:90vw;background:#fff;color:#111;border-radius:.6rem;box-shadow:0 10px 30px rgba(0,0,0,.15);z-index:9999;padding:1.2rem}' + |
| 139 | + '.ie-dialog .title{font-size:1.2rem;font-weight:700;margin-bottom:.6rem}' + |
| 140 | + '.ie-dialog .desc{font-size:.95rem;line-height:1.6;color:#555}' + |
| 141 | + '.ie-dialog .actions{display:flex;justify-content:flex-end;margin-top:1rem}' + |
| 142 | + '.ie-dialog .actions > * + *{margin-left:.6rem}' + |
| 143 | + '.ie-dialog .btn{display:inline-flex;align-items:center;justify-content:center;height:2.2rem;padding:0 1rem;border-radius:.4rem;background:#0C8CE9;color:#fff;text-decoration:none}' + |
| 144 | + '.ie-dialog .btn-secondary{display:inline-flex;align-items:center;justify-content:center;height:2.2rem;padding:0 .9rem;border-radius:.4rem;background:#eee;color:#333;border:1px solid #ddd}' + |
| 145 | + '@media (prefers-color-scheme: dark){.ie-dialog{background:#1e1f22;color:#e6e6e6}.ie-dialog .desc{color:#c6c6c6}.ie-dialog .btn-secondary{background:#2a2b2f;color:#e6e6e6;border-color:#3a3b3f}}' |
| 146 | + )) |
| 147 | + document.head.appendChild(style) |
| 148 | + var mask = document.createElement('div') |
| 149 | + mask.className = 'ie-mask' |
| 150 | + var dialog = document.createElement('div') |
| 151 | + dialog.className = 'ie-dialog' |
| 152 | + dialog.innerHTML = '<div class="title">不支持 IE 浏览器</div>' + |
| 153 | + '<div class="desc">Type Words 使用现代技术构建,请使用 Chrome、Edge、Firefox 或 Safari 等现代浏览器访问。</div>' + |
| 154 | + '<div class="actions">' + |
| 155 | + '<a class="btn" href="https://www.google.cn/chrome/" target="_blank" rel="noreferrer">下载 Chrome</a>' + |
| 156 | + '<button class="btn-secondary" type="button">我知道了</button>' + |
| 157 | + '</div>' |
| 158 | + |
| 159 | + function close() { |
| 160 | + try { |
| 161 | + document.body.removeChild(mask) |
| 162 | + } catch (e) { |
| 163 | + } |
| 164 | + try { |
| 165 | + document.body.removeChild(dialog) |
| 166 | + } catch (e) { |
| 167 | + } |
| 168 | + } |
| 169 | + |
| 170 | + mask.addEventListener('click', close) |
| 171 | + var btn = null |
| 172 | + try { |
| 173 | + btn = dialog.querySelector('.btn-secondary') |
| 174 | + } catch (e) { |
| 175 | + } |
| 176 | + if (btn) btn.addEventListener('click', close) |
| 177 | + document.body.appendChild(mask) |
| 178 | + document.body.appendChild(dialog) |
| 179 | + })() |
179 | 180 | </script> |
180 | 181 | <script type="module" src="/src/main.ts"></script> |
181 | 182 | </body> |
|
0 commit comments