-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathindex.html
More file actions
92 lines (79 loc) · 2.17 KB
/
Copy pathindex.html
File metadata and controls
92 lines (79 loc) · 2.17 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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>PowerBoost</title>
<style>
a {
color: #007ec6;
}
.buttons {
display: flex;
justify-content: space-between;
margin-bottom: 20px;
text-align: center;
}
.button {
background-color: white;
color: black;
border: 2px solid black;
padding: 10px 20px;
border-radius: 10px;
cursor: pointer;
font-size: 20px;
font-weight: bolder;
}
.button:hover {
background-color: black;
color: white;
}
</style>
</head>
<body>
<div>
<a href="" id="floatingUI.js"
><button class="button">PowerBoost😎</button></a
>
</div>
<script>
// create bookmark
function load_boostlet(url, callback) {
let xhr = new XMLHttpRequest();
xhr.open("GET", url);
xhr.onreadystatechange = function () {
if (xhr.readyState === 4) {
// request done
callback(xhr.response);
return;
}
};
xhr.send(null);
}
// FROM https://caiorss.github.io/bookmarklet-maker/
function compile_boostlet(code) {
var output =
"javascript:" +
encodeURIComponent("(function(){" + code.trim() + "})();");
return output;
}
function setup_boostlet_button(id, url) {
var link = document.getElementById(id);
load_boostlet(url, function (code) {
console.log(code)
output = compile_boostlet(code);
link.href = output;
});
}
window.onload = function () {
var baseurl =
"https://raw.githubusercontent.com/mpsych/powerboost/refs/heads/main/";
// "http://localhost:5500/";
// "https://raw.githubusercontent.com/gaiborjosue/powerboost/nav/"
var button = "floatingUI.js";
setup_boostlet_button(button, baseurl + button);
};
</script>
</body>
</html>