Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sidebar navigation #508

Draft
wants to merge 27 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
6a29430
fix duet-date-picker filling invisible height
bseber Dec 29, 2023
d8d20ed
WIP move navigation to the left side
bseber Dec 29, 2023
97dc7d7
cleanup obsolete nav-header-height
bseber Dec 29, 2023
38b984b
remove unused dark css
bseber Dec 29, 2023
3b042e2
sidebar color
bseber Dec 29, 2023
fc40bc4
stopwatch on the top right of the screen
bseber Dec 29, 2023
d1e28bc
small screen gray background, rounded top/right corners
bseber Dec 30, 2023
a409fc5
more top margin for small screen navigation
bseber Dec 30, 2023
46f3dc0
show app launcher and avatar in hidden navigation
bseber Dec 30, 2023
4c79271
navigation slide from bottom to top
bseber Dec 30, 2023
01e69cf
applauncher and avatar menu for small screen
bseber Dec 30, 2023
8fcdbe2
style app-launcher and avatar menu for bigger screen
bseber Dec 30, 2023
5afad89
Revert "cleanup obsolete nav-header-height"
bseber Dec 31, 2023
9f184f1
rename css variable
bseber Dec 31, 2023
73d1023
increase top bar height variable for sticky elements
bseber Dec 31, 2023
0861ffe
use dynamically calculated top position for sticky elements
bseber Dec 31, 2023
acf8de3
remove body-overlay
bseber Jan 1, 2024
f2793fa
adjust shadow of panels above content
bseber Jan 1, 2024
0a2b91d
remove unused css
bseber Jan 1, 2024
a49ee31
navigation styling big screen
bseber Jan 1, 2024
1f94948
adjust colors of launchpad and avatar menu
bseber Jan 1, 2024
3783f83
style launchpad big screen
bseber Jan 1, 2024
1a9bdf3
style time-clock small screen
bseber Jan 1, 2024
e06944e
show heart on top of navigation
bseber Jan 1, 2024
d1b610d
use one dot button to toggle time-entry actions
bseber Jan 1, 2024
5185438
no vertical scrolling on time-entries page
bseber Jan 1, 2024
17b3aea
responsive time-entry action buttons
bseber Jan 1, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 29 additions & 2 deletions src/main/css/1-base.css
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
@tailwind base;

:root {
--navigation-header-height: 3rem;
/* info-banner is optional and value is overridden by javascript with real height on runtime. as we don't know the content yet... */
--info-banner-height: 0;
--top-bar-height: 3.25rem;

--info-banner-sticky-top: 0;
--navigation-sticky-top: var(--info-banner-height);

/* 500 */
--absence-color-GRAY: #6b7280;
Expand All @@ -24,6 +29,26 @@ body {
min-height: --webkit-fill-available;
background-image: linear-gradient(#ffffff, #fafafa);
background-attachment: fixed;

display: grid;
grid-template-rows: auto auto 1fr;
grid-template-columns: auto 1fr;
grid-template-areas:
"banner banner"
"navigation topbar"
"content content";
}

@screen lg {
body {
display: grid;
grid-template-rows: auto auto 1fr;
grid-template-columns: auto 1fr;
grid-template-areas:
"banner banner"
"navigation topbar"
"navigation content";
}
}

input:not([class*="rounded"]),
Expand All @@ -33,7 +58,9 @@ textarea:not([class*="rounded"]) {

@font-face {
font-family: "KaushanScript";
src: local("KaushanScript"), local("KaushanScript Regular"),
src:
local("KaushanScript"),
local("KaushanScript Regular"),
local("KaushanScript-Regular"),
url("/fonts/kaushanscript/KaushanScript-Regular.woff2") format("woff2"),
url("/fonts/kaushanscript/KaushanScript-Regular.woff") format("woff");
Expand Down
12 changes: 11 additions & 1 deletion src/main/css/2-components.css
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
@import "tailwindcss/components.css";
@import "./components/ajax-loader.css";
@import "./components/body-overlay.css";
@import "./components/checkbox-switch.css";
@import "./components/info-banner.css";
@import "./components/feedback.css";
Expand All @@ -17,6 +16,17 @@
margin-top: auto;
}

duet-date-picker .duet-date__dialog {
/* completely "hide" the div to avoid adding height to the parent element. */
height: 0;
overflow: hidden;
}

duet-date-picker .duet-date__dialog.is-active {
height: auto;
overflow: auto;
}

duet-date-picker.edited ~ label > span {
color: theme("colors.blue.600");
}
Expand Down
17 changes: 0 additions & 17 deletions src/main/css/components/body-overlay.css

This file was deleted.

179 changes: 62 additions & 117 deletions src/main/css/components/navigation.css
Original file line number Diff line number Diff line change
@@ -1,57 +1,65 @@
#menu-toggle-checkbox ~ label ~ nav {
#menu-toggle-checkbox ~ label ~ div {
@apply transition-all;
@apply duration-200;
opacity: 0;

width: 100%;
position: fixed;
top: 100%;
bottom: 0;
left: 0;
right: 0;
@apply px-6;
@apply py-8;
@apply transition-all;
@apply duration-150;
@apply bg-white;
background: white;
z-index: 999999;

@apply px-3;
}

#menu-toggle-checkbox:checked ~ label ~ nav {
top: calc(var(--navigation-header-height) + 1.5rem);
#menu-toggle-checkbox:checked ~ label ~ div {
opacity: 1;
top: calc(var(--navigation-sticky-top) + var(--top-bar-height));
padding-top: 1rem;
}

.navigation-content-spacer {
@apply bg-transparent;
body:has(#menu-toggle-checkbox:checked) {
/* prevent scrolling of hidden content */
/* remember to reset this on large screen to avoid content jumping when scrollbar is (always) visible */
overflow: hidden;
}

.navigation-content-spacer--left,
.navigation-content-spacer--right {
position: relative;
@apply dark:hidden;
position: absolute;
top: 100%;
@apply bg-gray-100;
@apply lg:hidden;
}

.navigation-content-spacer--left::before,
.navigation-content-spacer--right::before,
.navigation-content-spacer--left::after,
.navigation-content-spacer--right::after {
content: "";
position: absolute;
@apply inset-0;
.navigation-content-spacer--left {
left: 0;
}

.navigation-content-spacer--left::before,
.navigation-content-spacer--right::before {
@apply bg-zinc-100;
@apply dark:bg-zinc-800;
.navigation-content-spacer--right {
right: 0;
}

.navigation-content-spacer--left::after,
.navigation-content-spacer--right::after {
content: "";
position: absolute;
@apply inset-0;
@apply bg-white;
@apply dark:bg-zinc-900;
@apply lg:hidden;
}

.navigation-content-spacer--left::after {
@apply rounded-tl-full;
left: 0;
}

.navigation-content-spacer--right::after {
@apply rounded-tr-full;
right: 0;
}

#menu-toggle-checkbox + label > span:first-child {
Expand Down Expand Up @@ -127,37 +135,23 @@
background-color: transparent !important;
}

@screen xs {
#menu-toggle-checkbox ~ label ~ nav {
overflow: hidden;
max-height: 0;
top: -100%;
@apply bg-zinc-100;
z-index: 10;
}

#menu-toggle-checkbox:checked ~ label ~ nav,
#menu-toggle-checkbox:checked ~ label ~ nav:focus-within {
top: var(--navigation-header-height);
max-height: 100vh !important;
@screen lg {
#menu-toggle-checkbox ~ label ~ div,
#menu-toggle-checkbox:checked ~ label ~ div {
position: static;
opacity: 1;
padding: 0;
}
}

@screen lg {
#menu-toggle-checkbox ~ label ~ nav {
max-height: unset;
@apply static;
@apply scale-x-100;
@apply scale-y-100;
@apply opacity-100;
@apply py-0;
@apply px-0;
body:has(#menu-toggle-checkbox:checked) {
overflow: revert;
}
}

.main-nav-link {
@apply text-2xl;
@apply lg:text-lg;
@apply lg:pl-1;
@apply font-medium;
@apply text-gray-800;
@apply transition-colors;
Expand All @@ -168,8 +162,7 @@
@apply lg:w-5;
@apply lg:h-5;
@apply lg:stroke-gray-800;
@apply mr-4;
@apply lg:mr-1.5;
@apply mr-3.5;
}
.main-nav-link:hover svg {
@apply fill-amber-500;
Expand All @@ -196,7 +189,7 @@
}

.nav-popup-menu.visible {
top: calc(var(--navigation-header-height) + 1.5rem);
top: calc(var(--top-bar-height) + 1.5rem);
}

.nav-popup-menu-inner {
Expand All @@ -219,88 +212,40 @@
overflow-y: auto;
}

body:has(.nav-popup-menu.visible) {
/* disable body scroll as long as nav-popup-menu is open */
overflow: hidden;
}

.nav-popup-menu.visible .nav-popup-menu-inner {
width: 100%;
height: 100%;
}

@screen xs {
.nav-popup-menu::before {
content: "";
border-color: transparent;
border-width: 8px;
@apply border-b-gray-200;
position: absolute;
top: -17px;
@apply right-6;
}

@screen lg {
.nav-popup-menu {
@apply transition-transform;
@apply origin-top-right;
position: absolute;
top: calc(100% + 0.5rem);
left: 0;
right: 0;
@apply scale-0;
@apply border;
@apply border-gray-200;
@apply shadow-xl;
@apply mt-3;
@apply z-50;
@apply absolute;
@apply left-auto;
@apply right-0;
@apply bottom-auto;
@apply rounded-2xl;
@apply dark:border-zinc-800;
@apply dark:shadow-none;
}

.nav-popup-menu.visible {
@apply top-full;
@apply z-10;
@apply scale-100;
top: calc(100% + 0.5rem);
}

.nav-popup-menu-inner {
max-height: 75vh;
@apply w-auto;
@apply h-auto;
@apply rounded-2xl;
@apply border-gray-200;
@apply bg-white;
@apply backdrop-blur;
@apply supports-backdrop-blur:bg-white/[0.85];
}

.nav-popup-menu-inner ul li:first-of-type .nav-popup-menu_link {
@apply rounded-t-2xl;
}

.nav-popup-menu-inner ul li:last-of-type .nav-popup-menu_link {
@apply rounded-b-2xl;
@apply border;
@apply border-gray-50;
@apply rounded-lg;
@apply shadow-lg;
}

.nav-popup-menu-inner ul li[role="separator"] {
@apply border-t;
@apply border-gray-200;
}

.nav-popup-menu.visible,
.nav-popup-menu:focus-within {
@apply scale-100;
}

.nav-popup-menu-button_icon {
@apply text-zinc-900;
@apply text-opacity-75;
@apply transition-colors;
.nav-popup-menu-inner__header {
@apply rounded-t-none;
@apply bg-gray-100;
}

.nav-popup-menu-button:is(:hover, :focus) .nav-popup-menu-button_icon {
@apply text-opacity-100;
@apply text-zinc-800;
.nav-popup-menu-inner__content {
overflow-y: hidden;
}
}

Expand All @@ -314,10 +259,10 @@ body:has(.nav-popup-menu.visible) {
@apply hover:no-underline;
@apply focus:no-underline;
@apply text-base;
@apply text-gray-700;
@apply text-gray-800;
@apply bg-transparent;
@apply hover:text-black;
@apply focus:text-black;
@apply hover:bg-gray-50;
@apply focus:bg-gray-50;
@apply hover:bg-gray-100;
@apply focus:bg-gray-100;
}
Loading