fix(webapp): logo and top-menu optimization (#8590)

* - added case for tablet

* - optimized HeaderMenu for desktop and mobile
- fixed Logo

* - refixed Logo (missing changes)

---------

Co-authored-by: Sebastian Stein <sebastian@codepassion.de>
Co-authored-by: Wolfgang Huß <wolle.huss@pjannto.com>
This commit is contained in:
sebastian2357 2025-05-25 19:43:01 +02:00 committed by GitHub
parent e5b692e753
commit eef2eb9c56
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 91 additions and 42 deletions

View File

@ -6,8 +6,10 @@ import logos from '@config/logos'
const defaultLogos = { const defaultLogos = {
LOGO_HEADER_PATH: '/img/custom/logo-horizontal.svg', LOGO_HEADER_PATH: '/img/custom/logo-horizontal.svg',
LOGO_HEADER_TABLET_PATH: '/img/custom/logo-horizontal.svg',
LOGO_HEADER_MOBILE_PATH: '/img/custom/logo-horizontal.svg', LOGO_HEADER_MOBILE_PATH: '/img/custom/logo-horizontal.svg',
LOGO_HEADER_WIDTH: '130px', LOGO_HEADER_WIDTH: '130px',
LOGO_HEADER_TABLET_WIDTH: '115px',
LOGO_HEADER_MOBILE_WIDTH: '100px', LOGO_HEADER_MOBILE_WIDTH: '100px',
LOGO_HEADER_CLICK: { LOGO_HEADER_CLICK: {
// externalLink: { // externalLink: {

View File

@ -8,7 +8,7 @@
<!-- header menu --> <!-- header menu -->
<ds-flex v-if="!showMobileMenu" class="main-navigation-flex"> <ds-flex v-if="!showMobileMenu" class="main-navigation-flex">
<!-- logo --> <!-- logo -->
<ds-flex-item :width="{ base: LOGOS.LOGO_HEADER_WIDTH }" style="margin-right: 20px"> <ds-flex-item class="logo-wrapper" :width="{ base: 'auto' }">
<a <a
v-if="LOGOS.LOGO_HEADER_CLICK.externalLink" v-if="LOGOS.LOGO_HEADER_CLICK.externalLink"
:href="LOGOS.LOGO_HEADER_CLICK.externalLink.url" :href="LOGOS.LOGO_HEADER_CLICK.externalLink.url"
@ -48,13 +48,7 @@
v-if="isLoggedIn" v-if="isLoggedIn"
id="nav-search-box" id="nav-search-box"
class="header-search" class="header-search"
:width="{ :width="{ base: 'auto' }"
base: '45%',
sm: '40%',
md: isHeaderMenu ? 'auto' : '40%',
lg: isHeaderMenu ? 'auto' : '50%',
}"
style="flex-shrink: 0; flex-grow: 1"
> >
<search-field /> <search-field />
</ds-flex-item> </ds-flex-item>
@ -69,7 +63,7 @@
</client-only> </client-only>
</ds-flex-item> </ds-flex-item>
<!-- right symbols --> <!-- right symbols -->
<ds-flex-item style="flex-basis: auto"> <ds-flex-item style="flex: none">
<div class="main-navigation-right" style="flex-basis: auto"> <div class="main-navigation-right" style="flex-basis: auto">
<!-- locale switch --> <!-- locale switch -->
<locale-switch class="topbar-locale-switch" placement="top" offset="8" /> <locale-switch class="topbar-locale-switch" placement="top" offset="8" />
@ -383,7 +377,6 @@ export default {
white-space: nowrap; white-space: nowrap;
} }
.topbar-locale-switch { .topbar-locale-switch {
display: flex;
margin-right: $space-xx-small; margin-right: $space-xx-small;
align-self: center; align-self: center;
display: inline-flex; display: inline-flex;
@ -392,31 +385,55 @@ export default {
margin-top: $space-xx-small; margin-top: $space-xx-small;
} }
.main-navigation-flex { .main-navigation-flex {
display: flex;
align-items: center; align-items: center;
flex-wrap: nowrap !important; flex-wrap: nowrap !important;
gap: 20px;
min-width: 0;
} }
@media (max-width: 800px) {
.main-navigation-flex {
gap: 10px;
}
}
.logo-wrapper {
flex: 0 0 auto;
}
.branding-menu {
flex: 0 0 auto;
white-space: nowrap;
}
.header-search {
flex: 1 1 auto !important;
}
.navigation-actions {
flex: 0 0 auto;
}
.main-navigation-right { .main-navigation-right {
display: flex; display: flex;
justify-content: flex-end; justify-content: flex-end;
} }
.main-navigation-right .desktop-view {
float: right; // Mobile Header mit verbessertem Layout
} .mobil-header-box {
.ds-flex-item.mobile-hamburger-menu { .logo-container {
margin-left: auto; flex: 1 1 auto;
text-align: right; min-width: 60px;
max-width: calc(100vw - 200px);
}
.mobile-hamburger-menu {
flex: 0 0 auto; // no shrinking
display: flex; display: flex;
flex-flow: row nowrap; flex-flow: row nowrap;
align-items: center; align-items: center;
justify-content: flex-end; justify-content: flex-end;
gap: 10px;
& > div { > div {
display: inline-flex; flex-shrink: 0; // Buttons remain their size
padding-right: 15px;
&:first-child {
padding-right: 10px;
}
button { button {
overflow: visible; overflow: visible;
@ -425,13 +442,11 @@ export default {
} }
} }
} }
}
.hamburger-button .svg { .hamburger-button .svg {
height: 1.5em; height: 1.5em;
} }
} }
.mobile-menu {
margin: 0 20px;
}
.mobile-search { .mobile-search {
margin-top: 20px; margin-top: 20px;
} }
@ -446,10 +461,4 @@ export default {
.hide-mobile-menu { .hide-mobile-menu {
display: none; display: none;
} }
.logo-container {
max-width: calc(100vw - 140px) !important;
}
.hamburger-button {
flex-shrink: 0;
}
</style> </style>

View File

@ -8,10 +8,18 @@
:style="logoWidthStyle" :style="logoWidthStyle"
/> />
<!-- Tablet logo (falls back to desktop if not provided) -->
<img
class="ds-logo-svg ds-logo-tablet"
:alt="metadata.APPLICATION_NAME + ' ' + logo.alt"
:src="logo.tabletPath || logo.path"
:style="tabletLogoWidthStyle"
/>
<!-- Mobile logo (falls back to desktop if not provided) --> <!-- Mobile logo (falls back to desktop if not provided) -->
<img <img
class="ds-logo-svg ds-logo-mobile" class="ds-logo-svg ds-logo-mobile"
:alt="metadata.APPLICATION_NAME + ' ' + logo.alt + ' Mobile'" :alt="metadata.APPLICATION_NAME + ' ' + logo.alt"
:src="logo.mobilePath || logo.path" :src="logo.mobilePath || logo.path"
:style="mobileLogoWidthStyle" :style="mobileLogoWidthStyle"
/> />
@ -43,6 +51,13 @@ export default {
type: String, type: String,
default: null, default: null,
}, },
/**
* Tablet logo width
*/
tabletLogoWidth: {
type: String,
default: null,
},
/** /**
* Mobile logo width * Mobile logo width
*/ */
@ -69,9 +84,11 @@ export default {
const logosObject = { const logosObject = {
header: { header: {
path: logos.LOGO_HEADER_PATH, path: logos.LOGO_HEADER_PATH,
tabletPath: logos.LOGO_HEADER_TABLET_PATH || null,
mobilePath: logos.LOGO_HEADER_MOBILE_PATH || null, mobilePath: logos.LOGO_HEADER_MOBILE_PATH || null,
alt: 'Header', alt: 'Header',
widthDefault: logos.LOGO_HEADER_WIDTH, widthDefault: logos.LOGO_HEADER_WIDTH,
tabletWidthDefault: logos.LOGO_HEADER_TABLET_WIDTH || logos.LOGO_HEADER_WIDTH,
mobileWidthDefault: logos.LOGO_HEADER_MOBILE_WIDTH || logos.LOGO_HEADER_WIDTH, mobileWidthDefault: logos.LOGO_HEADER_MOBILE_WIDTH || logos.LOGO_HEADER_WIDTH,
}, },
welcome: { path: logos.LOGO_WELCOME_PATH, alt: 'Welcome', widthDefault: '200px' }, welcome: { path: logos.LOGO_WELCOME_PATH, alt: 'Welcome', widthDefault: '200px' },
@ -98,6 +115,11 @@ export default {
const width = this.logoWidth === null ? this.logo.widthDefault : this.logoWidth const width = this.logoWidth === null ? this.logo.widthDefault : this.logoWidth
return `width: ${width};` return `width: ${width};`
}, },
tabletLogoWidthStyle() {
const width =
this.tabletLogoWidth === null ? this.logo.tabletWidthDefault : this.tabletLogoWidth
return `width: ${width};`
},
mobileLogoWidthStyle() { mobileLogoWidthStyle() {
const width = const width =
this.mobileLogoWidth === null ? this.logo.mobileWidthDefault : this.mobileLogoWidth this.mobileLogoWidth === null ? this.logo.mobileWidthDefault : this.mobileLogoWidth
@ -130,16 +152,32 @@ export default {
.ds-logo-desktop { .ds-logo-desktop {
display: block; display: block;
} }
.ds-logo-tablet {
display: none;
}
.ds-logo-mobile { .ds-logo-mobile {
display: none; display: none;
} }
@media (max-width: 767px) { @media (max-width: 810px) {
.ds-logo-desktop { .ds-logo-desktop {
display: none; display: none;
} }
.ds-logo-tablet {
display: block;
}
.ds-logo-mobile {
display: none;
}
}
@media (max-width: 450px) {
.ds-logo-desktop {
display: none;
}
.ds-logo-tablet {
display: none;
}
.ds-logo-mobile { .ds-logo-mobile {
display: block; display: block;
} }