@whykusanagi/corrupted-theme 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +339 -0
- package/Dockerfile +32 -0
- package/LICENSE +21 -0
- package/README.md +399 -0
- package/docker-entrypoint.sh +48 -0
- package/docs/COMPONENTS_REFERENCE.md +659 -0
- package/examples/.env.example +100 -0
- package/examples/button.html +436 -0
- package/examples/card.html +678 -0
- package/examples/form.html +555 -0
- package/examples/index.html +520 -0
- package/examples/layout.html +507 -0
- package/examples/nikke-team-builder.html +580 -0
- package/examples/showcase-complete.html +1071 -0
- package/examples/showcase.html +502 -0
- package/package.json +70 -0
- package/scripts/celeste-proxy-server.js +99 -0
- package/scripts/static-server.js +113 -0
- package/src/css/animations.css +649 -0
- package/src/css/components.css +1441 -0
- package/src/css/glassmorphism.css +217 -0
- package/src/css/nikke-utilities.css +530 -0
- package/src/css/theme.css +478 -0
- package/src/css/typography.css +198 -0
- package/src/css/utilities.css +239 -0
- package/src/css/variables.css +73 -0
- package/src/lib/celeste-proxy.js +215 -0
- package/src/lib/celeste-widget.js +1089 -0
- package/src/lib/corrupted-text.js +193 -0
- package/src/lib/corruption-loading.js +405 -0
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* Simple Static File Server
|
|
4
|
+
* Serves static files for whykusanagi.xyz portfolio
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
import http from 'http';
|
|
8
|
+
import fs from 'fs';
|
|
9
|
+
import path from 'path';
|
|
10
|
+
import { fileURLToPath } from 'url';
|
|
11
|
+
|
|
12
|
+
const __filename = fileURLToPath(import.meta.url);
|
|
13
|
+
const __dirname = path.dirname(__filename);
|
|
14
|
+
const ROOT_DIR = path.join(__dirname, '..');
|
|
15
|
+
|
|
16
|
+
const PORT = process.env.STATIC_PORT || 8000;
|
|
17
|
+
const HOST = process.env.HOST || '0.0.0.0';
|
|
18
|
+
|
|
19
|
+
// MIME types
|
|
20
|
+
const MIME_TYPES = {
|
|
21
|
+
'.html': 'text/html',
|
|
22
|
+
'.css': 'text/css',
|
|
23
|
+
'.js': 'application/javascript',
|
|
24
|
+
'.json': 'application/json',
|
|
25
|
+
'.png': 'image/png',
|
|
26
|
+
'.jpg': 'image/jpeg',
|
|
27
|
+
'.jpeg': 'image/jpeg',
|
|
28
|
+
'.gif': 'image/gif',
|
|
29
|
+
'.svg': 'image/svg+xml',
|
|
30
|
+
'.webm': 'video/webm',
|
|
31
|
+
'.mp4': 'video/mp4',
|
|
32
|
+
'.webp': 'image/webp',
|
|
33
|
+
'.ico': 'image/x-icon',
|
|
34
|
+
'.txt': 'text/plain'
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
function getMimeType(filePath) {
|
|
38
|
+
const ext = path.extname(filePath).toLowerCase();
|
|
39
|
+
return MIME_TYPES[ext] || 'application/octet-stream';
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
function serveFile(filePath, res) {
|
|
43
|
+
const fullPath = path.join(ROOT_DIR, filePath);
|
|
44
|
+
|
|
45
|
+
// Security: prevent directory traversal
|
|
46
|
+
if (!fullPath.startsWith(ROOT_DIR)) {
|
|
47
|
+
res.writeHead(403);
|
|
48
|
+
res.end('Forbidden');
|
|
49
|
+
return;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
fs.stat(fullPath, (err, stats) => {
|
|
53
|
+
if (err || !stats.isFile()) {
|
|
54
|
+
// Try index.html for directories
|
|
55
|
+
if (filePath.endsWith('/') || filePath === '') {
|
|
56
|
+
const indexPath = path.join(fullPath, 'index.html');
|
|
57
|
+
fs.stat(indexPath, (err2, stats2) => {
|
|
58
|
+
if (err2 || !stats2.isFile()) {
|
|
59
|
+
res.writeHead(404);
|
|
60
|
+
res.end('Not Found');
|
|
61
|
+
} else {
|
|
62
|
+
serveFileContent(indexPath, res);
|
|
63
|
+
}
|
|
64
|
+
});
|
|
65
|
+
} else {
|
|
66
|
+
res.writeHead(404);
|
|
67
|
+
res.end('Not Found');
|
|
68
|
+
}
|
|
69
|
+
return;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
serveFileContent(fullPath, res);
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
function serveFileContent(filePath, res) {
|
|
77
|
+
const mimeType = getMimeType(filePath);
|
|
78
|
+
|
|
79
|
+
fs.readFile(filePath, (err, data) => {
|
|
80
|
+
if (err) {
|
|
81
|
+
res.writeHead(500);
|
|
82
|
+
res.end('Internal Server Error');
|
|
83
|
+
return;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
res.writeHead(200, {
|
|
87
|
+
'Content-Type': mimeType,
|
|
88
|
+
'Cache-Control': 'public, max-age=3600'
|
|
89
|
+
});
|
|
90
|
+
res.end(data);
|
|
91
|
+
});
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
const server = http.createServer((req, res) => {
|
|
95
|
+
// Parse URL
|
|
96
|
+
const url = new URL(req.url, `http://${req.headers.host}`);
|
|
97
|
+
let filePath = url.pathname;
|
|
98
|
+
|
|
99
|
+
// Default to showcase-complete.html for root (comprehensive component showcase)
|
|
100
|
+
if (filePath === '/') {
|
|
101
|
+
filePath = '/examples/showcase-complete.html';
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
// Remove leading slash
|
|
105
|
+
filePath = filePath.substring(1);
|
|
106
|
+
|
|
107
|
+
serveFile(filePath, res);
|
|
108
|
+
});
|
|
109
|
+
|
|
110
|
+
server.listen(PORT, HOST, () => {
|
|
111
|
+
console.log(`📁 Static file server running on http://${HOST}:${PORT}`);
|
|
112
|
+
});
|
|
113
|
+
|