This commit is contained in:
vfs committed 2025-10-09 07:44:38 +02:00
1 parent 0069aeaa24
commit 943408255c
9 files changed
+403 -388

No files matched your search

+38 -38
View File
@@ -1,38 +1,38 @@
{{define "base"}}
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>{{template "title" .}}</title>
<script>
const ws = new WebSocket("wss://localhost:8443/ws");
ws.onopen = () => console.log("Connected")
ws.onmessage = (event) => console.log(event.data)
ws.onclose = () => console.log("Closed")
setInterval(() => {
if (ws.readyState === WebSocket.OPEN) {
const message = {
type: "ping",
timestamp: Date(),
random: Math.random()
};
ws.send(JSON.stringify(message))
}
}, 1000)
</script>
<style>
@import url('https://fonts.googleapis.com/css2?family=Alfa+Slab+One&display=swap');
</style>
<link rel="stylesheet" href="/static/style.css"/>
</head>
<body>
{{template "body" .}}
<h1>Hello, {{.Name}}!</h1>
<h1>This is THE PARTY.</h1>
</body>
</html>
{{end}}
{{define "base"}}
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>{{template "title" .}}</title>
<script>
const ws = new WebSocket("wss://localhost:8443/ws");
ws.onopen = () => console.log("Connected")
ws.onmessage = (event) => console.log(event.data)
ws.onclose = () => console.log("Closed")
setInterval(() => {
if (ws.readyState === WebSocket.OPEN) {
const message = {
type: "ping",
timestamp: Date(),
random: Math.random()
};
ws.send(JSON.stringify(message))
}
}, 1000)
</script>
<style>
@import url('https://fonts.googleapis.com/css2?family=Alfa+Slab+One&display=swap');
</style>
<link rel="stylesheet" href="/static/style.css"/>
</head>
<body>
{{template "body" .}}
<h1>Hello, {{.Name}}!</h1>
<h1>This is THE PARTY.</h1>
</body>
</html>
{{end}}
+7 -7
View File
@@ -1,7 +1,7 @@
{{template "base" .}}
{{define "title"}}Home{{end}}
{{define "body"}}
<h1>The Party?</h1>
{{end}}
{{template "base" .}}
{{define "title"}}Home{{end}}
{{define "body"}}
<h1>The Party?</h1>
{{end}}