Compare commits

...

10 commits

Author SHA1 Message Date
c9196ccbd6
Set ntfy to low prio 2024-12-03 21:05:38 +10:00
487b026a06
Improve ntfy 2024-12-03 20:56:27 +10:00
f2cfca2f1b
Revert "Use no-cors for ntfy"
This reverts commit b17de3a8e1.
2024-12-03 20:36:14 +10:00
b17de3a8e1
Use no-cors for ntfy 2024-12-03 20:33:35 +10:00
6e6db6d109
Use named function to submit ntfy message 2024-12-03 20:24:03 +10:00
697dfdab18
Add character count to ntfy message 2024-12-03 20:08:32 +10:00
bf089dd078
Fix embed image 2024-12-03 19:29:06 +10:00
6f9336a08d
Add ntfy section 2024-12-03 19:26:27 +10:00
246b874d25
Add meow.company button 2024-11-21 01:07:54 +10:00
92ee5122ea
Fix navbar issues and styling 2024-11-18 20:05:25 +10:00
5 changed files with 115 additions and 14 deletions

View file

@ -20,6 +20,7 @@
"href": "https://github.com/pancakesmeow",
"icon": "github-mark.png",
"iconInvert": true,
"mainOnly": true,
"name": "GitHub (inactive)",
"username": "pancakesmeow"
},

View file

@ -1,6 +1,6 @@
<script>
import links from "../../data/links.json";
import { page } from "$app/stores";
import links from "../../data/links.json";
</script>
<a href="#main-content" class="skip-to-main">Skip to main content</a>
@ -10,19 +10,22 @@
<a href="/">pancakes</a>
</span>
{#if $page.url.pathname !== "/"}
<ul>
<ul class="links">
{#each links as link}
<li>
<div class="icon-link">
<img
src={"/assets/icons/" + link.icon}
alt={link.name}
/>
<a href={link.href} target="_blank">
{link.name}
</a>
</div>
</li>
{#if link.href && !link.mainOnly}
<li>
<div class="icon-link">
<img
class={link.iconInvert ? "invert" : ""}
src={"/assets/icons/" + link.icon}
alt={link.name}
/>
<a href={link.href} target="_blank">
{link.name}
</a>
</div>
</li>
{/if}
{/each}
</ul>
{/if}

View file

@ -17,7 +17,7 @@
content={"https://trypancakes.com" + $page.url.pathname}
/>
<meta property="og:title" content={$page.data.title || "pancakes"} />
<meta property="og:image" content="https://trypancakes.com/favicon.png" />
<meta property="og:image" content="/favicon.png" />
<meta property="og:image:alt" content="a black cat with large eyes" />
</svelte:head>

View file

@ -4,6 +4,35 @@
import links from "../data/links.json";
const pages = getPages();
async function sendNtfyMessage() {
const message = document.getElementById("ntfy-message").value;
if (message.length < 15)
return alert(
`Message must be 15 to 128 characters. Current length is ${message.length}`,
);
var resp = await fetch("https://ntfy.meow.company/pancakes", {
method: "POST",
body: message,
headers: {
Title: "pancakes.gay",
Priority: "low",
Tags: "black_cat",
},
});
if (resp.ok) alert(`Sent: ${message}`);
}
function updateNtfyCharCount(_) {
const message = document.getElementById("ntfy-message").value;
const el = document.getElementById("ntfy-char-count");
if (message.length >= 15 && message.length <= 128)
el.setAttribute("style", "color: var(--success);");
else el.setAttribute("style", "color: var(--error);");
el.innerText = 128 - message.length;
}
</script>
<main id="main-content">
@ -91,6 +120,15 @@
</a>
</li>
<li>
<a href="https://meow.company" target="_blank" title="meow.company">
<img
src="https://meow.company/88x31.png"
alt="meow dot company"
/>
</a>
</li>
<li>
<a href="https://aagaming.me/" target="_blank" title="aagaming">
<img
@ -325,6 +363,28 @@
<img src="/assets/buttons/wii.png" alt="Wii" title="Wii" />
</li>
</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
on:input={updateNtfyCharCount}
type="text"
id="ntfy-message"
name="ntfy-message"
placeholder="Message"
minlength="15"
maxlength="128"
/>
<label for="ntfy-message" id="ntfy-char-count" style="color: var(--error);">
128
</label>
<br />
<button on:click={sendNtfyMessage} style="margin-top: 1rem;"> Send </button>
</main>
<style>

View file

@ -137,6 +137,16 @@ main:first-of-type {
max-width: 768px;
}
nav {
margin-left: auto;
margin-right: auto;
max-width: 768px;
}
nav .links {
font-size: small;
}
h1 {
border-bottom: 2px solid var(--accent-2);
font-size: xx-large;
@ -386,6 +396,33 @@ mark {
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;
cursor: pointer;
}
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,
th {
padding: 0.25em;