-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path176.js
60 lines (50 loc) · 2.01 KB
/
176.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
55
56
57
58
59
60
window.addEventListener('load', function () {
const getRandInRange = (min, max) => {
return Math.floor(Math.random() * (max - min) + min);
}
const number = 176
const site = `https://lifeforms.supply/embed/${number}`;
const horizontal = getRandInRange(0, window.innerWidth/2);
const vertical = getRandInRange(100, window.innerHeight-100);
let inner;
inner = document.createElement("iframe");
inner.setAttribute('src', site);
inner.setAttribute('scrolling', "no");
inner.setAttribute('title', "Lifeforms");
const arrow = document.createElement("img");
arrow.setAttribute('src', 'https://possible.social/arrow.png');
arrow.style.position = 'fixed';
arrow.style.width = '30px';
arrow.style.top = `${vertical+15}px`;
arrow.style.left = `${horizontal}px`;
arrow.style.zIndex = "110";
const question = document.createElement("img");
question.setAttribute('src', 'https://possible.social/question.png');
question.style.position = 'fixed';
question.style.width = '25px';
question.style.top = `${vertical+55}px`;
question.style.left = `${horizontal}px`;
question.style.zIndex = "110";
const a = document.createElement("a");
a.setAttribute('href', `https://lifeforms.supply/${number}`);
a.appendChild(arrow);
const a2 = document.createElement("a");
a2.setAttribute('href', "https://lifeforms.supply");
a2.appendChild(question);
const portal = document.createElement("div");
portal.style.width = '140px';
portal.style.height = '150px';
portal.style.border = 'white';
portal.style.borderStyle = 'solid';
portal.style.borderWidth = '10px';
portal.style.overflow = 'auto';
portal.style.position = 'fixed';
portal.style.webkitOverflowScrolling = "touch";
portal.style.top = `${vertical}px`
portal.style.left = `${horizontal}px`
portal.style.zIndex = "100"
portal.appendChild(inner);
document.getElementsByTagName('body')[0].appendChild(portal);
document.getElementsByTagName('body')[0].appendChild(a);
document.getElementsByTagName('body')[0].appendChild(a2);
})