refactor styles

This commit is contained in:
thek4n 2026-03-23 15:07:22 +03:00
parent 29e960eec4
commit 4c242d48d8
3 changed files with 245 additions and 54 deletions

View File

@ -104,9 +104,9 @@ async fn main() {
let addr = resolve_addr(&args.host, args.port).unwrap();
println!("Server started on {addr}");
let listener = tokio::net::TcpListener::bind(addr).await.unwrap();
println!("Server started on {addr}");
axum::serve(listener, app).await.unwrap();
}

View File

@ -5,19 +5,76 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Обзор директории</title>
<style>
body { background-color: #121212; color: #e0e0e0; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; margin: 0; padding: 40px 20px; display: flex; justify-content: center; }
.content { max-width: 800px; width: 100%; background-color: #1e1e1e; padding: 40px; border-radius: 12px; box-shadow: 0 4px 20px rgba(0,0,0,0.5); }
h1 { color: #ffffff; border-bottom: 1px solid #333; padding-bottom: 10px; margin-top: 0; }
a { text-decoration: none !important; transition: opacity 0.2s; }
a:hover { opacity: 0.8; }
ul { list-style-type: none; padding: 0; margin: 0; }
li { padding: 10px 0; border-bottom: 1px solid #333; transition: background-color 0.2s; }
.file-link { color: #64b5f6; text-decoration: none !important; font-size: 1.1em; display: flex; align-items: center; }
.file-link:hover { color: #90caf9; }
.back-link { color: #90a4ae; font-weight: bold; text-decoration: none !important; display: block; }
.icon { margin-right: 10px; min-width: 24px; }
.footer { margin-top: 30px; color: #666; font-size: 0.9em; border-top: 1px solid #333; padding-top: 15px; }
.footer a { color: #757575; }
body {
background-color: #121212;
color: #e0e0e0;
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
margin: 0;
padding: 40px 20px;
display: flex;
justify-content: center;
}
.content {
max-width: 800px;
width: 100%;
background-color: #1e1e1e;
padding: 40px;
border-radius: 12px;
box-shadow: 0 4px 20px rgba(0,0,0,0.5);
}
h1 {
color: #ffffff;
border-bottom: 1px solid #333;
padding-bottom: 10px;
margin-top: 0;
}
a {
text-decoration: none !important;
transition: opacity 0.2s;
}
a:hover {
opacity: 0.8;
}
ul {
list-style-type: none;
padding: 0;
margin: 0;
}
li {
padding: 10px 0;
border-bottom: 1px solid #333;
transition: background-color 0.2s;
}
.file-link {
color: #64b5f6;
text-decoration: none !important;
font-size: 1.1em;
display: flex;
align-items: center;
}
.file-link:hover {
color: #90caf9;
}
.back-link {
color: #90a4ae;
font-weight: bold;
text-decoration: none !important;
display: block;
}
.icon {
margin-right: 10px;
min-width: 24px;
}
.footer {
margin-top: 30px;
color: #666;
font-size: 0.9em;
border-top: 1px solid #333;
padding-top: 15px;
}
.footer a {
color: #757575;
}
</style>
</head>
<body>

View File

@ -6,54 +6,187 @@
<title>{{TITLE}}</title>
<script src="https://cdn.jsdelivr.net/npm/mermaid@10/dist/mermaid.min.js"></script>
<style>
body { background-color: #121212; color: #e0e0e0; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; margin: 0; padding: 40px 20px; display: flex; justify-content: center; line-height: 1.6; }
.content { max-width: 800px; width: 100%; background-color: #1e1e1e; padding: 40px; border-radius: 12px; box-shadow: 0 4px 20px rgba(0,0,0,0.5); }
a { color: #bb86fc; text-decoration: none !important; }
h1, h2, h3, h4 { color: #ffffff; margin-top: 1.5em; margin-bottom: 0.5em; }
h1 { border-bottom: 1px solid #333; padding-bottom: 10px; }
table { border-collapse: collapse; width: 100%; margin: 1em 0; }
th, td { border: 1px solid #444; padding: 8px; text-align: left; }
th { background-color: #2c2c2c; }
blockquote { border-left: 4px solid #bb86fc; margin: 1em 0; padding-left: 1em; color: #aaa; background: #252525; padding: 10px; }
code { font-family: 'Consolas', 'Monaco', monospace; }
p > code, li > code { background-color: #2c2c2c; padding: 2px 6px; border-radius: 4px; color: #ff79c6; }
body {
background-color: #121212;
color: #e0e0e0;
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
margin: 0;
padding: 40px 20px;
display: flex;
justify-content: center;
line-height: 1.6;
}
.content {
max-width: 800px;
width: 100%;
background-color: #1e1e1e;
padding: 40px;
border-radius: 12px;
box-shadow: 0 4px 20px rgba(0,0,0,0.5);
}
a {
color: #bb86fc;
text-decoration: none !important;
}
h1, h2, h3, h4 {
color: #ffffff;
margin-top: 1.5em;
margin-bottom: 0.5em;
}
h1 {
border-bottom: 1px solid #333;
padding-bottom: 10px;
}
table {
border-collapse: collapse;
width: 100%;
margin: 1em 0;
}
th, td {
border: 1px solid #444;
padding: 8px;
text-align: left;
}
th {
background-color: #2c2c2c;
}
blockquote {
border-left: 4px solid #bb86fc;
margin: 1em 0;
padding-left: 1em;
color: #aaa;
background: #252525;
padding: 10px;
}
code {
font-family: 'Consolas', 'Monaco', monospace;
}
p > code, li > code {
background-color: #2c2c2c;
padding: 2px 6px;
border-radius: 4px;
color: #ff79c6;
}
.code-block-wrapper { margin: 1em 0; border: 1px solid #444; border-radius: 6px; overflow: hidden; background-color: #2b303b; }
.code-header { display: flex; justify-content: space-between; align-items: center; background-color: #232730; padding: 6px 12px; border-bottom: 1px solid #444; font-size: 0.85em; color: #a0a0a0; }
.code-lang { font-weight: bold; text-transform: uppercase; letter-spacing: 0.5px; }
.copy-btn { background: transparent; border: 1px solid #555; color: #ccc; padding: 2px 8px; border-radius: 4px; cursor: pointer; font-size: 0.8em; transition: all 0.2s; }
.copy-btn:hover { background-color: #444; color: #fff; border-color: #777; }
.copy-btn:active { transform: scale(0.95); }
pre { padding: 15px; overflow-x: auto; margin: 0; }
pre code { background: transparent; padding: 0; color: inherit; }
.code-block-wrapper {
margin: 1em 0;
border: 1px solid #444;
border-radius: 6px;
overflow: hidden;
background-color: #2b303b;
}
.code-header {
display: flex;
justify-content: space-between;
align-items: center;
background-color: #232730;
padding: 6px 12px;
border-bottom: 1px solid #444;
font-size: 0.85em;
color: #a0a0a0;
}
.code-lang {
font-weight: bold;
text-transform: uppercase;
letter-spacing: 0.5px;
}
.copy-btn {
background: transparent;
border: 1px solid #555;
color: #ccc;
padding: 2px 8px;
border-radius: 4px;
cursor: pointer;
font-size: 0.8em;
transition: all 0.2s;
}
.copy-btn:hover {
background-color: #444;
color: #fff;
border-color: #777;
}
.copy-btn:active {
transform: scale(0.95);
}
pre {
padding: 15px;
overflow-x: auto;
margin: 0;
}
pre code {
background: transparent;
padding: 0;
color: inherit;
}
.mermaid-wrapper .mermaid { background-color: #f9f9f9; border-radius: 0 0 6px 6px; display: flex; justify-content: center; }
.mermaid-wrapper .mermaid {
background-color: #f9f9f9;
border-radius: 0 0 6px 6px;
display: flex;
justify-content: center;
}
#status { position: fixed; top: 10px; right: 10px; padding: 5px 10px; border-radius: 4px; font-size: 12px; font-weight: bold; }
.connected { background-color: #2ecc71; color: #000; }
.disconnected { background-color: #e74c3c; color: #fff; }
.reconnecting { background-color: #f1c40f; color: #000; }
#status {
position: fixed;
top: 10px; right: 10px;
padding: 5px 10px;
border-radius: 4px;
font-size: 12px;
font-weight: bold;
}
.connected {
background-color: #2ecc71;
color: #000;
}
.disconnected {
background-color: #e74c3c;
color: #fff;
}
.reconnecting {
background-color: #f1c40f;
color: #000;
}
.footer { margin-top: 30px; color: #666; font-size: 0.9em; border-top: 1px solid #333; padding-top: 15px; }
.footer a { color: #757575; }
.footer {
margin-top: 30px;
color: #666;
font-size: 0.9em;
border-top: 1px solid #333;
padding-top: 15px;
}
.footer a {
color: #757575;
}
.back-link {
display: inline-flex;
align-items: center;
color: #90a4ae;
text-decoration: none;
font-size: 0.95em;
transition: color 0.2s;
}
img {
max-width: 100%;
height: auto;
display: block;
margin: 1.5em auto;
border-radius: 6px;
box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}
.back-link span {
margin-right: 8px;
font-size: 1.2em;
}
img {
max-width: 100%;
height: auto;
display: block;
margin: 1.5em auto;
border-radius: 6px;
box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}
</style>
</head>
<body>
<div class="content">
<div style="margin-bottom: 20px;">
<a href="{{BACK_LINK}}" style="display: inline-flex; align-items: center; color: #90a4ae; text-decoration: none; font-size: 0.95em; transition: color 0.2s;"
onmouseover="this.style.color='#ffffff'" onmouseout="this.style.color='#90a4ae'">
<span style="margin-right: 8px; font-size: 1.2em;"></span> Назад
</a>
<a href="{{BACK_LINK}}" class="back-link" onmouseover="this.style.color='#ffffff'" onmouseout="this.style.color='#90a4ae'">
<span></span> Назад
</a>
</div>
{{CONTENT}}
@ -83,9 +216,10 @@
function copyCode(button) {
const wrapper = button.closest('.code-block-wrapper');
if (!wrapper) return;
const target = wrapper.querySelector('pre') || wrapper.querySelector('.mermaid');
const target = wrapper.querySelector('pre') || wrapper.querySelector('.mermaid');
if (!target) return;
const codeText = target.innerText;
const codeText = target.innerText;
navigator.clipboard.writeText(codeText).then(() => {
const originalText = button.innerText;