-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathscript.js
54 lines (52 loc) · 1.69 KB
/
script.js
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
var hacksmithsData = [
{
name: "Hacksmiths",
url: "http://goldsmiths.tech"
},
{
name: "Anvil Hack",
url: "http://anvil.goldsmiths.tech"
},
{
name: "Sex Tech Hack",
url: "http://sexhack.tech"
},
{
name: "Non Binary in Tech",
url: "http://nonbinary.tech"
},
{
name: "UKGovHack",
url: "http://ukgovhack.com"
}
];
function runAfterLoad() {
$("body").prepend("<div id='hacksmiths-banner'></div>");
$(hacksmithsData).each(function() {
$("#hacksmiths-banner").append("<a href='"+this.url+"'>"+this.name+"</a>")
});
$("head").append("<style>body{padding-top:2em;font-size:1rem;}#hacksmiths-banner{position:absolute;top:0;left:0;width:100%;background:#37474F;padding:0.5rem;}#hacksmiths-banner a{color:white !important; font-family:'Open Sans',sans-serif;text-decoration:none !important;margin-right:1em !important;}#hacksmiths-banner a:first-child{font-weight:bold;}@media screen and (max-width:800px){body{padding-top:0;} #hacksmiths-banner{display:none;}}</style>");
}
(function() {
function loadScript(url, callback) {
var script = document.createElement("script")
script.type = "text/javascript";
if (script.readyState) { //IE
script.onreadystatechange = function() {
if (script.readyState == "loaded" || script.readyState == "complete") {
script.onreadystatechange = null;
callback();
}
};
} else { //Others
script.onload = function() {
callback();
};
}
script.src = url;
document.getElementsByTagName("head")[0].appendChild(script);
}
loadScript("https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js", function() {
runAfterLoad();
});
})();