tidy up sidebar scss
Some checks failed
Build and Push Docker Image / build (push) Has been cancelled

This commit is contained in:
Corban-Lee Jones 2024-10-14 11:13:38 +01:00
parent 38b8184499
commit 1d6e7c6884
2 changed files with 240 additions and 363 deletions

View File

@ -1,3 +1,4 @@
@import "../../../../../static/bootstrap-5.3.3/scss/bootstrap.scss";
@import "./sidebar.scss"; @import "./sidebar.scss";
@keyframes bump { @keyframes bump {

View File

@ -1,106 +1,3 @@
// .sidebar-backdrop {
// position: fixed;
// top: 0;
// left: 0;
// width: 100%;
// height: 100%;
// backdrop-filter: blur(10px);
// background-color: rgba(var(--bs-secondary-rgb), 0.50);
// z-index: 998;
// display: none; /* Must start as hidden! */
// }
// .reveal-sidebar-btn {
// z-index: 998;
// display: none;
// position: fixed;
// bottom: 1rem;
// right: 1rem;
// // @include media-breakpoint-down(xl) {
// // display: block;
// // }
// }
// .sidebar {
// display: flex;
// flex-direction: column;
// flex-shrink: 0;
// width: 300px;
// color: var(--bs-body-color);
// background-color: var(--bs-secondary-bg-subtle);
// transition: transform 0.3s ease-in-out;
// z-index: 999;
// .sidebar-divider {
// }
// .sidebar-header {
// .sidebar-header-link {
// }
// .sidebar-logo {
// }
// .sidebar-title {
// }
// }
// .sidebar-content {
// .sidebar-placeholder {
// .sidebar-placeholder-image {
// }
// .sidebar-placeholder-data {
// >.placeholder {
// }
// }
// }
// .sidebar-item {
// &:not(:disabled):hover,
// &:not(:disabled):focus,
// &.active {
// }
// &.spot::before {
// &:not(:disabled):hover,
// &:not(:disabled):focus,
// &.active {
// }
// }
// }
// }
// }
/* Backdrop */
.sidebar-backdrop { .sidebar-backdrop {
position: fixed; position: fixed;
top: 0; top: 0;
@ -113,28 +10,21 @@
display: none; /* Must start as hidden! */ display: none; /* Must start as hidden! */
} }
/* Show Sidebar Button */
.reveal-sidebar-btn { .reveal-sidebar-btn {
z-index: 998; z-index: 998;
display: none; display: none;
position: fixed; position: fixed;
bottom: 1rem; bottom: 1rem;
right: 1rem; right: 1rem;
@include media-breakpoint-down(xl) { display: block; }
} }
.server-rate-limit { display: none; }
/* Hide Sidebar Button */
.sidebar .btn-close {
display: none;
}
/* Sidebar */
.sidebar { .sidebar {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
flex-shrink: 0; flex-shrink: 0;
@ -143,262 +33,248 @@
background-color: var(--bs-secondary-bg-subtle); background-color: var(--bs-secondary-bg-subtle);
transition: transform 0.3s ease-in-out; transition: transform 0.3s ease-in-out;
z-index: 999; z-index: 999;
}
@media (max-width: 992px) { // Hide the sidebar
.reveal-sidebar-btn { @include media-breakpoint-down(xl) {
display: block; transform: translateX(-100%);
}
.sidebar .btn-close {
display: block;
}
.sidebar {
position: fixed; position: fixed;
left: 0; left: 0;
top: 0; top: 0;
bottom: 0; bottom: 0;
transform: translateX(-100%);
} }
.sidebar.visible { // Show the sidebar on smaller screens
transform: translateX(0); &.visible {
@include media-breakpoint-down(xl) { transform: translateX(0); }
@include media-breakpoint-down(sm) { width: 100vw; }
} }
}
@media (max-width: 360px) { .sidebar-divider { margin: 1rem; }
.sidebar.visible {
width: 100vw; .sidebar-header {
display: flex;
align-items: center;
padding: 1rem 1rem 0 1rem;
text-decoration: none;
color: inherit;
.sidebar-header-link {
display: flex;
align-items: center;
text-decoration: none;
color: inherit;
.sidebar-logo {
width: 45px;
margin-right: 0.5rem;
}
.sidebar-title {
font-size: 2rem;
font-weight: bold;
}
}
// Hide on larger screens, show on smaller screens
.btn-close {
display: none;
@include media-breakpoint-down(xl) { display: block; }
}
} }
}
.sidebar-content {
/* Divider */ padding: 0 1rem ;
margin-bottom: auto;
.sidebar .sidebar-divider { list-style: none;
margin: 1rem;
} .sidebar-placeholder {
display: flex;
/* Header */ align-items: center;
width: 100%;
.sidebar .sidebar-header { padding: 0.5rem;
display: flex; border: none;
align-items: center;
padding: 1rem 1rem 0 1rem; .sidebar-placeholder-image {
text-decoration: none;
color: inherit; flex-shrink: 0;
} width: 50px;
height: 50px;
.sidebar .sidebar-header .sidebar-header-link { margin-right: 0.75rem;
display: flex; border-radius: $border-radius-sm;
align-items: center;
text-decoration: none; }
color: inherit;
} .sidebar-placeholder-data {
.sidebar .sidebar-header .sidebar-logo { display: flex;
width: 45px; flex-direction: column;
margin-right: 0.5rem; overflow: hidden;
} width: 100%;
.sidebar .sidebar-header .sidebar-title { >.placeholder { border-radius: $border-radius-sm; }
font-size: 2rem;
font-weight: bold; }
}
}
/* Content */ .sidebar-item {
.sidebar .sidebar-content { position: relative;
margin-bottom: auto; display: flex;
padding: 0 1rem; align-items: center;
list-style: none; width: 100%;
} padding: 0.5rem;
border: none;
border-radius: $border-radius-sm;
/* Content - Placeholder */ background-color: inherit;
.sidebar .sidebar-content .sidebar-placeholder { // Highlight effect
display: flex; &:not(:disabled):hover,
align-items: center; &:not(:disabled):focus,
width: 100%; &.active { background-color: var(--bs-body-bg); }
padding: 0.5rem;
border: none; // 'Spot' is an alert indicator, that appears as a coloured dot against a sidebar item
} &.spot {
.sidebar .sidebar-content .sidebar-placeholder .sidebar-placeholder-image { &::before {
flex-shrink: 0;
width: 50px; content: "";
height: 50px; transition: 0.1s ease;
margin-right: 0.75rem; transform: translate(-100%, -50%);
border-radius: var(--bs-border-radius-sm); position: absolute;
} left: 0;
top: 50%;
.sidebar .sidebar-content .sidebar-placeholder .sidebar-placeholder-data { width: 0.5rem;
display: flex; height: 0.5rem;
flex-direction: column; border-radius: 50%;
width: 100%; background-color: var(--bs-body-bg);
overflow: hidden;
} }
.sidebar .sidebar-content .sidebar-placeholder .sidebar-placeholder-data > .placeholder { &:not(:disabled):hover::before,
border-radius: var(--bs-border-radius-sm); &:not(:disabled):focus::before,
} &.active::before {
transform: 0.15s ease;
/* Content (Servers) */ width: 0.25rem;
height: 60px;
.sidebar .sidebar-content .sidebar-item { border-radius: 0.25rem 0 0 0.25rem;
position: relative;
display: flex; }
align-items: center;
width: 100%; // Spot Colours
padding: 0.5rem; &.spot-primary::before { background-color: var(--bs-primary); }
border: none; &.spot-secondary::before { background-color: var(--bs-secondary); }
border-radius: var(--bs-border-radius-sm); &.spot-success::before { background-color: var(--bs-success); }
background-color: inherit; &.spot-danger::before { background-color: var(--bs-danger); }
} &.spot-warning::before { background-color: var(--bs-warning); }
&.spot-info::before { background-color: var(--bs-info); }
.sidebar .sidebar-content .sidebar-item:not(:disabled):hover,
.sidebar .sidebar-content .sidebar-item:not(:disabled):focus, }
.sidebar .sidebar-content .sidebar-item.active {
background-color: var(--bs-body-bg); .sidebar-item-image {
}
display: flex;
/* Content Alerts */ justify-content: center;
align-items: center;
.sidebar .sidebar-content .sidebar-item.spot::before { flex-shrink: 0;
content: ""; width: 50px;
transition: 0.1s ease; height: 50px;
transform: translate(-100%, -50%); border-radius: $border-radius-sm;
position: absolute; margin-right: 0.75rem;
left: 0;
top: 50%; }
width: 0.5rem;
height: 0.5rem; // Includes the server name and id
border-radius: 50%; .sidebar-item-data {
background-color: var(--bs-body-bg);
} display: flex;
flex-direction: column;
.sidebar .sidebar-content .sidebar-item.spot:not(:disabled):hover::before, width: 100%;
.sidebar .sidebar-content .sidebar-item.spot:not(:disabled):focus::before, overflow: hidden;
.sidebar .sidebar-content .sidebar-item.spot.active::before {
transition: 0.15s ease; &>span {
width: 0.25rem;
height: 60px; text-align: start;
border-radius: 0.25rem 0 0 0.25rem; display: block;
} width: 100%;
white-space: nowrap;
/* Content Alerts Colours */ overflow: hidden;
text-overflow: ellipsis;
.sidebar .sidebar-content .sidebar-item.spot.spot-primary::before {
background-color: var(--bs-primary); }
}
.sidebar .sidebar-content .sidebar-item.spot.spot-secondary::before { }
background-color: var(--bs-secondary);
} }
.sidebar .sidebar-content .sidebar-item.spot.spot-success::before {
background-color: var(--bs-success); }
}
.sidebar .sidebar-content .sidebar-item.spot.spot-danger::before { .sidebar-footer {
background-color: var(--bs-danger);
} display: flex;
.sidebar .sidebar-content .sidebar-item.spot.spot-warning::before { padding: 0 1rem 1rem 1rem;
background-color: var(--bs-warning);
} .sidebar-menu-btn {
.sidebar .sidebar-content .sidebar-item.spot.spot-info::before {
background-color: var(--bs-info); display: flex;
} align-items: center;
width: auto;
.sidebar .sidebar-content .sidebar-item .sidebar-item-image { padding: 0.5rem;
display: flex; border: none;
justify-content: center; border-radius: $border-radius-sm;
align-items: center; color: var(--bs-body-color);
flex-shrink: 0; background-color: inherit;
width: 50px;
height: 50px; &:hover, &.active { background-color: var(--bs-body-bg); }
border-radius: var(--bs-border-radius-sm);
margin-right: 0.75rem; &.sidebar-user-btn {
}
flex-grow: 1;
.sidebar .sidebar-content .sidebar-item .sidebar-item-data { min-width: 0;
display: flex; overflow: hidden;
flex-direction: column; text-overflow: ellipsis;
width: 100%; white-space: nowrap;
overflow: hidden;
} }
.sidebar .sidebar-content .sidebar-item .sidebar-item-data > span { .sidebar-pin-btn { flex-grow: 0; }
text-align: start;
display: block; .sidebar-avatar {
width: 100%;
white-space: nowrap; border-radius: 50%;
overflow: hidden; margin-right: 0.5rem;
text-overflow: ellipsis; width: 32px;
} height: 32px;
}
/* Footer */
}
.sidebar .sidebar-footer {
padding: 0 1rem 1rem 1rem; }
display: flex;
} .sidebar-menu {
.sidebar .sidebar-menu-btn { border: none;
display: flex; border-radius: var(--bs-border-radius-sm);
align-items: center; box-shadow: var(--bs-box-shadow);
width: auto; padding: 0.25rem;
padding: 0.5rem;
border: none; .dropdown-item { border-radius: var(--bs-border-radius-sm); }
border-radius: var(--bs-border-radius-sm);
color: var(--bs-body-color); }
background-color: inherit;
}
.sidebar .sidebar-menu-btn:hover,
.sidebar .sidebar-menu-btn.active {
background-color: var(--bs-body-bg);
}
.sidebar .sidebar-user-btn {
flex-grow: 1;
min-width: 0;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.sidebar .sidebar-pin-btn {
flex-grow: 0;
}
.sidebar .sidebar-avatar {
border-radius: 50%;
margin-right: 0.5rem;
width: 32px;
height: 32px;
}
/* Drop Menu */
.sidebar .sidebar-menu {
border: none;
border-radius: var(--bs-border-radius-sm);
box-shadow: var(--bs-box-shadow);
padding: 0.25rem;
}
.sidebar .sidebar-menu .dropdown-item {
border-radius: var(--bs-border-radius-sm);
}
/* Rate Limit Message */
.server-rate-limit {
display: none;
} }