-
Notifications
You must be signed in to change notification settings - Fork 22
Hero - navbar UI #266
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
base: main
Are you sure you want to change the base?
Hero - navbar UI #266
Changes from 2 commits
a14351c
987e409
2e404bd
c4ea78b
bda9626
f6ed8bb
9e7f934
6b7c11a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,239 @@ | ||
| /* Modern hero — matches OpenMS_Modern_Dynamic_Design mockup */ | ||
|
|
||
| .hero-modern { | ||
| --hero-orange: #ff9500; | ||
| --hero-pink: #ff1b9e; | ||
| --hero-navy: #001a4d; | ||
| --hero-accent-yellow: #ffd700; | ||
| --hero-white: #ffffff; | ||
|
|
||
| position: relative; | ||
| overflow: hidden; | ||
| color: var(--hero-white); | ||
| background: linear-gradient(135deg, var(--hero-navy) 0%, #1a2a5f 50%, #0a1a3f 100%); | ||
| padding: 5rem 2.5rem; | ||
| min-height: 32rem; | ||
| } | ||
|
|
||
| .hero-modern::before, | ||
| .hero-modern::after { | ||
| content: ""; | ||
| position: absolute; | ||
| border-radius: 50%; | ||
| z-index: 1; | ||
| pointer-events: none; | ||
| } | ||
|
|
||
| .hero-modern::before { | ||
| top: -50%; | ||
| right: -10%; | ||
| width: 37.5rem; | ||
| height: 37.5rem; | ||
| background: radial-gradient(circle, rgba(255, 149, 0, 0.15) 0%, transparent 70%); | ||
| } | ||
|
|
||
| .hero-modern::after { | ||
| bottom: -30%; | ||
| left: -5%; | ||
| width: 31.25rem; | ||
| height: 31.25rem; | ||
| background: radial-gradient(circle, rgba(255, 27, 158, 0.1) 0%, transparent 70%); | ||
| } | ||
|
|
||
| .hero-modern__container { | ||
| position: relative; | ||
| z-index: 2; | ||
| display: grid; | ||
| grid-template-columns: 1fr 1fr; | ||
| gap: 3.75rem; | ||
| align-items: center; | ||
| max-width: 75rem; | ||
| margin: 0 auto; | ||
| } | ||
|
|
||
| .hero-modern__title { | ||
| font-size: clamp(2rem, 4.5vw, 3.375rem); | ||
| font-weight: 800; | ||
| line-height: 1.15; | ||
| letter-spacing: -0.02em; | ||
| margin-bottom: 1.5rem; | ||
| color: var(--hero-white); | ||
| } | ||
|
|
||
| .hero-modern__gradient-text { | ||
| background: linear-gradient(90deg, var(--hero-accent-yellow), var(--hero-orange), var(--hero-pink)); | ||
| -webkit-background-clip: text; | ||
| background-clip: text; | ||
| -webkit-text-fill-color: transparent; | ||
| } | ||
|
|
||
| .hero-modern__description { | ||
| font-size: 1.125rem; | ||
| line-height: 1.7; | ||
| opacity: 0.95; | ||
| margin-bottom: 2rem; | ||
| max-width: 31.25rem; | ||
| } | ||
|
|
||
| .hero-modern__buttons { | ||
| display: flex; | ||
| flex-wrap: wrap; | ||
| gap: 1rem; | ||
| margin-bottom: 2.5rem; | ||
| } | ||
|
|
||
| .hero-modern__btn { | ||
| display: inline-block; | ||
| padding: 0.875rem 2rem; | ||
| font-size: 0.9375rem; | ||
| font-weight: 600; | ||
| border-radius: 0.5rem; | ||
| text-decoration: none; | ||
| transition: transform 0.3s ease, box-shadow 0.3s ease, background 0.3s ease, border-color 0.3s ease; | ||
| } | ||
|
|
||
| .hero-modern__btn--primary { | ||
| color: var(--hero-white); | ||
| background: linear-gradient(135deg, var(--hero-orange), var(--hero-pink)); | ||
| box-shadow: 0 0.5rem 1.5rem rgba(255, 149, 0, 0.3); | ||
| } | ||
|
|
||
| .hero-modern__btn--primary:hover { | ||
| transform: translateY(-2px); | ||
| box-shadow: 0 0.75rem 2rem rgba(255, 149, 0, 0.4); | ||
| color: var(--hero-white); | ||
| } | ||
|
|
||
| .hero-modern__btn--secondary { | ||
| color: var(--hero-white); | ||
| background: rgba(255, 255, 255, 0.15); | ||
| border: 2px solid var(--hero-white); | ||
| backdrop-filter: blur(10px); | ||
| } | ||
|
|
||
| .hero-modern__btn--secondary:hover { | ||
| background: rgba(255, 255, 255, 0.25); | ||
| border-color: var(--hero-accent-yellow); | ||
| color: var(--hero-white); | ||
| } | ||
|
|
||
| .hero-modern__stats { | ||
| display: flex; | ||
| flex-wrap: wrap; | ||
| gap: 2.5rem; | ||
| padding-top: 2.5rem; | ||
| border-top: 1px solid rgba(255, 255, 255, 0.1); | ||
| } | ||
|
|
||
| .hero-modern__stat { | ||
| display: flex; | ||
| flex-direction: column; | ||
| gap: 0.5rem; | ||
| } | ||
|
|
||
| .hero-modern__stat-number { | ||
| font-size: 1.75rem; | ||
| font-weight: 800; | ||
| background: linear-gradient(90deg, var(--hero-accent-yellow), var(--hero-orange)); | ||
| -webkit-background-clip: text; | ||
| background-clip: text; | ||
| -webkit-text-fill-color: transparent; | ||
| } | ||
|
|
||
| .hero-modern__stat-label { | ||
| font-size: 0.8125rem; | ||
| opacity: 0.85; | ||
| text-transform: uppercase; | ||
| letter-spacing: 0.05em; | ||
| } | ||
|
|
||
| .hero-modern__visual { | ||
| display: flex; | ||
| align-items: center; | ||
| justify-content: center; | ||
| min-height: 18rem; | ||
| } | ||
|
|
||
| .hero-modern__waveform { | ||
| display: flex; | ||
| align-items: center; | ||
| justify-content: center; | ||
| gap: 0.1875rem; | ||
| width: 100%; | ||
| max-width: 25rem; | ||
| height: 100%; | ||
| min-height: 16rem; | ||
| } | ||
|
|
||
| .hero-modern__wave-bar { | ||
| width: 0.375rem; | ||
| height: 20%; | ||
| border-radius: 0.1875rem; | ||
| background: linear-gradient(180deg, var(--hero-orange), var(--hero-pink)); | ||
| animation: hero-modern-waveform 2s ease-in-out infinite; | ||
| } | ||
|
|
||
| .hero-modern__wave-bar:nth-child(1) { animation-delay: 0s; } | ||
| .hero-modern__wave-bar:nth-child(2) { animation-delay: 0.1s; } | ||
| .hero-modern__wave-bar:nth-child(3) { animation-delay: 0.2s; } | ||
| .hero-modern__wave-bar:nth-child(4) { animation-delay: 0.3s; } | ||
| .hero-modern__wave-bar:nth-child(5) { animation-delay: 0.4s; } | ||
| .hero-modern__wave-bar:nth-child(6) { animation-delay: 0.5s; } | ||
| .hero-modern__wave-bar:nth-child(7) { animation-delay: 0.6s; } | ||
| .hero-modern__wave-bar:nth-child(8) { animation-delay: 0.7s; } | ||
| .hero-modern__wave-bar:nth-child(9) { animation-delay: 0.8s; } | ||
| .hero-modern__wave-bar:nth-child(10) { animation-delay: 0.9s; } | ||
| .hero-modern__wave-bar:nth-child(11) { animation-delay: 1s; } | ||
|
|
||
| @keyframes hero-modern-waveform { | ||
| 0%, | ||
| 100% { | ||
| height: 20%; | ||
| } | ||
| 50% { | ||
| height: 100%; | ||
| } | ||
| } | ||
|
|
||
| @media (max-width: 1024px) { | ||
| .hero-modern { | ||
| padding: 5rem 1.5rem; | ||
| min-height: auto; | ||
| } | ||
|
|
||
| .hero-modern__container { | ||
| grid-template-columns: 1fr; | ||
| gap: 2.5rem; | ||
| } | ||
|
|
||
| .hero-modern__visual { | ||
| min-height: 12rem; | ||
| } | ||
| } | ||
|
|
||
| @media (max-width: 768px) { | ||
| .hero-modern { | ||
| padding: 3.75rem 1rem; | ||
| } | ||
|
|
||
| .hero-modern__buttons { | ||
| flex-direction: column; | ||
| align-items: stretch; | ||
| } | ||
|
|
||
| .hero-modern__btn { | ||
| text-align: center; | ||
| } | ||
|
|
||
| .hero-modern__stats { | ||
| flex-direction: column; | ||
| gap: 1.5rem; | ||
| } | ||
| } | ||
|
|
||
| @media (prefers-reduced-motion: reduce) { | ||
| .hero-modern__wave-bar { | ||
| animation: none; | ||
| height: 55%; | ||
| } | ||
| } | ||
| Original file line number | Diff line number | Diff line change | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,48 @@ | ||||||||||||||
| {{- $hero := .Site.Params.hero }} | ||||||||||||||
| {{- $titleBefore := index $hero "titleBefore" | default "The " }} | ||||||||||||||
| {{- $titleHighlight := index $hero "titleHighlight" | default "open-source framework" }} | ||||||||||||||
| {{- $titleAfter := index $hero "titleAfter" | default " for Mass Spectrometry" }} | ||||||||||||||
| {{- $description := index $hero "description" }} | ||||||||||||||
| {{- $buttonText := index $hero "buttontext" }} | ||||||||||||||
| {{- $buttonLink := index $hero "buttonlink" }} | ||||||||||||||
| {{- $secondaryText := index $hero "secondaryButtonText" }} | ||||||||||||||
| {{- $secondaryLink := index $hero "secondaryButtonLink" }} | ||||||||||||||
| {{- $stats := index $hero "stats" }} | ||||||||||||||
|
|
||||||||||||||
| <section class="hero-modern" aria-label="OpenMS introduction"> | ||||||||||||||
| <div class="hero-modern__container"> | ||||||||||||||
| <div class="hero-modern__content"> | ||||||||||||||
| <h1 class="hero-modern__title"> | ||||||||||||||
| {{ $titleBefore }}<span class="hero-modern__gradient-text">{{ $titleHighlight }}</span>{{ $titleAfter }} | ||||||||||||||
| </h1> | ||||||||||||||
| {{- with $description }} | ||||||||||||||
| <p class="hero-modern__description">{{ . }}</p> | ||||||||||||||
| {{- end }} | ||||||||||||||
| <div class="hero-modern__buttons"> | ||||||||||||||
| {{- if $buttonText }} | ||||||||||||||
| <a class="hero-modern__btn hero-modern__btn--primary" href="{{ $buttonLink }}">{{ $buttonText }}</a> | ||||||||||||||
| {{- end }} | ||||||||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Guard primary CTA rendering on both text and URL. Right now the primary button is rendered when Suggested fix- {{- if $buttonText }}
+ {{- if and $buttonText $buttonLink }}
<a class="hero-modern__btn hero-modern__btn--primary" href="{{ $buttonLink }}">{{ $buttonText }}</a>
{{- end }}📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||
| {{- if and $secondaryText $secondaryLink }} | ||||||||||||||
| <a class="hero-modern__btn hero-modern__btn--secondary" href="{{ $secondaryLink }}">{{ $secondaryText }}</a> | ||||||||||||||
| {{- end }} | ||||||||||||||
| </div> | ||||||||||||||
| {{- with $stats }} | ||||||||||||||
| <div class="hero-modern__stats"> | ||||||||||||||
| {{- range . }} | ||||||||||||||
| <div class="hero-modern__stat"> | ||||||||||||||
| <div class="hero-modern__stat-number">{{ .number }}</div> | ||||||||||||||
| <div class="hero-modern__stat-label">{{ .label }}</div> | ||||||||||||||
| </div> | ||||||||||||||
| {{- end }} | ||||||||||||||
| </div> | ||||||||||||||
| {{- end }} | ||||||||||||||
| </div> | ||||||||||||||
| <div class="hero-modern__visual" aria-hidden="true"> | ||||||||||||||
| <div class="hero-modern__waveform"> | ||||||||||||||
| {{- range seq 11 }} | ||||||||||||||
| <div class="hero-modern__wave-bar"></div> | ||||||||||||||
| {{- end }} | ||||||||||||||
| </div> | ||||||||||||||
| </div> | ||||||||||||||
| </div> | ||||||||||||||
| </section> | ||||||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mobile stats can be clipped off-screen by parent overflow.
overflow: hiddenon.hero-modernconflicts with mobile stats positioned atbottom: 0plustranslateY(100%), so the stats block can be cut off.Suggested fix
`@media` (max-width: 768px) { .hero-modern { padding: clamp(0.75rem, 1.5vh, 1.5rem) 1.25rem; min-height: min(28rem, calc(100dvh - var(--openms-hero-chrome))); + overflow: visible; }Also applies to: 520-526
🤖 Prompt for AI Agents