Initial commit

This commit is contained in:
2025-04-21 14:12:36 +02:00
commit 3fe2969b39
57 changed files with 17976 additions and 0 deletions

1
static/favicon.png Normal file
View File

@@ -0,0 +1 @@
iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAFt0lEQVRYR8WXe2xTVRzHP+fe29u1a7t2L8YGY2MvGGMTJgPGYPgCISoKaqIkJIZoUIkk/qHRqEGNJlGJiSb+IRoRDCoGlYmaIKgzKBBwjrGNsY5t7Nmu7V7t+rj3Hk/vbde1a0sZ0JM06f313t/3+/3O9/c7R+J/HtL/6V9oaS542xgdyNKlsKmEyvpOWuqSXcSzwMtAkRxnpgHYD2wE9gAaeQKZ0AJvG80DWbIk4a6vQw5kgpyD7KgAqQ7YAqxKdj0hAW8b9wI7GH6kHmlWKZKU3NW4aXTwpfEZbgW0VYNVgB8IBPwMDw3R5+r5BniipwUt2W1SFvC28RYwp2zObOY8vQizxZS0+ESGvr4B9r+2h+unuwDeABoHBgbw+/x4PB58Ph+SJFFdXU1ZWRl5eXnvAVtTE5wQGMefB86WlpQwc9H9VFTPSe12wux87Cgnjp4ACIwFSJIkCgsLsdvt2Gw2DAZDsrM3gdWpJMYJ+Nr4GNhQs6iaiiW1o4vP9qXTycflX9Df70m+mGazGafTSXl5OYpyS/4E8CTQnM5XRgK+Nj4Ani+vKMdZX0dOTo6+qQYDtLZCczMMDEBtLVRURCPwYMslDr7+FTAEbAeagNDo4uLmer2ejBZIS8Dr5u1M56XHl7FwdrG+4cmT0NwcjUDT4PJlcLth+XIwm/EHA3y37xTff/YzcANYe2A/n3s8Hk6dOsXAwABLly6loKBAJPkZ4N10BDIS8AfcVNfNZGN9DYrJBGfORIOPjqtXYcYMqKoCWWbI5+fg/pOcPnpW53hgPx95vV6OHTuGz+fTvxcUFLBixQpMJhPAx8Da1DgkJSDw7wJ2FB6tZE55oT54/DisXQsWC1y7BkNDUFgIc+dCQQGSHVweD4c/bObMb3/p8fs/Yufw8DB+vx+fz0dOTg4m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ff suppressed because one or more lines are too long

View File

@@ -0,0 +1,5 @@
<svg xmlns="http://www.w3.org/2000/svg" width="512" height="512" viewBox="0 0 512 512">
<rect width="512" height="512" fill="#282a36" rx="64" ry="64" />
<text x="256" y="300" font-family="Arial, sans-serif" font-size="240" text-anchor="middle" fill="#6272a4">MUD</text>
<path d="M128 96 L384 96 L256 224 Z" fill="#ff79c6" />
</svg>

After

Width:  |  Height:  |  Size: 337 B

59
static/manifest.json Normal file
View File

@@ -0,0 +1,59 @@
{
"name": "SvelteMUD Client",
"short_name": "SvelteMUD",
"description": "A modern MUD client built with Svelte",
"start_url": "/",
"display": "standalone",
"background_color": "#282a36",
"theme_color": "#6272a4",
"icons": [
{
"src": "icons/icon-72x72.png",
"sizes": "72x72",
"type": "image/png",
"purpose": "any maskable"
},
{
"src": "icons/icon-96x96.png",
"sizes": "96x96",
"type": "image/png",
"purpose": "any maskable"
},
{
"src": "icons/icon-128x128.png",
"sizes": "128x128",
"type": "image/png",
"purpose": "any maskable"
},
{
"src": "icons/icon-144x144.png",
"sizes": "144x144",
"type": "image/png",
"purpose": "any maskable"
},
{
"src": "icons/icon-152x152.png",
"sizes": "152x152",
"type": "image/png",
"purpose": "any maskable"
},
{
"src": "icons/icon-192x192.png",
"sizes": "192x192",
"type": "image/png",
"purpose": "any maskable"
},
{
"src": "icons/icon-384x384.png",
"sizes": "384x384",
"type": "image/png",
"purpose": "any maskable"
},
{
"src": "icons/icon-512x512.png",
"sizes": "512x512",
"type": "image/png",
"purpose": "any maskable"
}
]
}

95
static/pwa-loading.html Normal file
View File

@@ -0,0 +1,95 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>SvelteMUD - Loading</title>
<style>
body {
margin: 0;
padding: 0;
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
background-color: #282a36;
color: #f8f8f2;
height: 100vh;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
}
.logo {
width: 150px;
height: 150px;
background-color: #282a36;
border-radius: 20px;
display: flex;
align-items: center;
justify-content: center;
margin-bottom: 20px;
box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
animation: pulse 2s infinite;
}
.logo-text {
font-size: 36px;
font-weight: bold;
color: #ff79c6;
text-shadow: 0 0 10px rgba(255, 121, 198, 0.5);
}
.loading-text {
font-size: 18px;
margin-top: 20px;
}
.loading-spinner {
width: 40px;
height: 40px;
border-radius: 50%;
border: 3px solid #50fa7b;
border-top-color: transparent;
animation: spin 1s linear infinite;
margin-top: 20px;
}
@keyframes pulse {
0% {
transform: scale(1);
}
50% {
transform: scale(1.05);
}
100% {
transform: scale(1);
}
}
@keyframes spin {
0% {
transform: rotate(0deg);
}
100% {
transform: rotate(360deg);
}
}
</style>
</head>
<body>
<div class="logo">
<div class="logo-text">MUD</div>
</div>
<h1>SvelteMUD Client</h1>
<div class="loading-text">Loading your MUD client...</div>
<div class="loading-spinner"></div>
<script>
// Redirect to the main app after loading
window.addEventListener('load', () => {
setTimeout(() => {
window.location.href = '/';
}, 2000); // Redirect after 2 seconds
});
</script>
</body>
</html>

35
static/register-sw.js Normal file
View File

@@ -0,0 +1,35 @@
// Check if service workers are supported
if ('serviceWorker' in navigator) {
window.addEventListener('load', () => {
navigator.serviceWorker.register('/service-worker.js')
.then(registration => {
console.log('Service Worker registered with scope:', registration.scope);
// Check for updates to the Service Worker
registration.addEventListener('updatefound', () => {
const newWorker = registration.installing;
console.log('Service Worker update found!');
newWorker.addEventListener('statechange', () => {
if (newWorker.state === 'installed') {
if (navigator.serviceWorker.controller) {
// New content is available, notify user
console.log('New version available! Reload to update.');
// Optionally, display a notification to the user
if (window.confirm('A new version of this app is available. Reload to update?')) {
window.location.reload();
}
} else {
// First time install
console.log('App is now available offline!');
}
}
});
});
})
.catch(error => {
console.error('Service Worker registration failed:', error);
});
});
}

98
static/service-worker.js Normal file
View File

@@ -0,0 +1,98 @@
// Service worker for SvelteMUD Client PWA
const CACHE_NAME = 'svelte-mud-v1';
const ASSETS_TO_CACHE = [
'/',
'/index.html',
'/manifest.json',
'/favicon.ico',
'/global.css',
'/build/bundle.css',
'/build/bundle.js'
];
// Install event - cache critical assets
self.addEventListener('install', (event) => {
event.waitUntil(
caches.open(CACHE_NAME)
.then((cache) => {
return cache.addAll(ASSETS_TO_CACHE);
})
.then(() => {
return self.skipWaiting();
})
);
});
// Activate event - clean up old caches
self.addEventListener('activate', (event) => {
event.waitUntil(
caches.keys().then((cacheNames) => {
return Promise.all(
cacheNames.map((cacheName) => {
if (cacheName !== CACHE_NAME) {
return caches.delete(cacheName);
}
})
);
}).then(() => {
return self.clients.claim();
})
);
});
// Fetch event - serve from cache if available, otherwise fetch from network
self.addEventListener('fetch', (event) => {
// Skip cross-origin requests
if (!event.request.url.startsWith(self.location.origin) ||
event.request.method !== 'GET') {
return;
}
// For navigation requests (HTML pages), use a network-first strategy
if (event.request.mode === 'navigate') {
event.respondWith(
fetch(event.request)
.catch(() => {
return caches.match(event.request);
})
);
return;
}
// For all other requests, use a cache-first strategy
event.respondWith(
caches.match(event.request)
.then((response) => {
if (response) {
return response;
}
// Clone the request because it's a one-time use stream
const fetchRequest = event.request.clone();
return fetch(fetchRequest).then((response) => {
// Check if valid response
if (!response || response.status !== 200 || response.type !== 'basic') {
return response;
}
// Clone the response because it's a one-time use stream
const responseToCache = response.clone();
caches.open(CACHE_NAME)
.then((cache) => {
cache.put(event.request, responseToCache);
});
return response;
});
})
);
});
// Listen for messages from clients
self.addEventListener('message', (event) => {
if (event.data && event.data.type === 'SKIP_WAITING') {
self.skipWaiting();
}
});

19
static/sounds/README.md Normal file
View File

@@ -0,0 +1,19 @@
# Sound Files for SvelteMUD
This directory contains sound files that can be used for trigger sounds in the MUD client.
## Available Sounds
For production use, place sound files in this directory with the following recommended names:
- `alert.mp3` - General alert sound
- `beep.mp3` - Short beep for notifications
- `chime.mp3` - Chime sound for positive notifications
- `ding.mp3` - Ding sound for attention
- `notify.mp3` - General notification sound
You can add more sound files as needed, and they will be available for selection in the trigger editor.
## File Format
For best compatibility, use MP3 format with reasonable file sizes (under 100KB recommended).