Add ntfy section
This commit is contained in:
		
							parent
							
								
									246b874d25
								
							
						
					
					
						commit
						6f9336a08d
					
				
					 2 changed files with 61 additions and 0 deletions
				
			
		|  | @ -334,6 +334,41 @@ | ||||||
|             <img src="/assets/buttons/wii.png" alt="Wii" title="Wii" /> |             <img src="/assets/buttons/wii.png" alt="Wii" title="Wii" /> | ||||||
|         </li> |         </li> | ||||||
|     </ul> |     </ul> | ||||||
|  | 
 | ||||||
|  |     <h2 id="Notify">Notify</h2> | ||||||
|  | 
 | ||||||
|  |     <p> | ||||||
|  |         Send me a push notification. This will be a silent notification on my | ||||||
|  |         phone with no popup, vibration, or sound. | ||||||
|  |     </p> | ||||||
|  | 
 | ||||||
|  |     <input | ||||||
|  |         type="text" | ||||||
|  |         id="ntfy-message" | ||||||
|  |         placeholder="Message" | ||||||
|  |         minlength="15" | ||||||
|  |         maxlength="128" | ||||||
|  |     /> | ||||||
|  |     <button | ||||||
|  |         on:click={() => { | ||||||
|  |             const message = document.getElementById("ntfy-message").value; | ||||||
|  |             if (message.length < 15) | ||||||
|  |                 return alert( | ||||||
|  |                     `Message must be 15 to 128 chars. Current length is ${message.length}`, | ||||||
|  |                 ); | ||||||
|  |             fetch("https://ntfy.meow.company/pancakes", { | ||||||
|  |                 method: "POST", | ||||||
|  |                 body: message, | ||||||
|  |                 headers: { | ||||||
|  |                     Title: "pancakes.gay", | ||||||
|  |                     Priority: "min", | ||||||
|  |                     Tags: "black_cat", | ||||||
|  |                 }, | ||||||
|  |             }); | ||||||
|  |         }} | ||||||
|  |     > | ||||||
|  |         Send | ||||||
|  |     </button> | ||||||
| </main> | </main> | ||||||
| 
 | 
 | ||||||
| <style> | <style> | ||||||
|  |  | ||||||
|  | @ -396,6 +396,32 @@ mark { | ||||||
|     color: var(--background); |     color: var(--background); | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
|  | button, | ||||||
|  | input[type="submit"] { | ||||||
|  |     padding: 0.5em 1em; | ||||||
|  | 
 | ||||||
|  |     background-color: var(--accent-2); | ||||||
|  |     color: var(--background); | ||||||
|  |     border: none; | ||||||
|  |     border-radius: var(--radius); | ||||||
|  |     font-weight: bold; | ||||||
|  |     text-transform: uppercase; | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | input[type="text"] { | ||||||
|  |     padding: 0.5em; | ||||||
|  | 
 | ||||||
|  |     outline: none; | ||||||
|  |     background-color: var(--background-2); | ||||||
|  |     color: var(--foreground); | ||||||
|  |     border: 1px solid var(--foreground); | ||||||
|  |     border-radius: var(--radius); | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | input[type="text"]:focus { | ||||||
|  |     border-color: var(--accent); | ||||||
|  | } | ||||||
|  | 
 | ||||||
| td, | td, | ||||||
| th { | th { | ||||||
|     padding: 0.25em; |     padding: 0.25em; | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		
		Reference in a new issue