After improving the design for the web part4
This commit is contained in:
parent
3a5ebdeb97
commit
aaf5b07018
@ -10,6 +10,7 @@ import { LandingHeader } from './components/LandingHeader';
|
||||
import { LandingHero } from './components/LandingHero';
|
||||
import { LandingGamePeek } from './components/LandingGamePeek';
|
||||
import { LandingFeedStrip } from './components/LandingFeedStrip';
|
||||
import { LandingOffersCarousel } from './components/LandingOffersCarousel';
|
||||
import { useActivityFeed, useWithdrawalFeed } from './hooks/useMarketingFeeds';
|
||||
import { PLATFORM_WORDMARK } from '../../shared/brand/platformName';
|
||||
import './landing.css';
|
||||
@ -91,10 +92,6 @@ export function LandingPage() {
|
||||
}));
|
||||
|
||||
const activePlayers = activityQ.data?.activePlayersCount;
|
||||
const heroAd = (heroQ.data ?? [])[0] ?? null;
|
||||
const offerMedia = heroAd?.imageUrl
|
||||
? `linear-gradient(100deg, rgba(5,8,14,0.72), rgba(5,8,14,0.28) 55%, rgba(5,8,14,0.62)), center/cover no-repeat url(${heroAd.imageUrl})`
|
||||
: heroAd?.backgroundGradient || undefined;
|
||||
|
||||
return (
|
||||
<div className="tloto-landing">
|
||||
@ -102,43 +99,9 @@ export function LandingPage() {
|
||||
|
||||
<LandingHero />
|
||||
|
||||
{/* Offers — one promotional band (campaign CTA only, not generic auth) */}
|
||||
{/* Campaigns — carousel of all hero ads (parity with mobile) */}
|
||||
<section id="offers" className="tl-offers tl-reveal" style={{ scrollMarginTop: 96 }}>
|
||||
{offerMedia && <div className="tl-offers__media" aria-hidden style={{ background: offerMedia }} />}
|
||||
<div className="tl-offers__scrim" aria-hidden />
|
||||
<div className="tl-container tl-offers__inner">
|
||||
<p className="tl-eyebrow tl-eyebrow--gold">{t('landing.offers.kicker')}</p>
|
||||
|
||||
{heroQ.isLoading && <p className="tl-muted">{t('common.loading')}</p>}
|
||||
|
||||
{!heroQ.isLoading && !heroAd && (
|
||||
<>
|
||||
<h2 className="tl-display tl-offers__title">{t('landing.offers.title')}</h2>
|
||||
<p className="tl-offers__sub">{t('landing.offers.empty')}</p>
|
||||
</>
|
||||
)}
|
||||
|
||||
{heroAd && (
|
||||
<>
|
||||
<h2 className="tl-display tl-offers__title">{heroAd.title}</h2>
|
||||
{heroAd.subtitle && <p className="tl-offers__sub">{heroAd.subtitle}</p>}
|
||||
{heroAd.ctaLabel && (
|
||||
<RouterLink
|
||||
to={heroAd.linkUrl?.startsWith('/') ? heroAd.linkUrl : '/register'}
|
||||
className="tl-btn"
|
||||
style={{
|
||||
justifySelf: 'start',
|
||||
marginTop: '0.75rem',
|
||||
color: '#04110c',
|
||||
background: heroAd.accentColor || '#10B981',
|
||||
}}
|
||||
>
|
||||
{heroAd.ctaLabel}
|
||||
</RouterLink>
|
||||
)}
|
||||
</>
|
||||
)}
|
||||
</div>
|
||||
<LandingOffersCarousel ads={heroQ.data ?? []} loading={heroQ.isLoading} />
|
||||
</section>
|
||||
|
||||
<LandingGamePeek games={gamesQ.data ?? []} loading={gamesQ.isLoading} />
|
||||
|
||||
@ -0,0 +1,162 @@
|
||||
/**
|
||||
* Landing campaigns carousel — all hero ads, auto-rotate + dots + arrows
|
||||
* (parity with the mobile HomeAdCarousel).
|
||||
*/
|
||||
import { useCallback, useEffect, useState } from 'react';
|
||||
import { Link as RouterLink } from 'react-router-dom';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import type { Advertisement } from '../../home/types';
|
||||
|
||||
type LandingOffersCarouselProps = {
|
||||
ads: Advertisement[];
|
||||
loading?: boolean;
|
||||
};
|
||||
|
||||
const AUTO_MS = 6000;
|
||||
|
||||
function slideBackground(ad: Advertisement): string {
|
||||
if (ad.imageUrl) {
|
||||
return `linear-gradient(105deg, rgba(5,8,14,0.92) 0%, rgba(5,8,14,0.55) 48%, rgba(5,8,14,0.78) 100%), center/cover no-repeat url(${ad.imageUrl})`;
|
||||
}
|
||||
if (ad.backgroundGradient) return ad.backgroundGradient;
|
||||
const accent = ad.accentColor || '#D4AF37';
|
||||
return `linear-gradient(115deg, ${accent}33 0%, rgba(7,10,18,0.96) 45%, rgba(16,185,129,0.12) 100%)`;
|
||||
}
|
||||
|
||||
function ctaHref(ad: Advertisement): string {
|
||||
if (ad.linkUrl?.startsWith('/')) return ad.linkUrl;
|
||||
if (ad.linkUrl?.startsWith('http')) return ad.linkUrl;
|
||||
return '/register';
|
||||
}
|
||||
|
||||
/** Multi-ad promotional band for the public landing. */
|
||||
export function LandingOffersCarousel({ ads, loading }: LandingOffersCarouselProps) {
|
||||
const { t } = useTranslation();
|
||||
const [index, setIndex] = useState(0);
|
||||
const [paused, setPaused] = useState(false);
|
||||
const count = ads.length;
|
||||
|
||||
useEffect(() => {
|
||||
setIndex(0);
|
||||
}, [count]);
|
||||
|
||||
useEffect(() => {
|
||||
if (count <= 1 || paused) return;
|
||||
const id = window.setInterval(() => {
|
||||
setIndex((i) => (i + 1) % count);
|
||||
}, AUTO_MS);
|
||||
return () => window.clearInterval(id);
|
||||
}, [count, paused]);
|
||||
|
||||
const go = useCallback(
|
||||
(next: number) => {
|
||||
if (count <= 0) return;
|
||||
setIndex(((next % count) + count) % count);
|
||||
},
|
||||
[count]
|
||||
);
|
||||
|
||||
if (loading) {
|
||||
return (
|
||||
<div className="tl-offers-carousel tl-offers-carousel--loading" aria-busy>
|
||||
<div className="tl-offers-carousel__skeleton" />
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
if (count === 0) {
|
||||
return (
|
||||
<div className="tl-offers-carousel tl-offers-carousel--empty">
|
||||
<div className="tl-container tl-offers-carousel__empty-inner">
|
||||
<h2 className="tl-display tl-offers__title">{t('landing.offers.title')}</h2>
|
||||
<p className="tl-offers__sub">{t('landing.offers.empty')}</p>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
const ad = ads[index];
|
||||
const accent = ad.accentColor || '#D4AF37';
|
||||
const href = ctaHref(ad);
|
||||
const external = href.startsWith('http');
|
||||
|
||||
return (
|
||||
<div
|
||||
className="tl-offers-carousel"
|
||||
onMouseEnter={() => setPaused(true)}
|
||||
onMouseLeave={() => setPaused(false)}
|
||||
onFocusCapture={() => setPaused(true)}
|
||||
onBlurCapture={(e) => {
|
||||
if (!e.currentTarget.contains(e.relatedTarget as Node | null)) setPaused(false);
|
||||
}}
|
||||
>
|
||||
<div
|
||||
className="tl-offers-carousel__stage"
|
||||
style={{ background: slideBackground(ad), borderColor: `${accent}55` }}
|
||||
>
|
||||
<div className="tl-container tl-offers-carousel__copy">
|
||||
<p className="tl-eyebrow tl-eyebrow--gold">{t('landing.offers.kicker')}</p>
|
||||
<h2 className="tl-display tl-offers__title">{ad.title}</h2>
|
||||
{ad.subtitle && <p className="tl-offers__sub">{ad.subtitle}</p>}
|
||||
{ad.ctaLabel &&
|
||||
(external ? (
|
||||
<a
|
||||
href={href}
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
className="tl-btn tl-btn--sm tl-offers-carousel__cta"
|
||||
style={{ background: accent, color: '#130f02' }}
|
||||
>
|
||||
{ad.ctaLabel}
|
||||
</a>
|
||||
) : (
|
||||
<RouterLink
|
||||
to={href}
|
||||
className="tl-btn tl-btn--sm tl-offers-carousel__cta"
|
||||
style={{ background: accent, color: '#130f02' }}
|
||||
>
|
||||
{ad.ctaLabel}
|
||||
</RouterLink>
|
||||
))}
|
||||
</div>
|
||||
|
||||
{count > 1 && (
|
||||
<>
|
||||
<button
|
||||
type="button"
|
||||
className="tl-offers-carousel__nav tl-offers-carousel__nav--prev"
|
||||
aria-label={t('landing.offers.prev')}
|
||||
onClick={() => go(index - 1)}
|
||||
>
|
||||
‹
|
||||
</button>
|
||||
<button
|
||||
type="button"
|
||||
className="tl-offers-carousel__nav tl-offers-carousel__nav--next"
|
||||
aria-label={t('landing.offers.next')}
|
||||
onClick={() => go(index + 1)}
|
||||
>
|
||||
›
|
||||
</button>
|
||||
</>
|
||||
)}
|
||||
</div>
|
||||
|
||||
{count > 1 && (
|
||||
<div className="tl-offers-carousel__dots" role="tablist" aria-label={t('landing.offers.kicker')}>
|
||||
{ads.map((item, i) => (
|
||||
<button
|
||||
key={item.id}
|
||||
type="button"
|
||||
role="tab"
|
||||
aria-selected={i === index}
|
||||
aria-label={item.title}
|
||||
className={`tl-offers-carousel__dot${i === index ? ' is-active' : ''}`}
|
||||
onClick={() => go(i)}
|
||||
/>
|
||||
))}
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
@ -382,59 +382,158 @@
|
||||
}
|
||||
|
||||
/* ==========================================================================
|
||||
OFFERS — one full-bleed cinematic promotional band
|
||||
OFFERS — campaigns carousel (all hero ads)
|
||||
========================================================================== */
|
||||
|
||||
.tl-offers {
|
||||
position: relative;
|
||||
overflow: hidden;
|
||||
min-height: clamp(220px, 34vh, 360px);
|
||||
display: flex;
|
||||
align-items: center;
|
||||
border-top: 1px solid var(--tl-line);
|
||||
border-bottom: 1px solid var(--tl-line);
|
||||
background: linear-gradient(110deg, rgba(16, 185, 129, 0.16), rgba(7, 10, 18, 0.95) 48%, rgba(212, 175, 55, 0.1));
|
||||
}
|
||||
|
||||
.tl-offers__media {
|
||||
position: absolute;
|
||||
inset: 0;
|
||||
background-size: cover;
|
||||
background-position: center;
|
||||
}
|
||||
|
||||
.tl-offers__scrim {
|
||||
position: absolute;
|
||||
inset: 0;
|
||||
background: linear-gradient(100deg, rgba(5, 8, 14, 0.9) 0%, rgba(5, 8, 14, 0.45) 52%, rgba(5, 8, 14, 0.78) 100%);
|
||||
}
|
||||
|
||||
.tl-offers__inner {
|
||||
position: relative;
|
||||
z-index: 2;
|
||||
width: 100%;
|
||||
padding-block: clamp(2.5rem, 6vw, 4.25rem);
|
||||
display: grid;
|
||||
gap: 1rem;
|
||||
align-content: center;
|
||||
padding-block: clamp(1.5rem, 4vw, 2.5rem);
|
||||
background: linear-gradient(180deg, rgba(16, 185, 129, 0.06), transparent 40%);
|
||||
}
|
||||
|
||||
.tl-offers__title {
|
||||
margin: 0;
|
||||
max-width: 18ch;
|
||||
font-size: clamp(2rem, 4.6vw, 3.4rem);
|
||||
font-size: clamp(1.85rem, 4.2vw, 3rem);
|
||||
font-weight: 800;
|
||||
line-height: 1.04;
|
||||
}
|
||||
|
||||
.tl-offers__sub {
|
||||
margin: 0;
|
||||
max-width: 46ch;
|
||||
font-size: 1.08rem;
|
||||
max-width: 42ch;
|
||||
font-size: 1.05rem;
|
||||
line-height: 1.55;
|
||||
color: rgba(238, 243, 251, 0.82);
|
||||
}
|
||||
|
||||
.tl-offers-carousel {
|
||||
width: 100%;
|
||||
max-width: var(--tl-max);
|
||||
margin: 0 auto;
|
||||
padding: 0 var(--tl-gutter);
|
||||
}
|
||||
|
||||
.tl-offers-carousel__stage {
|
||||
position: relative;
|
||||
overflow: hidden;
|
||||
min-height: clamp(220px, 32vh, 340px);
|
||||
border-radius: 28px;
|
||||
border: 1px solid var(--tl-line);
|
||||
background-size: cover;
|
||||
background-position: center;
|
||||
transition: background 0.45s ease, border-color 0.35s ease;
|
||||
box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
|
||||
}
|
||||
|
||||
.tl-offers-carousel__copy {
|
||||
position: relative;
|
||||
z-index: 2;
|
||||
display: grid;
|
||||
gap: 0.85rem;
|
||||
align-content: end;
|
||||
min-height: clamp(220px, 32vh, 340px);
|
||||
padding-block: clamp(1.75rem, 4vw, 2.75rem);
|
||||
padding-inline: 0;
|
||||
}
|
||||
|
||||
.tl-offers-carousel__cta {
|
||||
justify-self: start;
|
||||
margin-top: 0.35rem;
|
||||
font-weight: 800;
|
||||
}
|
||||
|
||||
.tl-offers-carousel__nav {
|
||||
appearance: none;
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
z-index: 3;
|
||||
transform: translateY(-50%);
|
||||
width: 42px;
|
||||
height: 42px;
|
||||
border-radius: 999px;
|
||||
border: 1px solid rgba(255, 255, 255, 0.18);
|
||||
background: rgba(7, 10, 16, 0.55);
|
||||
color: #eef3fb;
|
||||
font-size: 1.6rem;
|
||||
line-height: 1;
|
||||
cursor: pointer;
|
||||
backdrop-filter: blur(10px);
|
||||
-webkit-backdrop-filter: blur(10px);
|
||||
display: none;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.tl-offers-carousel__nav:hover {
|
||||
border-color: rgba(255, 255, 255, 0.35);
|
||||
background: rgba(7, 10, 16, 0.78);
|
||||
}
|
||||
|
||||
.tl-offers-carousel__nav--prev {
|
||||
left: 14px;
|
||||
}
|
||||
|
||||
.tl-offers-carousel__nav--next {
|
||||
right: 14px;
|
||||
}
|
||||
|
||||
.tl-offers-carousel__dots {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
margin-top: 1rem;
|
||||
}
|
||||
|
||||
.tl-offers-carousel__dot {
|
||||
appearance: none;
|
||||
width: 8px;
|
||||
height: 8px;
|
||||
border-radius: 999px;
|
||||
border: 0;
|
||||
padding: 0;
|
||||
background: rgba(238, 243, 251, 0.28);
|
||||
cursor: pointer;
|
||||
transition: width 0.25s ease, background 0.25s ease;
|
||||
}
|
||||
|
||||
.tl-offers-carousel__dot.is-active {
|
||||
width: 22px;
|
||||
background: var(--tl-emerald-bright);
|
||||
}
|
||||
|
||||
.tl-offers-carousel--loading .tl-offers-carousel__skeleton,
|
||||
.tl-offers-carousel--empty .tl-offers-carousel__empty-inner {
|
||||
min-height: clamp(200px, 28vh, 300px);
|
||||
border-radius: 28px;
|
||||
border: 1px solid var(--tl-line);
|
||||
background: rgba(255, 255, 255, 0.03);
|
||||
}
|
||||
|
||||
.tl-offers-carousel--empty .tl-offers-carousel__empty-inner {
|
||||
display: grid;
|
||||
gap: 0.75rem;
|
||||
align-content: center;
|
||||
padding: clamp(1.5rem, 4vw, 2.5rem) 0;
|
||||
}
|
||||
|
||||
.tl-offers-carousel__skeleton {
|
||||
animation: tl-glow 2.4s ease-in-out infinite;
|
||||
}
|
||||
|
||||
@media (min-width: 900px) {
|
||||
.tl-offers-carousel__nav {
|
||||
display: inline-flex;
|
||||
}
|
||||
|
||||
.tl-offers-carousel__copy {
|
||||
max-width: 36rem;
|
||||
}
|
||||
}
|
||||
|
||||
/* ==========================================================================
|
||||
GAMES — large split product showcases
|
||||
========================================================================== */
|
||||
@ -1107,12 +1206,22 @@
|
||||
}
|
||||
|
||||
.tl-offers {
|
||||
min-height: 0;
|
||||
padding-block: clamp(1.15rem, 3.5vw, 1.75rem);
|
||||
}
|
||||
|
||||
.tl-offers__inner {
|
||||
padding-block: clamp(1.75rem, 5vw, 2.75rem);
|
||||
gap: 0.75rem;
|
||||
.tl-offers-carousel__stage {
|
||||
border-radius: 22px;
|
||||
min-height: clamp(200px, 36vh, 280px);
|
||||
}
|
||||
|
||||
.tl-offers-carousel__copy {
|
||||
min-height: clamp(200px, 36vh, 280px);
|
||||
gap: 0.7rem;
|
||||
}
|
||||
|
||||
.tl-offers-carousel__cta {
|
||||
width: 100%;
|
||||
justify-self: stretch;
|
||||
}
|
||||
|
||||
.tl-live-head,
|
||||
|
||||
@ -102,6 +102,8 @@ export const en = {
|
||||
title: 'What is live right now',
|
||||
subtitle: 'Active promotions from the Tloto catalog.',
|
||||
empty: 'New campaigns will appear here when published.',
|
||||
prev: 'Previous campaign',
|
||||
next: 'Next campaign',
|
||||
},
|
||||
games: {
|
||||
kicker: 'Catalog',
|
||||
|
||||
@ -102,6 +102,8 @@ export const fr = {
|
||||
title: 'Ce qui est actif maintenant',
|
||||
subtitle: 'Promotions actives du catalogue Tloto.',
|
||||
empty: 'Les nouvelles campagnes apparaîtront ici dès leur publication.',
|
||||
prev: 'Campagne précédente',
|
||||
next: 'Campagne suivante',
|
||||
},
|
||||
games: {
|
||||
kicker: 'Catalogue',
|
||||
|
||||
Loading…
Reference in New Issue
Block a user