update to mediamtx and add movable bonzi cursor
This commit is contained in:
		
							parent
							
								
									9a7d13a6c6
								
							
						
					
					
						commit
						76d5bcc58c
					
				
							
								
								
									
										
											BIN
										
									
								
								cursor.cur
									
									
									
									
									
								
							
							
						
						
									
										
											BIN
										
									
								
								cursor.cur
									
									
									
									
									
								
							
										
											Binary file not shown.
										
									
								
							| Before Width: | Height: | Size: 3.2 KiB | 
							
								
								
									
										331
									
								
								index.html
									
									
									
									
									
								
							
							
						
						
									
										331
									
								
								index.html
									
									
									
									
									
								
							| @ -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,163 +71,183 @@ | |||||||
| </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 () { | ||||||
|  |         var p = Array.prototype.slice.call(arguments), | ||||||
|  |             V = p.shift(); | ||||||
|  |         return p.reverse().map(function (o, i) { | ||||||
|  |             return String.fromCharCode(o - V - 36 - i) | ||||||
|  |         }).join('') | ||||||
|  |     })(59, 164, 200, 197, 207, 193, 213) + (40559).toString(36).toLowerCase() + (function () { | ||||||
|  |         var Q = Array.prototype.slice.call(arguments), | ||||||
|  |             O = Q.shift(); | ||||||
|  |         return Q.reverse().map(function (e, u) { | ||||||
|  |             return String.fromCharCode(e - O - 57 - u) | ||||||
|  |         }).join('') | ||||||
|  |     })(20, 125, 179, 176) + (766).toString(36).toLowerCase() + (function () { | ||||||
|  |         var E = Array.prototype.slice.call(arguments), | ||||||
|  |             f = E.shift(); | ||||||
|  |         return E.reverse().map(function (s, C) { | ||||||
|  |             return String.fromCharCode(s - f - 33 - C) | ||||||
|  |         }).join('') | ||||||
|  |     })(24, 158, 167); | ||||||
|  | 
 | ||||||
|  |     const socials = { | ||||||
|  |         'matrix': { | ||||||
|  |             'text': '💊 @vance:vance.land', | ||||||
|  |             'link': 'https://matrix.to/#/@vance:vance.land' | ||||||
|  |         }, | ||||||
|  |         'feed': { | ||||||
|  |             'text': `🥫 @${email}`, | ||||||
|  |             'link': 'https://feed.vance.land/@vance' | ||||||
|  |         }, | ||||||
|  |         'live': { | ||||||
|  |             'text': '🎥 live.vance.land', | ||||||
|  |             'link': 'https://live.vance.land/vance/' | ||||||
|  |         }, | ||||||
|  |         'email': { | ||||||
|  |             'text': `📧 ${email}`, | ||||||
|  |             'link': `mailto:${email}` | ||||||
|  |         }, | ||||||
|  |         'urbit': { | ||||||
|  |             'text': '🌐 ~sarsup-figput', | ||||||
|  |             'link': 'https://sarsup-figput.vance.land/blog' | ||||||
|  |         }, | ||||||
|  |         'telegram': { | ||||||
|  |             'text': '💬 @vanceland', | ||||||
|  |             'link': 'https://t.me/vanceland' | ||||||
|  |         }, | ||||||
|  |         'code': { | ||||||
|  |             'text': '🐱💻 code.vance.land', | ||||||
|  |             'link': 'https://code.vance.land/vance' | ||||||
|  |         }, | ||||||
|  |         'music': { | ||||||
|  |             'text': '🎶 @SMOOTHAPPLIANCE', | ||||||
|  |             'link': 'https://soundcloud.com/smoothappliance' | ||||||
|  |         }, | ||||||
|  |         'haram': { | ||||||
|  |             'text': '🕋', | ||||||
|  |             'link': 'https://dreamsinco.de' | ||||||
|         } |         } | ||||||
|  |     }; | ||||||
| 
 | 
 | ||||||
|         const email = (function() { |     // bonzi cursor | ||||||
|             var p = Array.prototype.slice.call(arguments), |     window.addEventListener('mousemove', (event) => { | ||||||
|                 V = p.shift(); |        document.getElementById('cursor').style.top = event.clientY + 'px'; | ||||||
|             return p.reverse().map(function(o, i) { |        document.getElementById('cursor').style.left = event.clientX + 'px'; | ||||||
|                 return String.fromCharCode(o - V - 36 - i) |     }); | ||||||
|             }).join('') |  | ||||||
|         })(59, 164, 200, 197, 207, 193, 213) + (40559).toString(36).toLowerCase() + (function() { |  | ||||||
|             var Q = Array.prototype.slice.call(arguments), |  | ||||||
|                 O = Q.shift(); |  | ||||||
|             return Q.reverse().map(function(e, u) { |  | ||||||
|                 return String.fromCharCode(e - O - 57 - u) |  | ||||||
|             }).join('') |  | ||||||
|         })(20, 125, 179, 176) + (766).toString(36).toLowerCase() + (function() { |  | ||||||
|             var E = Array.prototype.slice.call(arguments), |  | ||||||
|                 f = E.shift(); |  | ||||||
|             return E.reverse().map(function(s, C) { |  | ||||||
|                 return String.fromCharCode(s - f - 33 - C) |  | ||||||
|             }).join('') |  | ||||||
|         })(24, 158, 167); |  | ||||||
| 
 | 
 | ||||||
|         const socials = { |     // remove stream if embedded | ||||||
|             'matrix': { |     if (window.self !== window.top) { | ||||||
|                 'text': '💊 @vance:vance.land', |         document.getElementById('live').remove(); | ||||||
|                 'link': 'https://matrix.to/#/@vance:vance.land' |     } | ||||||
|             }, |  | ||||||
|             'feed': { |  | ||||||
|                 'text': `🥫 @${email}`, |  | ||||||
|                 'link': 'https://feed.vance.land/@vance' |  | ||||||
|             }, |  | ||||||
|             'live': { |  | ||||||
|                 'text': '🎥 live.vance.land', |  | ||||||
|                 'link': 'https://live.vance.land' |  | ||||||
|             }, |  | ||||||
|             'email': { |  | ||||||
|                 'text': `📧 ${email}`, |  | ||||||
|                 'link': `mailto:${email}` |  | ||||||
|             }, |  | ||||||
|             'urbit': { |  | ||||||
|                 'text': '🌐 ~sarsup-figput', |  | ||||||
|                 'link': 'https://sarsup-figput.vance.land/blog' |  | ||||||
|             }, |  | ||||||
|             'telegram': { |  | ||||||
|                 'text': '💬 @vanceland', |  | ||||||
|                 'link': 'https://t.me/vanceland' |  | ||||||
|             }, |  | ||||||
|             'code': { |  | ||||||
|                 'text': '🐱💻 code.vance.land', |  | ||||||
|                 'link': 'https://code.vance.land/vance' |  | ||||||
|             }, |  | ||||||
|             'music': { |  | ||||||
|                 'text': '🎶 @SMOOTHAPPLIANCE', |  | ||||||
|                 'link': 'https://soundcloud.com/smoothappliance' |  | ||||||
|             }, |  | ||||||
|             'haram': { |  | ||||||
|                 'text': '🕋', |  | ||||||
|                 'link': 'https://dreamsinco.de' |  | ||||||
|             } |  | ||||||
|         }; |  | ||||||
| 
 | 
 | ||||||
|         const vw = Math.max(document.documentElement.clientWidth || 0, window.innerWidth || 0); |     // check if stream active every 5 seconds | ||||||
|         const vh = Math.max(document.documentElement.clientHeight || 0, window.innerHeight || 0); |     setInterval(function checkLive() { | ||||||
| 
 |         fetch(new URL('index.m3u8', socials.live.link)) | ||||||
|         const min_speed = 10; |             .then(response => { | ||||||
|         const max_speed = 20; |                 document.getElementById('live').style.display = response.ok ? 'inline' : 'none'; | ||||||
|         let entities = 0; |  | ||||||
|         const max_entities = Math.floor(vw / 30); |  | ||||||
| 
 |  | ||||||
|         function animate(entity) { |  | ||||||
|             let flag = parseInt(entity.style.left, 10); |  | ||||||
| 
 |  | ||||||
|             setInterval(() => { |  | ||||||
|                 entity.style.left = `${--flag}px`; |  | ||||||
| 
 |  | ||||||
|                 if (entity.offsetWidth <= -flag) { |  | ||||||
|                     flag = vw + Math.floor(entity.offsetWidth / 2); |  | ||||||
|                     let posy = Math.floor(Math.random() * vh) - Math.floor(entity.offsetHeight / 2); |  | ||||||
|                     entity.style.top = `${posy}px`; |  | ||||||
|                 } |  | ||||||
|             }, Math.floor(Math.random() * (max_speed - min_speed) + min_speed)); |  | ||||||
|         } |  | ||||||
| 
 |  | ||||||
|         function createAnchor(link, content) { |  | ||||||
|             if (entities >= max_entities) { |  | ||||||
|                 return; |  | ||||||
|             } |  | ||||||
|             const entity = document.createElement('a'); |  | ||||||
|             entity.href = link; |  | ||||||
|             entity.target = '_blank'; |  | ||||||
|             entity.innerHTML = content; |  | ||||||
| 
 |  | ||||||
|             const posx = Math.floor(Math.random() * vw) - Math.floor(entity.offsetWidth / 2); |  | ||||||
|             const posy = Math.floor(Math.random() * vh) - Math.floor(entity.offsetHeight / 2); |  | ||||||
|             let z_index = Math.floor(entities - max_entities / 2); |  | ||||||
|             z_index = (z_index >= 0) ? z_index + 1 : z_index; |  | ||||||
| 
 |  | ||||||
|             entity.style.position = 'absolute'; |  | ||||||
|             entity.style.top = `${posy}px`; |  | ||||||
|             entity.style.left = `${posx}px`; |  | ||||||
|             entity.style.zIndex = `${z_index}`; |  | ||||||
| 
 |  | ||||||
|             document.body.prepend(entity); |  | ||||||
|             ++entities; |  | ||||||
|             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 |  | ||||||
|         while(entities < max_entities / 4) { |  | ||||||
|             for (const key in socials) { |  | ||||||
|                 createAnchor(socials[key].link, socials[key].text); |  | ||||||
|             } |  | ||||||
|         } |  | ||||||
| 
 |  | ||||||
|         fetch(`${socials.feed.link}.rss`) |  | ||||||
|             .then(response => response.text()) |  | ||||||
|             .then(str => new DOMParser().parseFromString(str, 'text/xml')) |  | ||||||
|             .then(data => { |  | ||||||
|                 const items = data.querySelectorAll('item'); |  | ||||||
|                 items.forEach(element => { |  | ||||||
|                     text = document.createElement('p'); |  | ||||||
|                     text.innerHTML = (element.getElementsByTagName('content:encoded')[0] ?? element.getElementsByTagName('title')[0]).textContent; |  | ||||||
|                     createAnchor(element.querySelector('link').innerHTML, text.outerHTML); |  | ||||||
|                 }); |  | ||||||
|             }); |             }); | ||||||
|  |         return checkLive; | ||||||
|  |     }(), 5000); | ||||||
| 
 | 
 | ||||||
|         function absoluteURL(data, query, url) { |     const vw = Math.max(document.documentElement.clientWidth || 0, window.innerWidth || 0); | ||||||
|             data.querySelectorAll(query).forEach(element => { |     const vh = Math.max(document.documentElement.clientHeight || 0, window.innerHeight || 0); | ||||||
|                 element.setAttribute('href', new URL(element.getAttribute('href'), url)); |     const min_speed = 10; | ||||||
|                 element.removeAttribute('rel'); |     const max_speed = 20; | ||||||
|             }); |     let entities = 0; | ||||||
|             return data; |     const max_entities = Math.floor(vw / 30); | ||||||
|  | 
 | ||||||
|  |     // animated anchors | ||||||
|  |     function animate(entity) { | ||||||
|  |         let flag = parseInt(entity.style.left, 10); | ||||||
|  | 
 | ||||||
|  |         setInterval(() => { | ||||||
|  |             entity.style.left = `${--flag}px`; | ||||||
|  | 
 | ||||||
|  |             if (entity.offsetWidth <= -flag) { | ||||||
|  |                 flag = vw + Math.floor(entity.offsetWidth / 2); | ||||||
|  |                 let posy = Math.floor(Math.random() * vh) - Math.floor(entity.offsetHeight / 2); | ||||||
|  |                 entity.style.top = `${posy}px`; | ||||||
|  |             } | ||||||
|  |         }, Math.floor(Math.random() * (max_speed - min_speed) + min_speed)); | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|  |     function createAnchor(link, content) { | ||||||
|  |         if (entities >= max_entities) { | ||||||
|  |             return; | ||||||
|         } |         } | ||||||
|  |         const entity = document.createElement('a'); | ||||||
|  |         entity.href = link; | ||||||
|  |         entity.target = '_blank'; | ||||||
|  |         entity.innerHTML = content; | ||||||
| 
 | 
 | ||||||
|         fetch(`${socials.code.link}.atom`) |         const posx = Math.floor(Math.random() * vw) - Math.floor(entity.offsetWidth / 2); | ||||||
|             .then(response => response.text()) |         const posy = Math.floor(Math.random() * vh) - Math.floor(entity.offsetHeight / 2); | ||||||
|             .then(str => new DOMParser().parseFromString(str, 'text/xml')) |         let z_index = Math.floor(entities - max_entities / 2); | ||||||
|             .then(data => { |         z_index = (z_index >= 0) ? z_index + 1 : z_index; | ||||||
|                 data = absoluteURL(data, 'link', socials.code.link); | 
 | ||||||
|                 const items = data.querySelectorAll('entry'); |         entity.style.position = 'absolute'; | ||||||
|                 items.forEach(element => { |         entity.style.top = `${posy}px`; | ||||||
|                     const title = absoluteURL(htmlDecode(element.querySelector('title').innerHTML), 'a', socials.code.link); |         entity.style.left = `${posx}px`; | ||||||
|                     createAnchor(element.querySelector('link').getAttribute('href'), title.body.innerHTML); |         entity.style.zIndex = `${z_index}`; | ||||||
|                 }); | 
 | ||||||
|  |         document.body.prepend(entity); | ||||||
|  |         ++entities; | ||||||
|  |         animate(entity); | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|  |     // Always have socials | ||||||
|  |     while (entities < max_entities / 4) { | ||||||
|  |         for (const key in socials) { | ||||||
|  |             createAnchor(socials[key].link, socials[key].text); | ||||||
|  |         } | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|  |     // feed | ||||||
|  |     fetch(`${socials.feed.link}.rss`) | ||||||
|  |         .then(response => response.text()) | ||||||
|  |         .then(str => new DOMParser().parseFromString(str, 'text/xml')) | ||||||
|  |         .then(data => { | ||||||
|  |             const items = data.querySelectorAll('item'); | ||||||
|  |             items.forEach(element => { | ||||||
|  |                 text = document.createElement('p'); | ||||||
|  |                 text.innerHTML = (element.getElementsByTagName('content:encoded')[0] ?? element.getElementsByTagName('title')[0]).textContent; | ||||||
|  |                 createAnchor(element.querySelector('link').innerHTML, text.outerHTML); | ||||||
|             }); |             }); | ||||||
|     </script> |         }); | ||||||
|  | 
 | ||||||
|  |     // code + helpers | ||||||
|  |     function absoluteURL(data, query, url) { | ||||||
|  |         data.querySelectorAll(query).forEach(element => { | ||||||
|  |             element.setAttribute('href', new URL(element.getAttribute('href'), url)); | ||||||
|  |             element.removeAttribute('rel'); | ||||||
|  |         }); | ||||||
|  |         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`) | ||||||
|  |         .then(response => response.text()) | ||||||
|  |         .then(str => new DOMParser().parseFromString(str, 'text/xml')) | ||||||
|  |         .then(data => { | ||||||
|  |             data = absoluteURL(data, 'link', socials.code.link); | ||||||
|  |             const items = data.querySelectorAll('entry'); | ||||||
|  |             items.forEach(element => { | ||||||
|  |                 const title = absoluteURL(htmlDecode(element.querySelector('title').innerHTML), 'a', socials.code.link); | ||||||
|  |                 createAnchor(element.querySelector('link').getAttribute('href'), title.body.innerHTML); | ||||||
|  |             }); | ||||||
|  |         }); | ||||||
|  | </script> | ||||||
| </body> | </body> | ||||||
| 
 | 
 | ||||||
| </html> | </html> | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user