-
Notifications
You must be signed in to change notification settings - Fork 169
/
nomodule.ts
53 lines (52 loc) · 1.37 KB
/
nomodule.ts
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
// @ts-nocheck
// deno-lint-ignore-file
(function (document) {
var containerEl = document.createElement("div");
var hEl = document.createElement("h2");
var pEl = document.createElement("p");
var contarinStyle = {
position: "fixed",
top: "0",
left: "0",
zIndex: "999",
width: "100%",
padding: "30px 0",
margin: "0",
backgroundColor: "#fff9cc",
textAlign: "center",
borderBottom: "1px solid #eee",
boxShadow: "0 1px 5px rgba(0,0,0,0.1)",
};
var hStyle = {
padding: "0",
margin: "0",
lineHeight: "1.2",
fontSize: "24px",
fontWeight: "700",
color: "#000",
};
var pStyle = {
padding: "6px 0 0 0",
margin: "0",
lineHeight: "1.2",
fontSize: "15px",
color: "#454545",
};
for (var key in contarinStyle) {
containerEl.style[key] = contarinStyle[key];
}
for (var key in hStyle) {
hEl.style[key] = hStyle[key];
}
for (var key in pStyle) {
pEl.style[key] = pStyle[key];
}
// todo: i18n
// todo: add browser info
hEl.innerText = "Your browser is out of date!";
pEl.innerHTML =
'This site requires <a href="https://caniuse.com/es6-module" style="font-weight:500;color:#000;text-decoration:underline;">ES module</a>, please upgrade your browser.';
containerEl.appendChild(hEl);
containerEl.appendChild(pEl);
document.body.appendChild(containerEl);
})(window.document);