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 | 
							
								
								
									
										61
									
								
								index.html
									
									
									
									
									
								
							
							
						
						
									
										61
									
								
								index.html
									
									
									
									
									
								
							| @ -4,11 +4,11 @@ | ||||
| 
 | ||||
| <head> | ||||
|     <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> | ||||
|     <meta name='description' content='vance.land'> | ||||
|     <meta name='author' content='vance'> | ||||
|     <meta content='vance.land' name='description'> | ||||
|     <meta content='vance' name='author'> | ||||
|     <base target='_blank'> | ||||
| 
 | ||||
|     <style> | ||||
| @ -21,7 +21,7 @@ | ||||
|             color: #20C20E; | ||||
|             font-family: 'VT323', monospace; | ||||
|             font-size: 16pt; | ||||
|             cursor: url('cursor.cur'), auto !important; | ||||
|             cursor: none; | ||||
|         } | ||||
| 
 | ||||
|         html { | ||||
| @ -52,6 +52,13 @@ | ||||
|             font-size: 1rem; | ||||
|         } | ||||
| 
 | ||||
|         #cursor { | ||||
|             position: absolute; | ||||
|             transform: translate(-95%, -45%); | ||||
|             z-index: 1; | ||||
|             pointer-events: none; | ||||
|         } | ||||
| 
 | ||||
|         #live { | ||||
|             position: fixed; | ||||
|             top: 50%; | ||||
| @ -64,13 +71,11 @@ | ||||
| </head> | ||||
| 
 | ||||
| <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 allowfullscreen height='350px' id='live' referrerpolicy='origin' scrolling='no' | ||||
|         src='https://live.vance.land/vance/' title='live.vance.land' width='550px'> | ||||
| </iframe> | ||||
| <script> | ||||
|         if (window.self !== window.top) { | ||||
|             document.getElementById('live').remove(); | ||||
|         } | ||||
| 
 | ||||
|     const email = (function () { | ||||
|         var p = Array.prototype.slice.call(arguments), | ||||
|             V = p.shift(); | ||||
| @ -102,7 +107,7 @@ | ||||
|         }, | ||||
|         'live': { | ||||
|             'text': '🎥 live.vance.land', | ||||
|                 'link': 'https://live.vance.land' | ||||
|             'link': 'https://live.vance.land/vance/' | ||||
|         }, | ||||
|         '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 vh = Math.max(document.documentElement.clientHeight || 0, window.innerHeight || 0); | ||||
| 
 | ||||
|     const min_speed = 10; | ||||
|     const max_speed = 20; | ||||
|     let entities = 0; | ||||
|     const max_entities = Math.floor(vw / 30); | ||||
| 
 | ||||
|     // animated anchors | ||||
|     function animate(entity) { | ||||
|         let flag = parseInt(entity.style.left, 10); | ||||
| 
 | ||||
| @ -176,12 +201,6 @@ | ||||
|         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) { | ||||
| @ -189,6 +208,7 @@ | ||||
|         } | ||||
|     } | ||||
| 
 | ||||
|     // feed | ||||
|     fetch(`${socials.feed.link}.rss`) | ||||
|         .then(response => response.text()) | ||||
|         .then(str => new DOMParser().parseFromString(str, 'text/xml')) | ||||
| @ -201,6 +221,7 @@ | ||||
|             }); | ||||
|         }); | ||||
| 
 | ||||
|     // code + helpers | ||||
|     function absoluteURL(data, query, url) { | ||||
|         data.querySelectorAll(query).forEach(element => { | ||||
|             element.setAttribute('href', new URL(element.getAttribute('href'), url)); | ||||
| @ -209,6 +230,12 @@ | ||||
|         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')) | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user