update to mediamtx and add movable bonzi cursor

This commit is contained in:
vance 2024-05-02 16:27:37 -07:00
parent 9a7d13a6c6
commit 76d5bcc58c
3 changed files with 185 additions and 158 deletions

BIN
bonzi.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 56 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.2 KiB

View File

@ -4,11 +4,11 @@
<head> <head>
<meta charset='utf-8'> <meta charset='utf-8'>
<meta name='viewport' content='width=device-width, initial-scale=1, minimum-scale=1'> <meta content='width=device-width, initial-scale=1, minimum-scale=1' name='viewport'>
<title>vance.land</title> <title>vance.land</title>
<meta name='description' content='vance.land'> <meta content='vance.land' name='description'>
<meta name='author' content='vance'> <meta content='vance' name='author'>
<base target='_blank'> <base target='_blank'>
<style> <style>
@ -21,7 +21,7 @@
color: #20C20E; color: #20C20E;
font-family: 'VT323', monospace; font-family: 'VT323', monospace;
font-size: 16pt; font-size: 16pt;
cursor: url('cursor.cur'), auto !important; cursor: none;
} }
html { html {
@ -52,6 +52,13 @@
font-size: 1rem; font-size: 1rem;
} }
#cursor {
position: absolute;
transform: translate(-95%, -45%);
z-index: 1;
pointer-events: none;
}
#live { #live {
position: fixed; position: fixed;
top: 50%; top: 50%;
@ -64,29 +71,27 @@
</head> </head>
<body> <body>
<iframe id='live' src='https://live.vance.land/embed/video' title='live.vance.land' height='350px' width='550px' referrerpolicy='origin' scrolling='no' allowfullscreen> <img id='cursor' src='bonzi.png' alt='cursor' />
</iframe> <iframe allowfullscreen height='350px' id='live' referrerpolicy='origin' scrolling='no'
<script> src='https://live.vance.land/vance/' title='live.vance.land' width='550px'>
if (window.self !== window.top) { </iframe>
document.getElementById('live').remove(); <script>
} const email = (function () {
const email = (function() {
var p = Array.prototype.slice.call(arguments), var p = Array.prototype.slice.call(arguments),
V = p.shift(); V = p.shift();
return p.reverse().map(function(o, i) { return p.reverse().map(function (o, i) {
return String.fromCharCode(o - V - 36 - i) return String.fromCharCode(o - V - 36 - i)
}).join('') }).join('')
})(59, 164, 200, 197, 207, 193, 213) + (40559).toString(36).toLowerCase() + (function() { })(59, 164, 200, 197, 207, 193, 213) + (40559).toString(36).toLowerCase() + (function () {
var Q = Array.prototype.slice.call(arguments), var Q = Array.prototype.slice.call(arguments),
O = Q.shift(); O = Q.shift();
return Q.reverse().map(function(e, u) { return Q.reverse().map(function (e, u) {
return String.fromCharCode(e - O - 57 - u) return String.fromCharCode(e - O - 57 - u)
}).join('') }).join('')
})(20, 125, 179, 176) + (766).toString(36).toLowerCase() + (function() { })(20, 125, 179, 176) + (766).toString(36).toLowerCase() + (function () {
var E = Array.prototype.slice.call(arguments), var E = Array.prototype.slice.call(arguments),
f = E.shift(); f = E.shift();
return E.reverse().map(function(s, C) { return E.reverse().map(function (s, C) {
return String.fromCharCode(s - f - 33 - C) return String.fromCharCode(s - f - 33 - C)
}).join('') }).join('')
})(24, 158, 167); })(24, 158, 167);
@ -102,7 +107,7 @@
}, },
'live': { 'live': {
'text': '🎥 live.vance.land', 'text': '🎥 live.vance.land',
'link': 'https://live.vance.land' 'link': 'https://live.vance.land/vance/'
}, },
'email': { 'email': {
'text': `📧 ${email}`, 'text': `📧 ${email}`,
@ -130,14 +135,34 @@
} }
}; };
// bonzi cursor
window.addEventListener('mousemove', (event) => {
document.getElementById('cursor').style.top = event.clientY + 'px';
document.getElementById('cursor').style.left = event.clientX + 'px';
});
// remove stream if embedded
if (window.self !== window.top) {
document.getElementById('live').remove();
}
// check if stream active every 5 seconds
setInterval(function checkLive() {
fetch(new URL('index.m3u8', socials.live.link))
.then(response => {
document.getElementById('live').style.display = response.ok ? 'inline' : 'none';
});
return checkLive;
}(), 5000);
const vw = Math.max(document.documentElement.clientWidth || 0, window.innerWidth || 0); const vw = Math.max(document.documentElement.clientWidth || 0, window.innerWidth || 0);
const vh = Math.max(document.documentElement.clientHeight || 0, window.innerHeight || 0); const vh = Math.max(document.documentElement.clientHeight || 0, window.innerHeight || 0);
const min_speed = 10; const min_speed = 10;
const max_speed = 20; const max_speed = 20;
let entities = 0; let entities = 0;
const max_entities = Math.floor(vw / 30); const max_entities = Math.floor(vw / 30);
// animated anchors
function animate(entity) { function animate(entity) {
let flag = parseInt(entity.style.left, 10); let flag = parseInt(entity.style.left, 10);
@ -176,19 +201,14 @@
animate(entity); animate(entity);
} }
function htmlDecode(input) {
let doc = new DOMParser().parseFromString(input, 'text/html');
doc = new DOMParser().parseFromString(doc.documentElement.textContent, 'text/html');
return doc;
}
// Always have socials // Always have socials
while(entities < max_entities / 4) { while (entities < max_entities / 4) {
for (const key in socials) { for (const key in socials) {
createAnchor(socials[key].link, socials[key].text); createAnchor(socials[key].link, socials[key].text);
} }
} }
// feed
fetch(`${socials.feed.link}.rss`) fetch(`${socials.feed.link}.rss`)
.then(response => response.text()) .then(response => response.text())
.then(str => new DOMParser().parseFromString(str, 'text/xml')) .then(str => new DOMParser().parseFromString(str, 'text/xml'))
@ -201,6 +221,7 @@
}); });
}); });
// code + helpers
function absoluteURL(data, query, url) { function absoluteURL(data, query, url) {
data.querySelectorAll(query).forEach(element => { data.querySelectorAll(query).forEach(element => {
element.setAttribute('href', new URL(element.getAttribute('href'), url)); element.setAttribute('href', new URL(element.getAttribute('href'), url));
@ -209,6 +230,12 @@
return data; return data;
} }
function htmlDecode(input) {
let doc = new DOMParser().parseFromString(input, 'text/html');
doc = new DOMParser().parseFromString(doc.documentElement.textContent, 'text/html');
return doc;
}
fetch(`${socials.code.link}.atom`) fetch(`${socials.code.link}.atom`)
.then(response => response.text()) .then(response => response.text())
.then(str => new DOMParser().parseFromString(str, 'text/xml')) .then(str => new DOMParser().parseFromString(str, 'text/xml'))
@ -220,7 +247,7 @@
createAnchor(element.querySelector('link').getAttribute('href'), title.body.innerHTML); createAnchor(element.querySelector('link').getAttribute('href'), title.body.innerHTML);
}); });
}); });
</script> </script>
</body> </body>
</html> </html>