Skip to content

Commit

Permalink
optimizng Layout, _LognPartial sizes (spaces -> tabs)
Browse files Browse the repository at this point in the history
  • Loading branch information
ChaosEngine committed Aug 11, 2024
1 parent 61e67cd commit eae0994
Show file tree
Hide file tree
Showing 7 changed files with 172 additions and 167 deletions.
267 changes: 131 additions & 136 deletions DotnetPlayground.Web/Views/Shared/_Layout.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -7,144 +7,139 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no" />
<meta name="Description" content="Dotnet core examples, tests and experiments pages" />
<link rel="manifest" href="~/manifest.json" />
<link rel="icon" type="image/x-icon" href="~/images/favicon.png" />
<link rel="apple-touch-icon" href="~/images/favicon.png" />
<title>@ViewData["Title"] - @Conf["AppTitleName"]</title>
<environment include="Development">
<meta name="theme-color" content="darkslateblue" />
<link rel="stylesheet" href="~/lib/bootstrap/css/bootstrap.min.css" />
<link rel="stylesheet" href="~/css/site.css" asp-append-version="true" />
</environment>
<environment exclude="Development">
<meta name="theme-color" content="darkred" />
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" integrity="sha256-PI8n5gCcz9cQqQXm3PEtDuPG8qx9oFsFctPg0S5zb8g=" crossorigin="anonymous"
asp-fallback-href="~/lib/bootstrap/css/bootstrap.min.css"
asp-fallback-test-class="visually-hidden" asp-fallback-test-property="position" asp-fallback-test-value="absolute" />
<link rel="stylesheet" href="~/css/site.min.css" asp-append-version="true" />
</environment>
@RenderSection("headElements", required: false)
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no" />
<meta name="Description" content="Dotnet core examples, tests and experiments pages" />
<link rel="manifest" href="~/manifest.json" />
<link rel="icon" type="image/x-icon" href="~/images/favicon.png" />
<link rel="apple-touch-icon" href="~/images/favicon.png" />
<title>@ViewData["Title"] - @Conf["AppTitleName"]</title>
<environment include="Development">
<meta name="theme-color" content="darkslateblue" />
<link rel="stylesheet" href="~/lib/bootstrap/css/bootstrap.min.css" />
<link rel="stylesheet" href="~/css/site.css" asp-append-version="true" />
</environment>
<environment exclude="Development">
<meta name="theme-color" content="darkred" />
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" integrity="sha256-PI8n5gCcz9cQqQXm3PEtDuPG8qx9oFsFctPg0S5zb8g=" crossorigin="anonymous"
asp-fallback-href="~/lib/bootstrap/css/bootstrap.min.css"
asp-fallback-test-class="visually-hidden" asp-fallback-test-property="position" asp-fallback-test-value="absolute" />
<link rel="stylesheet" href="~/css/site.min.css" asp-append-version="true" />
</environment>
@RenderSection("headElements", required: false)
</head>
<body>
<header class="container">
<nav class="navbar navbar-expand-md navbar-dark fixed-top bg-my-theme">
<div class="container">
<span id="offlineIndicator"></span>
<a href="~/" class="navbar-brand" role="button" title="@dbs_config">@Environment.MachineName</a>
<button class="navbar-toggler" type="button"
data-bs-toggle="collapse"
data-bs-target="#navbarCollapse"
aria-controls="navbarCollapse"
aria-expanded="false"
aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarCollapse">
<ul class="navbar-nav me-auto">
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle" data-bs-toggle="dropdown" href="#" role="button" aria-haspopup="true" aria-expanded="false">Main</a>
<div class="dropdown-menu">
<a class="dropdown-item" href="~/">Home</a>
<a class="dropdown-item" href="~/Home/UnintentionalErr/">Unintentional Error</a>
<environment names="Development">
<a class="dropdown-item" href="~/ViewCodeGenerator">View Code Generator</a>
</environment>
<a class="dropdown-item" href="~/Home/About">About</a>
<a class="dropdown-item" href="~/Home/Contact">Contact</a>
</div>
</li>
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle" data-bs-toggle="dropdown" href="#" role="button" aria-haspopup="true" aria-expanded="false">Blogs</a>
<div class="dropdown-menu">
<a class="dropdown-item" href="~/Blogs">List</a>
<a class="dropdown-item" href="~/Blogs/Create">Create</a>
</div>
</li>
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle" data-bs-toggle="dropdown" href="#" role="button" aria-haspopup="true" aria-expanded="false">My Rainbow</a>
<div class="dropdown-menu">
<a class="dropdown-item" href="~/Hashes/">Hashes</a>
<a class="dropdown-item" href="~/BruteForce/">Brute Force</a>
<a class="dropdown-item" href="~/VirtualScroll/">Virtual Scroll</a>
</div>
</li>
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle" data-bs-toggle="dropdown" href="~/WebCamGallery" role="button" aria-haspopup="true" aria-expanded="false">WebCam</a>
<div class="dropdown-menu">
<cache>
@if (!string.IsNullOrEmpty(Conf["LiveWebCamURL"]))
{
<a class="dropdown-item" href="~/WebCamGallery">Live</a>
}
@if (!string.IsNullOrEmpty(Conf["BaseWebCamURL"]))
{
<a class="dropdown-item" href="~/WebCamGallery#video-tab">Daily video</a>
}
@if (!string.IsNullOrEmpty(Conf["YouTubeAPI:playlistId"]))
{
<a class="dropdown-item" href="~/WebCamGallery#youtube-tab">Youtube videos</a>
}
@if (!string.IsNullOrEmpty(Conf["ImageDirectory"]))
{
<a class="dropdown-item" href="~/WebCamGallery#gallery-tab">Gallery</a>
}
</cache>
</div>
</li>
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle" data-bs-toggle="dropdown" href="#" role="button" aria-haspopup="true" aria-expanded="false">InkBall</a>
<div class="dropdown-menu">
<a class="dropdown-item" href="~/InkBall/Home">Home</a>
<a class="dropdown-item" href="~/InkBall/GamesList" id="aInkList">Game list</a>
<a class="dropdown-item" href="~/InkBall/Game" id="aInkGame">Game</a>
<a class="dropdown-item" href="~/InkBall/Highscores" id="aInkGameHigh">Highscores</a>
<a class="dropdown-item" href="~/Identity/Account/Register" id="aInkRegister">Register</a>
<a class="dropdown-item" href="~/InkBall/Rules">Rules</a>
</div>
</li>
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle" title="Work in progress" data-bs-toggle="dropdown" href="#" role="button" aria-haspopup="true" aria-expanded="false">WIP...</a>
<div class="dropdown-menu">
<a class="dropdown-item" href="~/PuzzleGenerator">Puzzle Generator</a>
<a class="dropdown-item" href="~/BeepExperiment">Beep Experiment</a>
</div>
</li>
</ul>
<partial name="_LoginPartial" />
</div>
</div>
</nav>
</header>
<main class="container body-content">
@RenderBody()
<hr />
</main>
<footer class="container">
<noscript>Your browser does not support JavaScript! REALLY?!</noscript>
<p id="spVersion">&copy; 2022 - @Conf["AppTitleName"]</p>
</footer>
<environment include="Development">
<script src="~/lib/jquery/jquery.min.js"></script>
<script src="~/lib/bootstrap/js/bootstrap.bundle.min.js"></script>
<script src="~/js/site.js" asp-append-version="true"></script>
@*This is the fix, to enforce manual loading, but why? https://github.com/dotnet/aspnetcore/issues/39715 *@
@* <script src="/_framework/aspnetcore-browser-refresh.js"></script> *@
</environment>
<environment exclude="Development">
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/jquery.min.js" integrity="sha256-/JqT3SQfawRcv/BIHPThkBvs0OEvtFFmqPF/lYI/Cxo=" crossorigin="anonymous"
asp-fallback-src="~/lib/jquery/jquery.min.js"
asp-fallback-test="window.jQuery">
</script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js" integrity="sha256-CDOy6cOibCWEdsRiZuaHf8dSGGJRYuBGC+mjoJimHGw=" crossorigin="anonymous"
asp-fallback-src="~/lib/bootstrap/js/bootstrap.bundle.min.js"
asp-fallback-test="window.bootstrap">
</script>
<script src="~/js/site.min.js" asp-append-version="true"></script>
</environment>
<header class="container">
<nav class="navbar navbar-expand-md navbar-dark fixed-top bg-my-theme">
<div class="container">
<span id="offlineIndicator"></span>
<a href="~/" class="navbar-brand" role="button" title="@dbs_config">@Environment.MachineName</a>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarCollapse" aria-controls="navbarCollapse" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarCollapse">
<ul class="navbar-nav me-auto">
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle" data-bs-toggle="dropdown" href="#" role="button" aria-haspopup="true" aria-expanded="false">Main</a>
<div class="dropdown-menu">
<a class="dropdown-item" href="~/">Home</a>
<a class="dropdown-item" href="~/Home/UnintentionalErr/">Unintentional Error</a>
<environment names="Development">
<a class="dropdown-item" href="~/ViewCodeGenerator">View Code Generator</a>
</environment>
<a class="dropdown-item" href="~/Home/About">About</a>
<a class="dropdown-item" href="~/Home/Contact">Contact</a>
</div>
</li>
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle" data-bs-toggle="dropdown" href="#" role="button" aria-haspopup="true" aria-expanded="false">Blogs</a>
<div class="dropdown-menu">
<a class="dropdown-item" href="~/Blogs">List</a>
<a class="dropdown-item" href="~/Blogs/Create">Create</a>
</div>
</li>
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle" data-bs-toggle="dropdown" href="#" role="button" aria-haspopup="true" aria-expanded="false">My Rainbow</a>
<div class="dropdown-menu">
<a class="dropdown-item" href="~/Hashes/">Hashes</a>
<a class="dropdown-item" href="~/BruteForce/">Brute Force</a>
<a class="dropdown-item" href="~/VirtualScroll/">Virtual Scroll</a>
</div>
</li>
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle" data-bs-toggle="dropdown" href="~/WebCamGallery" role="button" aria-haspopup="true" aria-expanded="false">WebCam</a>
<div class="dropdown-menu">
<cache>
@if (!string.IsNullOrEmpty(Conf["LiveWebCamURL"]))
{
<a class="dropdown-item" href="~/WebCamGallery">Live</a>
}
@if (!string.IsNullOrEmpty(Conf["BaseWebCamURL"]))
{
<a class="dropdown-item" href="~/WebCamGallery#video-tab">Daily video</a>
}
@if (!string.IsNullOrEmpty(Conf["YouTubeAPI:playlistId"]))
{
<a class="dropdown-item" href="~/WebCamGallery#youtube-tab">Youtube videos</a>
}
@if (!string.IsNullOrEmpty(Conf["ImageDirectory"]))
{
<a class="dropdown-item" href="~/WebCamGallery#gallery-tab">Gallery</a>
}
</cache>
</div>
</li>
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle" data-bs-toggle="dropdown" href="#" role="button" aria-haspopup="true" aria-expanded="false">InkBall</a>
<div class="dropdown-menu">
<a class="dropdown-item" href="~/InkBall/Home">Home</a>
<a class="dropdown-item" href="~/InkBall/GamesList" id="aInkList">Game list</a>
<a class="dropdown-item" href="~/InkBall/Game" id="aInkGame">Game</a>
<a class="dropdown-item" href="~/InkBall/Highscores" id="aInkGameHigh">Highscores</a>
<a class="dropdown-item" href="~/Identity/Account/Register" id="aInkRegister">Register</a>
<a class="dropdown-item" href="~/InkBall/Rules">Rules</a>
</div>
</li>
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle" title="Work in progress" data-bs-toggle="dropdown" href="#" role="button" aria-haspopup="true" aria-expanded="false">WIP...</a>
<div class="dropdown-menu">
<a class="dropdown-item" href="~/PuzzleGenerator">Puzzle Generator</a>
<a class="dropdown-item" href="~/BeepExperiment">Beep Experiment</a>
</div>
</li>
</ul>
<partial name="_LoginPartial" />
</div>
</div>
</nav>
</header>
<main class="container body-content">
@RenderBody()
<hr />
</main>
<footer class="container">
<noscript>Your browser does not support JavaScript! REALLY?!</noscript>
<p id="spVersion">&copy; 2022 - @Conf["AppTitleName"]</p>
</footer>
<environment include="Development">
<script src="~/lib/jquery/jquery.min.js"></script>
<script src="~/lib/bootstrap/js/bootstrap.bundle.min.js"></script>
<script src="~/js/site.js" asp-append-version="true"></script>
@*This is the fix, to enforce manual loading, but why? https://github.com/dotnet/aspnetcore/issues/39715 *@
@* <script src="/_framework/aspnetcore-browser-refresh.js"></script> *@
</environment>
<environment exclude="Development">
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/jquery.min.js" integrity="sha256-/JqT3SQfawRcv/BIHPThkBvs0OEvtFFmqPF/lYI/Cxo=" crossorigin="anonymous"
asp-fallback-src="~/lib/jquery/jquery.min.js"
asp-fallback-test="window.jQuery">
</script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js" integrity="sha256-CDOy6cOibCWEdsRiZuaHf8dSGGJRYuBGC+mjoJimHGw=" crossorigin="anonymous"
asp-fallback-src="~/lib/bootstrap/js/bootstrap.bundle.min.js"
asp-fallback-test="window.bootstrap">
</script>
<script src="~/js/site.min.js" asp-append-version="true"></script>
</environment>

@RenderSection("scripts", required: false)
@RenderSection("scripts", required: false)
</body>
</html>
42 changes: 21 additions & 21 deletions DotnetPlayground.Web/Views/Shared/_LoginPartial.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -7,27 +7,27 @@
@inject UserManager<ApplicationUser> UserManager

<ul class="navbar-nav ms-auto">
<li class="nav-item dropdown">
@if (User.Identity.IsAuthenticated)
{
var user = await UserManager.GetUserAsync(User);
<li class="nav-item dropdown">
@if (User.Identity.IsAuthenticated)
{
var user = await UserManager.GetUserAsync(User);

<a class="nav-link dropdown-toggle" data-bs-toggle="dropdown" href="#" role="button" aria-haspopup="true" aria-expanded="false">Hello @user.Name!</a>
<div class="dropdown-menu">
<a class="dropdown-item" href="~/Identity/Account/Manage/Index" title="Manage">Manage profile</a>
<form action="~/Identity/Account/Logout" method="post" id="logoutForm">
<button type="submit" class="btn btn-link dropdown-item text-warning">Logout</button>
</form>
</div>
}
else
{
<a class="nav-link dropdown-toggle" data-bs-toggle="dropdown" href="#" role="button" aria-haspopup="true" aria-expanded="false">Profile</a>
<div class="dropdown-menu">
<a class="dropdown-item" href="~/Identity/Account/Register">Register</a>
<a class="dropdown-item" href="~/Identity/Account/Login">Login</a>
</div>
}
</li>
<a class="nav-link dropdown-toggle" data-bs-toggle="dropdown" href="#" role="button" aria-haspopup="true" aria-expanded="false">Hello @user.Name!</a>
<div class="dropdown-menu">
<a class="dropdown-item" href="~/Identity/Account/Manage/Index" title="Manage">Manage profile</a>
<form action="~/Identity/Account/Logout" method="post" id="logoutForm">
<button type="submit" class="btn btn-link dropdown-item text-warning">Logout</button>
</form>
</div>
}
else
{
<a class="nav-link dropdown-toggle" data-bs-toggle="dropdown" href="#" role="button" aria-haspopup="true" aria-expanded="false">Profile</a>
<div class="dropdown-menu">
<a class="dropdown-item" href="~/Identity/Account/Register">Register</a>
<a class="dropdown-item" href="~/Identity/Account/Login">Login</a>
</div>
}
</li>
</ul>
</cache>
2 changes: 1 addition & 1 deletion DotnetPlayground.Web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
"@playwright/test": "1.46.0",
"concaveman": "1.2.1",
"density-clustering": "1.3.0",
"eslint": "9.8.0",
"eslint": "9.9.0",
"fs-extra": "11.2.0",
"gulp": "5.0.0",
"gulp-concat": "2.6.1",
Expand Down
7 changes: 5 additions & 2 deletions DotnetPlayground.Web/wwwroot/css/site.css
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ body {
color: white;
background-color: rgb(33, 37, 41);
}
.form-select, .form-control, .accordion-item, .accordion-button, .fixed-table-loading, a.nav-link.active {
.form-select, .form-control, .accordion-item, .accordion-button, .fixed-table-loading {
color: white !important;
background-color: rgb(33, 37, 41) !important;
}
Expand Down Expand Up @@ -68,7 +68,10 @@ main.container > hr {
color: #fff;
}

.nav-link:focus-visible {
.nav-link.show {
background-color: gray;
}
.nav-link:focus-visible, .nav-link:hover {
outline-offset: 1px;
outline: 0.8px auto rgb(16, 16, 16);
}
Expand Down
Loading

0 comments on commit eae0994

Please sign in to comment.