From 4c242d48d858574a1d118fb1bc3d963ab92baafc Mon Sep 17 00:00:00 2001 From: thek4n Date: Mon, 23 Mar 2026 15:07:22 +0300 Subject: [PATCH] refactor styles --- src/main.rs | 2 +- templates/dir.html | 83 ++++++++++++++--- templates/file.html | 214 +++++++++++++++++++++++++++++++++++--------- 3 files changed, 245 insertions(+), 54 deletions(-) diff --git a/src/main.rs b/src/main.rs index 37df30b..b552a1c 100644 --- a/src/main.rs +++ b/src/main.rs @@ -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(); } diff --git a/templates/dir.html b/templates/dir.html index c3492d4..5d4943b 100644 --- a/templates/dir.html +++ b/templates/dir.html @@ -5,19 +5,76 @@ Обзор директории diff --git a/templates/file.html b/templates/file.html index c945ed4..54160ed 100644 --- a/templates/file.html +++ b/templates/file.html @@ -6,54 +6,187 @@ {{TITLE}}
- - Назад - + + Назад +
{{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;