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> | <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,13 +71,11 @@ | |||||||
| </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 allowfullscreen height='350px' id='live' referrerpolicy='origin' scrolling='no' | ||||||
|  |         src='https://live.vance.land/vance/' title='live.vance.land' width='550px'> | ||||||
| </iframe> | </iframe> | ||||||
| <script> | <script> | ||||||
|         if (window.self !== window.top) { |  | ||||||
|             document.getElementById('live').remove(); |  | ||||||
|         } |  | ||||||
| 
 |  | ||||||
|     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(); | ||||||
| @ -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,12 +201,6 @@ | |||||||
|         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) { | ||||||
| @ -189,6 +208,7 @@ | |||||||
|         } |         } | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|  |     // 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')) | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user