-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
158 lines (153 loc) · 6.65 KB
/
index.html
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
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
<!-- Page Title -->
<title>Shrinkdows</title>
<!-- Load the framework -->
<script src="https://teknixstuff.github.io/AIOstacks/frontend/TVSP.js"></script>
<script>AIO.loadSCSS('https://teknixstuff.github.io/AIOstacks/frontend/TVSP/autostyls.tscss');</script>
<script src="https://teknixstuff.github.io/AIOstacks/frontend/TVSP/autostyls.js"></script>
<!-- Config -->
<meta x-type="config" x-name="background-image" x-value="websitebg.png">
<!-- Custom Scripts -->
<script>
function dragElement(elmnt) {
var pos1 = 0, pos2 = 0, pos3 = 0, pos4 = 0;
if (document.getElementById(elmnt.id + "header")) {
// if present, the header is where you move the DIV from:
document.getElementById(elmnt.id + "header").onmousedown = dragMouseDown;
} else {
// otherwise, move the DIV from anywhere inside the DIV:
elmnt.onmousedown = dragMouseDown;
}
let placeholderElem = document.createElement('div');
placeholderElem.style.width = elmnt.offsetWidth;
placeholderElem.style.height = elmnt.offsetHeight;
placeholderElem.style.display = 'block';
let elem_old_pos = {};
elem_old_pos.width = elmnt.offsetWidth;
elem_old_pos.height = elmnt.offsetHeight;
elem_old_pos.left = elmnt.getBoundingClientRect().left;
elem_old_pos.top = elmnt.getBoundingClientRect().top;
elmnt.style.left = elem_old_pos.left;
elmnt.style.top = elem_old_pos.top;
elmnt.style.position = 'absolute';
elmnt.insertAdjacentElement('beforebegin', placeholderElem)
let element_locked = true;
window.addEventListener('resize',()=>{
var old_elem_status = elmnt.style.position;
elmnt.style.position = 'static';
var old_placeholder_status = placeholderElem.style.display;
placeholderElem.style.display = 'none';
placeholderElem.style.width = elmnt.offsetWidth;
placeholderElem.style.height = elmnt.offsetHeight;
elem_old_pos.width = elmnt.offsetWidth;
elem_old_pos.height = elmnt.offsetHeight;
elem_old_pos.left = elmnt.getBoundingClientRect().left;
elem_old_pos.top = elmnt.getBoundingClientRect().top;
elmnt.style.position = old_elem_status;
placeholderElem.style.display = old_placeholder_status;
if (element_locked) {
elmnt.style.left = elem_old_pos.left;
elmnt.style.top = elem_old_pos.top;
}
})
function dragMouseDown(e) {
e = e || window.event;
e.preventDefault();
// get the mouse cursor position at startup:
pos3 = e.clientX;
pos4 = e.clientY;
document.onmouseup = closeDragElement;
// call a function whenever the cursor moves:
document.onmousemove = elementDrag;
}
function elementDrag(e) {
e = e || window.event;
e.preventDefault();
// calculate the new cursor position:
pos1 = pos3 - e.clientX;
pos2 = pos4 - e.clientY;
pos3 = e.clientX;
pos4 = e.clientY;
// set the element's new position:
elmnt.style.top = (elmnt.offsetTop - pos2) + "px";
elmnt.style.left = (elmnt.offsetLeft - pos1) + "px";
// check position
if (
((elem_old_pos.left + elem_old_pos.width) > elmnt.getBoundingClientRect().left) &&
((elmnt.getBoundingClientRect().left + elmnt.offsetWidth) > elem_old_pos.left) &&
((elem_old_pos.top + elem_old_pos.height) > elmnt.getBoundingClientRect().top) &&
((elmnt.getBoundingClientRect().top + elmnt.offsetHeight) > elem_old_pos.top)
) {
placeholderElem.style.display = 'block';
} else {
placeholderElem.style.display = 'none';
}
}
function closeDragElement() {
// stop moving when mouse button is released:
document.onmouseup = null;
document.onmousemove = null;
if (
((elem_old_pos.left + elem_old_pos.width) > elmnt.getBoundingClientRect().left) &&
((elmnt.getBoundingClientRect().left + elmnt.offsetWidth) > elem_old_pos.left) &&
((elem_old_pos.top + elem_old_pos.height) > elmnt.getBoundingClientRect().top) &&
((elmnt.getBoundingClientRect().top + elmnt.offsetHeight) > elem_old_pos.top)
) {
element_locked = true;
elmnt.style.left = elem_old_pos.left;
elmnt.style.top = elem_old_pos.top;
} else {
element_locked = false;
}
}
}
</script>
<!-- Body -->
<body class="flex flex-none content-center justify-center items-center flex-col p-2">
<div class="backdrop-blur bg-white/25 flex flex-none content-center justify-center items-center flex-col rounded border-2 hover:z-50" id="infocard">
<div class="w-full bg-white/50 border-b-2 bg-[url('Reflection.png')]" id="infocardheader">
<span class="float-left px-2">Shrinkdows</span>
<span class="float-right bg-black/25 rounded-b"><img src="winbtns_disabled.svg"></span>
</div>
<div class="p-2 flex flex-none content-center justify-center items-center flex-col bg-[url('Reflection-50-large.png')]">
<img src="shrinkdowslogo.png" width="128" height="128" class="p-1">
<h1 class="text-xl text-center inline-block p-1 rounded">Shrinkdows</h1>
<div class="bg-white/35 backdrop-gblur flex flex-none content-center justify-center items-center flex-col p-2 rounded">
<div>Developers:</div>
<div>
<a href="https://teknixstuff.github.io" class="text-inherit underline">
<span>
<img src="https://teknixstuff.github.io/Logo3.png" width="16" height="16" class="inline"> Tech Stuff
</span>
</a>
<span class="px-1">|</span>
<a href="https://1justjoey.github.io/MyWebsiteHosting/" class="text-inherit underline">
<span>
<img src="https://1JustJoey.github.io/MyWebsiteHosting/Mittens2.webp" width="16" height="16" class="inline"> Just Joey
</span>
</a>
</div>
<div>Beta testers:</div>
<div>
<a href="https://mrmahase.github.io" class="text-inherit underline">
<span>
<img src="https://mrmahase.github.io/Logo.png" width="16" height="16" class="inline rounded"> Jeremiah
</span>
</a>
</div>
</div>
</div>
</div>
<br>
<div class="grid auto-cols-auto auto-rows-auto gap-3 grid-flow-col-dense">
<div class="inline-block rounded backdrop-blur bg-white/25 border-2 w-max h-max">
<div class="w-full bg-white/50 border-b-2 bg-[url('Reflection.png')]">
<span class="px-2">Shrinkdows alpha 0.1</span>
<span class="float-right bg-black/25 rounded-b"><img src="winbtns_disabled.svg"></span>
</div>
<div class="p-2 flex flex-none content-center justify-center items-center flex-col bg-[url('Reflection-50-large.png')]">
<a x-type="link" href="https://github.com/shrinkdows/shrinkdows/releases/latest">Download</a>
</div>
</div>
</div>
<script>dragElement(document.getElementById('infocard'));</script>
</body>