99 lines
2.5 KiB
HTML
99 lines
2.5 KiB
HTML
|
<!DOCTYPE html>
|
||
|
<html lang="en">
|
||
|
<head>
|
||
|
<meta charset="utf-8">
|
||
|
<!-- meta name="color-scheme" content="dark light" /-->
|
||
|
<title>
|
||
|
Criminally Cute | Criminally Cute
|
||
|
</title>
|
||
|
<link rel="icon" type="image/png" href="/favicon.png">
|
||
|
<link rel="stylesheet" href="/css/site.css">
|
||
|
</head>
|
||
|
|
||
|
<body>
|
||
|
<header>
|
||
|
<nav>
|
||
|
<ul>
|
||
|
<li><a href="/">Home</a></li>
|
||
|
<li><a href="/about">About</a></li>
|
||
|
<li><a href="/blog">Blog</a></li>
|
||
|
<li><a href="/projects">Projects</a></li>
|
||
|
</ul>
|
||
|
</nav>
|
||
|
<div>
|
||
|
<h1>Criminally Cute</h1>
|
||
|
</div>
|
||
|
</header>
|
||
|
|
||
|
<main>
|
||
|
<article>
|
||
|
<p>Swing the lead bucko bilge water jib smartly reef crack Jennys tea cup gibbet pillage boatswain.</p>
|
||
|
<p>Ballast maroon fathom Sink me hempen halter Admiral of the Black scuppers jury mast Jolly Roger rutters. Gibbet Plate Fleet snow sloop Barbary Coast tender barque loot loaded to the gunwalls Brethren of the Coast. Sheet loot clap of thunder Nelsons folly Chain Shot case shot warp dance the hempen jig bucko quarter. </p>
|
||
|
</article>
|
||
|
</main>
|
||
|
|
||
|
<footer>
|
||
|
<ul>
|
||
|
<li>some link</li>
|
||
|
<li>some link 2</li>
|
||
|
</ul>
|
||
|
<div>
|
||
|
<p>© 2024 Criminally Cute</p>
|
||
|
<p><a class="underline" href="/feed.xml">RSS</a></p>
|
||
|
</div>
|
||
|
</footer>
|
||
|
</body>
|
||
|
</html>
|
||
|
|
||
|
|
||
|
<script>
|
||
|
function log(message) {
|
||
|
if (true) {
|
||
|
console.log(`[web_dev_utils] ${message}`)
|
||
|
}
|
||
|
}
|
||
|
function connect() {
|
||
|
try {
|
||
|
window.socket = new WebSocket('ws://' + location.host + '/ws');
|
||
|
|
||
|
window.socket.onmessage = function(e) {
|
||
|
if (e.data === "reload") {
|
||
|
log("reloading!");
|
||
|
location.reload();
|
||
|
} else if (e.data === "subscribed") {
|
||
|
log("connected and subscribed!");
|
||
|
}
|
||
|
}
|
||
|
|
||
|
window.socket.onopen = () => {
|
||
|
waitForConnection(() => {
|
||
|
log("sending 'subscribe' message");
|
||
|
window.socket.send("subscribe")
|
||
|
}
|
||
|
, 300);
|
||
|
};
|
||
|
|
||
|
window.socket.onclose = () => {
|
||
|
setTimeout(() => connect(), 500);
|
||
|
};
|
||
|
|
||
|
function waitForConnection(callback, interval) {
|
||
|
log("waiting for connection!")
|
||
|
if (window.socket.readyState === 1) {
|
||
|
callback();
|
||
|
} else {
|
||
|
log("setting a timeout")
|
||
|
setTimeout(() => waitForConnection(callback, interval), interval);
|
||
|
}
|
||
|
}
|
||
|
} catch (e) {
|
||
|
log(e);
|
||
|
setTimeout(() => connect(), 500);
|
||
|
}
|
||
|
}
|
||
|
|
||
|
log("about to connect");
|
||
|
connect();
|
||
|
</script>
|
||
|
|