Browse Source

Refactoring

pull/5671/head
Thomas Kaul 3 months ago
parent
commit
402919904a
  1. 2
      apps/client/src/app/pages/landing/landing-page.html
  2. 6
      libs/ui/src/lib/logo-carousel/logo-carousel.component.html
  3. 27
      libs/ui/src/lib/logo-carousel/logo-carousel.component.scss
  4. 3
      libs/ui/src/lib/logo-carousel/logo-carousel.component.ts

2
apps/client/src/app/pages/landing/landing-page.html

@ -115,7 +115,7 @@
<small i18n>As seen in</small> <small i18n>As seen in</small>
</div> </div>
<div class="col-12"> <div class="col-12">
<gf-logo-carousel /> <gf-logo-carousel class="py-3" />
</div> </div>
</div> </div>

6
libs/ui/src/lib/logo-carousel/logo-carousel.component.html

@ -1,6 +1,6 @@
<div class="logo-carousel-container w-100 overflow-hidden"> <div class="logo-carousel-container overflow-hidden position-relative w-100">
<div class="logo-carousel-track"> <div class="d-flex logo-carousel-track">
@for (logo of duplicatedLogos; track $index) { @for (logo of logosRepeated; track $index) {
<div class="logo-carousel-item"> <div class="logo-carousel-item">
<a <a
class="d-block logo" class="d-block logo"

27
libs/ui/src/lib/logo-carousel/logo-carousel.component.scss

@ -1,43 +1,39 @@
:host { :host {
display: block; display: block;
width: 100%;
overflow: hidden; overflow: hidden;
position: relative; position: relative;
width: 100%;
.logo-carousel-container { .logo-carousel-container {
position: relative;
// Fade gradient mask for smooth edges
&::before, &::before,
&::after { &::after {
content: ''; content: '';
height: 100%;
pointer-events: none;
position: absolute; position: absolute;
top: 0; top: 0;
width: 100px; width: 100px;
height: 100%;
z-index: 2; z-index: 2;
pointer-events: none;
} }
&::before { &::before {
left: 0;
background: linear-gradient( background: linear-gradient(
to right, to right,
var(--light-background) 0%, var(--light-background) 0%,
rgba(var(--palette-background-background), 0) 100% rgba(var(--palette-background-background), 0) 100%
); );
left: 0;
} }
&::after { &::after {
right: 0;
background: linear-gradient( background: linear-gradient(
to left, to left,
var(--light-background) 0%, var(--light-background) 0%,
rgba(var(--palette-background-background), 0) 100% rgba(var(--palette-background-background), 0) 100%
); );
right: 0;
} }
// Responsive adjustments for mobile
@media (max-width: 768px) { @media (max-width: 768px) {
&::before, &::before,
&::after { &::after {
@ -55,10 +51,9 @@
.logo-carousel-track { .logo-carousel-track {
align-items: center; align-items: center;
animation: scroll 40s linear infinite; animation: scroll 60s linear infinite;
width: fit-content; width: fit-content;
// Pause animation on hover for accessibility
&:hover { &:hover {
animation-play-state: paused; animation-play-state: paused;
} }
@ -66,8 +61,8 @@
.logo-carousel-item { .logo-carousel-item {
flex-shrink: 0; flex-shrink: 0;
padding: 1rem 2rem;
min-width: 200px; min-width: 200px;
padding: 0 2rem;
@media (max-width: 768px) { @media (max-width: 768px) {
min-width: 150px; min-width: 150px;
@ -82,14 +77,13 @@
.logo { .logo {
height: 3rem; height: 3rem;
width: 7.5rem;
transition: transition:
opacity 0.3s ease, opacity 0.3s ease,
transform 0.3s ease; transform 0.3s ease;
width: 7.5rem;
&:hover { &:hover {
opacity: 0.8; opacity: 0.8;
transform: scale(1.05);
} }
&.mask { &.mask {
@ -99,7 +93,6 @@
mask-size: contain; mask-size: contain;
} }
// Logo-specific styles (copied from landing-page.scss)
&.logo-alternative-to { &.logo-alternative-to {
mask-image: url('/assets/images/logo-alternative-to.svg'); mask-image: url('/assets/images/logo-alternative-to.svg');
} }
@ -163,7 +156,6 @@
mask-image: url('/assets/images/logo-unraid.svg'); mask-image: url('/assets/images/logo-unraid.svg');
} }
// Responsive logo sizes
@media (max-width: 768px) { @media (max-width: 768px) {
height: 2.5rem; height: 2.5rem;
width: 6rem; width: 6rem;
@ -176,7 +168,6 @@
} }
} }
// Dark theme support
:host-context(.theme-dark) { :host-context(.theme-dark) {
.logo-carousel-container { .logo-carousel-container {
&::before { &::before {
@ -213,13 +204,11 @@
} }
} }
// Animation keyframes for infinite horizontal scroll
@keyframes scroll { @keyframes scroll {
0% { 0% {
transform: translateX(0); transform: translateX(0);
} }
100% { 100% {
// Move by exactly half the width (since we duplicated the logos)
transform: translateX(-50%); transform: translateX(-50%);
} }
} }

3
libs/ui/src/lib/logo-carousel/logo-carousel.component.ts

@ -106,6 +106,5 @@ export class GfLogoCarouselComponent {
} }
]; ];
// Duplicate logos for seamless infinite scroll public readonly logosRepeated = [...this.logos, ...this.logos];
public readonly duplicatedLogos = [...this.logos, ...this.logos];
} }

Loading…
Cancel
Save