diff --git a/SharpbinV2.Server/Program.cs b/SharpbinV2.Server/Program.cs index c0a6437..e45115c 100644 --- a/SharpbinV2.Server/Program.cs +++ b/SharpbinV2.Server/Program.cs @@ -843,6 +843,7 @@ namespace SharpbinV2.Server return; } var paste = await Database.GetPasteFromID(pasteid); + string authorUsername = null; if (paste == null) { context.Response.StatusCode = 400; @@ -852,15 +853,33 @@ namespace SharpbinV2.Server if (paste.AuthorUUID != "0") { var user = await Database.UserFromUUID(paste.AuthorUUID); - paste.AuthorUUID = user.Username; + authorUsername = user?.Username; } else { paste.AuthorUUID = "Anonymous"; + authorUsername = "Anonymous"; } - paste.FilePath = null; context.Response.StatusCode = 200; - await context.Response.WriteAsJsonAsync(new { success = true, paste = paste }); + await context.Response.WriteAsJsonAsync(new + { + success = true, + paste = new + { + paste.UUID, + paste.ID, + paste.Visibility, + paste.Title, + paste.AuthorUUID, + username = authorUsername, + paste.Created, + paste.Edited, + paste.Size, + paste.TrueSize, + paste.Views, + paste.Syntax + } + }); }); app.MapGet("/api/pastes/{pasteid}", async (HttpContext context) => { diff --git a/SharpbinV2.Server/wwwroot/archive.html b/SharpbinV2.Server/wwwroot/archive.html index 07d31f9..2fd5611 100644 --- a/SharpbinV2.Server/wwwroot/archive.html +++ b/SharpbinV2.Server/wwwroot/archive.html @@ -33,6 +33,6 @@ - + \ No newline at end of file diff --git a/SharpbinV2.Server/wwwroot/css/paste.css b/SharpbinV2.Server/wwwroot/css/paste.css index 9ddad5b..5741309 100644 --- a/SharpbinV2.Server/wwwroot/css/paste.css +++ b/SharpbinV2.Server/wwwroot/css/paste.css @@ -80,10 +80,20 @@ button { background-color: var(--neutral-800); color: var(--neutral-50); cursor: pointer; - transition: background-color 0.3s; + transition: background-color 0.2s; font-size: 1rem; } +button:hover { + background-color: var(--neutral-700); + border-color: var(--neutral-600); +} + +button:active { + background-color: var(--neutral-600); + border-color: var(--neutral-500); +} + .hljs { padding: 1rem; border-radius: 6px; diff --git a/SharpbinV2.Server/wwwroot/css/style.css b/SharpbinV2.Server/wwwroot/css/style.css index 958c782..f2dd5a8 100644 --- a/SharpbinV2.Server/wwwroot/css/style.css +++ b/SharpbinV2.Server/wwwroot/css/style.css @@ -7,7 +7,7 @@ } :root { - --neutral-50: #fafafa; + --neutral-50: #fafafa; --neutral-100: #f5f5f5; --neutral-200: #e5e5e5; --neutral-300: #d4d4d4; @@ -128,6 +128,7 @@ select:hover { outline: none; border: 1px solid var(--neutral-600); } + select:focus { outline: none; border: 1px solid var(--neutral-600); @@ -136,3 +137,48 @@ select:focus { #syntax { padding-left: 14rem; } + +#syntax-label { + margin-bottom: -2.3rem; + margin-top: 1.1rem; + z-index: 2; + align-self: flex-start; + margin-left: 1rem; + pointer-events: none; +} + +@media screen and (max-width: 800px) { + .main-container { + width: 90%; + } + + .create-form textarea { + max-height: 100%; + } + + #syntax-label { + margin-bottom: 0.5rem; + margin-top: 0.5rem; + margin-left: 0; + text-align: center; + align-self: center; + max-width: 12rem; + overflow: hidden; + white-space: nowrap; + /* + + possible style, just not good for small screens on desktop for some reason + + margin-left: 6.7rem; + max-width: 12rem; + overflow: hidden; + white-space: nowrap; + margin-bottom: -1.9rem; + + */ + } + + #syntax { + padding-left: 0.7rem; + } +} \ No newline at end of file diff --git a/SharpbinV2.Server/wwwroot/dash.html b/SharpbinV2.Server/wwwroot/dash.html index 330fba4..15ffa9d 100644 --- a/SharpbinV2.Server/wwwroot/dash.html +++ b/SharpbinV2.Server/wwwroot/dash.html @@ -48,5 +48,5 @@ - + \ No newline at end of file diff --git a/SharpbinV2.Server/wwwroot/error.html b/SharpbinV2.Server/wwwroot/error.html index 6cafda4..2523ce9 100644 --- a/SharpbinV2.Server/wwwroot/error.html +++ b/SharpbinV2.Server/wwwroot/error.html @@ -20,5 +20,5 @@ - + \ No newline at end of file diff --git a/SharpbinV2.Server/wwwroot/index.html b/SharpbinV2.Server/wwwroot/index.html index f032b3e..44abde4 100644 --- a/SharpbinV2.Server/wwwroot/index.html +++ b/SharpbinV2.Server/wwwroot/index.html @@ -20,7 +20,7 @@
- +