diff --git a/Test.UI/Components/Layout/MainLayout.razor b/Test.UI/Components/Layout/MainLayout.razor index 5a24bb1..1a87012 100644 --- a/Test.UI/Components/Layout/MainLayout.razor +++ b/Test.UI/Components/Layout/MainLayout.razor @@ -1,8 +1,8 @@ @inherits LayoutComponentBase
- diff --git a/Test.UI/Components/Layout/MainLayout.razor.cs b/Test.UI/Components/Layout/MainLayout.razor.cs new file mode 100644 index 0000000..88d293f --- /dev/null +++ b/Test.UI/Components/Layout/MainLayout.razor.cs @@ -0,0 +1,15 @@ +namespace Test.UI.Components.Layout +{ + public partial class MainLayout + { + protected string sideClass { get; set; } = "sidebar"; + + protected void UpdateNavDisplay() + { + navLarge = !navLarge; + sideClass = navLarge ? "sidebar" : "sidebarSmall"; + } + + private bool navLarge = true; + } +} diff --git a/Test.UI/Components/Layout/MainLayout.razor.css b/Test.UI/Components/Layout/MainLayout.razor.css index 038baf1..5d0becd 100644 --- a/Test.UI/Components/Layout/MainLayout.razor.css +++ b/Test.UI/Components/Layout/MainLayout.razor.css @@ -1,96 +1,83 @@ -.page { - position: relative; - display: flex; - flex-direction: column; +.page { + position: relative; + display: flex; + flex-direction: column; } - main { - flex: 1; + flex: 1; + margin-left: 14rem; } - -.sidebar { - background-image: linear-gradient(180deg, rgb(5, 39, 103) 0%, #3a0647 70%); +.sidebar, +.sidebarSmall { + /*background-image: linear-gradient(180deg, rgb(5, 39, 103) 20%, #3aa6ff 90%);*/ + background: -webkit-linear-gradient(to bottom, #d5f1f2, #d5f1f2); + /* Chrome 10-25, Safari 5.1-6 */ + background: linear-gradient(to bottom, #d5f1f2, #d5f1f2); + /* W3C, IE 10+/ Edge, Firefox 16+, Chrome 26+, Opera 12+, Safari 7+ */ } - .top-row { - background-color: #f7f7f7; - border-bottom: 1px solid #d6d5d5; - justify-content: flex-end; - height: 3.5rem; - display: flex; - align-items: center; + background-color: #f7f7f7; + border-bottom: 1px solid #d6d5d5; + /*justify-content: flex-end;*/ + height: 3.5rem; + display: flex; + align-items: center; +} +.top-row ::deep a, +.top-row .btn-link { + white-space: nowrap; + margin-left: 1.5rem; +} +.top-row a:first-child { + overflow: hidden; + text-overflow: ellipsis; +} +.bottom-row { + color: #dedede; + background-color: #000000; + height: 1.6rem; + align-items: center; } - - .top-row ::deep a, .top-row ::deep .btn-link { - white-space: nowrap; - margin-left: 1.5rem; - text-decoration: none; - } - - .top-row ::deep a:hover, .top-row ::deep .btn-link:hover { - text-decoration: underline; - } - - .top-row ::deep a:first-child { - overflow: hidden; - text-overflow: ellipsis; - } - @media (max-width: 640.98px) { - .top-row { - justify-content: space-between; - } - - .top-row ::deep a, .top-row ::deep .btn-link { - margin-left: 0; - } -} - -@media (min-width: 641px) { - .page { - flex-direction: row; - } - - .sidebar { - width: 250px; - height: 100vh; - position: sticky; - top: 0; - } - - .top-row { - position: sticky; - top: 0; - z-index: 1; - } - - .top-row.auth ::deep a:first-child { - flex: 1; - text-align: right; - width: 0; - } - - .top-row, article { - padding-left: 2rem !important; - padding-right: 1.5rem !important; - } -} - -#blazor-error-ui { - background: lightyellow; - bottom: 0; - box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2); + .top-row:not(.auth) { display: none; - left: 0; - padding: 0.6rem 1.25rem 0.7rem 1.25rem; - position: fixed; - width: 100%; - z-index: 1000; + } + .top-row.auth { + justify-content: space-between; + } + .top-row a, + .top-row .btn-link { + margin-left: 0; + } } - - #blazor-error-ui .dismiss { - cursor: pointer; - position: absolute; - right: 0.75rem; - top: 0.5rem; - } +@media (min-width: 641px) { + .page { + flex-direction: row; + } + .sidebar { + width: 13.5rem; + height: 100vh; + position: fixed; + top: 0; + left: 0; + border-radius: 30px; + z-index: 1000; + } + .sidebarSmall { + width: 4.5rem; + height: 100vh; + position: sticky; + top: 0; + border-radius: 30px; + } + .top-row { + position: sticky; + top: 0; + z-index: 1; + } + .top-row, + article { + padding-left: 0.5rem !important; + padding-right: 0.5rem !important; + } +} \ No newline at end of file diff --git a/Test.UI/Components/Layout/MainLayout.razor.less b/Test.UI/Components/Layout/MainLayout.razor.less new file mode 100644 index 0000000..e2a6c3b --- /dev/null +++ b/Test.UI/Components/Layout/MainLayout.razor.less @@ -0,0 +1,92 @@ +.page { + position: relative; + display: flex; + flex-direction: column; +} + +main { + flex: 1; + margin-left: 14rem; +} + +.sidebar, +.sidebarSmall { + /*background-image: linear-gradient(180deg, rgb(5, 39, 103) 20%, #3aa6ff 90%);*/ + background: -webkit-linear-gradient(to bottom, #d5f1f2, #d5f1f2); /* Chrome 10-25, Safari 5.1-6 */ + background: linear-gradient(to bottom, #d5f1f2, #d5f1f2); /* W3C, IE 10+/ Edge, Firefox 16+, Chrome 26+, Opera 12+, Safari 7+ */ +} + +.top-row { + background-color: #f7f7f7; + border-bottom: 1px solid #d6d5d5; + /*justify-content: flex-end;*/ + height: 3.5rem; + display: flex; + align-items: center; +} + +.top-row ::deep a, .top-row .btn-link { + white-space: nowrap; + margin-left: 1.5rem; +} + +.top-row a:first-child { + overflow: hidden; + text-overflow: ellipsis; +} + +.bottom-row { + color: #dedede; + background-color: #000000; + height: 1.6rem; + align-items: center; +} + +@media (max-width: 640.98px) { + .top-row:not(.auth) { + display: none; + } + + .top-row.auth { + justify-content: space-between; + } + + .top-row a, .top-row .btn-link { + margin-left: 0; + } +} + +@media (min-width: 641px) { + .page { + flex-direction: row; + } + + .sidebar { + width: 13.5rem; + height: 100vh; + position: fixed; + top: 0; + left: 0; + border-radius: 30px; + z-index:1000; + } + + .sidebarSmall { + width: 4.5rem; + height: 100vh; + position: sticky; + top: 0; + border-radius: 30px; + } + + .top-row { + position: sticky; + top: 0; + z-index: 1; + } + + .top-row, article { + padding-left: 0.5rem !important; + padding-right: 0.5rem !important; + } +} diff --git a/Test.UI/Components/Layout/MainLayout.razor.min.css b/Test.UI/Components/Layout/MainLayout.razor.min.css new file mode 100644 index 0000000..3a0416e --- /dev/null +++ b/Test.UI/Components/Layout/MainLayout.razor.min.css @@ -0,0 +1 @@ +.page{position:relative;display:flex;flex-direction:column;}main{flex:1;margin-left:14rem;}.sidebar,.sidebarSmall{background:-webkit-linear-gradient(to bottom,#d5f1f2,#d5f1f2);background:linear-gradient(to bottom,#d5f1f2,#d5f1f2);}.top-row{background-color:#f7f7f7;border-bottom:1px solid #d6d5d5;height:3.5rem;display:flex;align-items:center;}.top-row ::deep a,.top-row .btn-link{white-space:nowrap;margin-left:1.5rem;}.top-row a:first-child{overflow:hidden;text-overflow:ellipsis;}.bottom-row{color:#dedede;background-color:#000;height:1.6rem;align-items:center;}@media(max-width:640.98px){.top-row:not(.auth){display:none;}.top-row.auth{justify-content:space-between;}.top-row a,.top-row .btn-link{margin-left:0;}}@media(min-width:641px){.page{flex-direction:row;}.sidebar{width:13.5rem;height:100vh;position:fixed;top:0;left:0;border-radius:30px;z-index:1000;}.sidebarSmall{width:4.5rem;height:100vh;position:sticky;top:0;border-radius:30px;}.top-row{position:sticky;top:0;z-index:1;}.top-row,article{padding-left:.5rem!important;padding-right:.5rem!important;}} \ No newline at end of file diff --git a/Test.UI/Components/Layout/NavMenu.razor b/Test.UI/Components/Layout/NavMenu.razor index a6ee1fe..c9fb1e4 100644 --- a/Test.UI/Components/Layout/NavMenu.razor +++ b/Test.UI/Components/Layout/NavMenu.razor @@ -1,46 +1,45 @@ -