-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsharedHeader.js
More file actions
54 lines (47 loc) · 1.64 KB
/
sharedHeader.js
File metadata and controls
54 lines (47 loc) · 1.64 KB
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
(function () {
const head = document.head;
const Link = (rel, href, crossorigin = false) => {
const link = document.createElement("link");
link.href = href;
link.rel = rel;
if (typeof crossorigin === "boolean" && crossorigin)
link.setAttribute("crossorigin", "");
if (typeof crossorigin === "string")
link.setAttribute("crossorigin", crossorigin);
head.appendChild(link);
};
// Google Fonts: Init
Link("preconnect", "https://fonts.googleapis.com");
Link("preconnect", "https://fonts.gstatic.com", true);
// Google Fonts: Zen Maru Gothic
Link(
"stylesheet",
"https://fonts.googleapis.com/css2?family=Zen+Maru+Gothic:wght@400;900&display=swap"
);
// Google Fonts: Rampart One
Link(
"stylesheet",
"https://fonts.googleapis.com/css2?family=Rampart+One&display=swap"
);
// Bootstrap
Link(
"stylesheet",
"https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css",
"anonymous"
);
const bootstrapScript = document.createElement("script");
bootstrapScript.src =
"https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/js/bootstrap.bundle.min.js";
bootstrapScript.integrity =
"sha384-YvpcrYf0tY3lHB60NNkmXc5s9fDVZLESaAA55NDzOxhy9GkcIdslK1eN7N6jIeHz";
bootstrapScript.crossOrigin = "anonymous";
head.appendChild(bootstrapScript);
// Font Awesome
const fontAwesomeScript = document.createElement("script");
fontAwesomeScript.src = "https://kit.fontawesome.com/a395431cf2.js";
fontAwesomeScript.crossOrigin = "anonymous";
head.appendChild(fontAwesomeScript);
// My styles
Link("stylesheet", "style.css");
Link("stylesheet", "theme.css");
})();