-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
a5e5f90
commit 77db2f7
Showing
1 changed file
with
4 additions
and
174 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,174 +1,4 @@ | ||
<!-- Page Title --> | ||
<title>Tech Stuff's website</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="https://i.imgur.com/VvNhMb0.jpg"> | ||
<!-- Custom Scripts --> | ||
<script> | ||
function dragElement(elmnt, useSnap) { | ||
var pos1 = 0, pos2 = 0, pos3 = 0, pos4 = 0; | ||
if (elmnt.querySelector('.dragHeader')) { | ||
// if present, the header is where you move the DIV from: | ||
elmnt.querySelector('.dragHeader').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 = 'none'; | ||
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 = 'static'; | ||
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; | ||
elmnt.style.position = 'fixed'; | ||
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 (useSnap) { | ||
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 (useSnap && | ||
((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.position = 'static'; | ||
elmnt.style.left = elem_old_pos.left; | ||
elmnt.style.top = elem_old_pos.top; | ||
placeholderElem.style.display = 'none'; | ||
} else { | ||
element_locked = false; | ||
elmnt.style.position = 'fixed'; | ||
placeholderElem.style.display = 'none'; | ||
} | ||
} | ||
} | ||
document.addEventListener('DOMContentLoaded',()=>{ | ||
document.querySelectorAll('.draggable-snap').forEach(elem=>dragElement(elem,true)); | ||
document.querySelectorAll('.draggable-nosnap').forEach(elem=>dragElement(elem,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 draggable-snap"> | ||
<div class="w-full bg-white/50 border-b-2 bg-[url('Reflection.png')] dragHeader"> | ||
<span class="float-left px-2">Hello World!</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="Logo3.png" width="128" height="128" class="p-1"> | ||
<h1 class="text-xl text-center inline-block p-1 rounded">Tech Stuff's website!</h1> | ||
<div class="flex flex-none content-center justify-center items-center flex-col bg-white/35 backdrop-blur rounded p-2"> | ||
<div> | ||
<a href="https://youtube.com/@teknixstuff" class="text-inherit underline"> | ||
<span> | ||
<img src="yt.png" width="16" height="16" class="inline rounded"> YouTube | ||
</span> | ||
</a> | ||
<span class="px-1">|</span> | ||
<a href="https://teknixstuff.github.io/discord/" class="text-inherit underline"> | ||
<span> | ||
<img src="discord.png" width="16" height="16" class="inline rounded"> Discord | ||
</span> | ||
</a> | ||
<span class="px-1">|</span> | ||
<a href="https://github.com/teknixstuff" class="text-inherit underline"> | ||
<span> | ||
<img src="github.png" width="16" height="16" class="inline rounded"> Github | ||
</span> | ||
</a> | ||
<span class="px-1">|</span> | ||
<a href="https://twitter.com/teknixstuff" class="text-inherit underline"> | ||
<span> | ||
<img src="twitter.png" width="16" height="16" class="inline rounded"> Twitter | ||
</span> | ||
</a> | ||
</div> | ||
</div> | ||
<br> | ||
<div class="bg-white/35 backdrop-blur flex flex-none content-center justify-center items-center flex-col p-2 rounded"></div> | ||
</div> | ||
</div> | ||
<br> | ||
<div class="grid auto-cols-auto auto-rows-auto gap-3 grid-flow-col-dense"> | ||
<div class="backdrop-blur bg-white/25 flex flex-none content-center justify-center items-center flex-col rounded border-2"> | ||
<div class="w-full bg-white/50 border-b-2 bg-[url('Reflection.png')] dragHeader"> | ||
<span class="float-left px-2">My website!</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')]"> | ||
<p> | ||
Well, this is my website! | ||
</p> | ||
</div> | ||
</div> | ||
</div> | ||
</body> | ||
<meta http-equiv="refresh" content="0; url=//teknixstuff.com/"> | ||
<script>location = '//teknixstuff.com';</script> | ||
I've moved! | ||
If you are not automatically redirected, click <a href="//teknixstuff.com">here</a>. |