mirror of
https://github.com/Dvorinka/MyClubServer.git
synced 2026-06-04 18:52:56 +00:00
dev day #63
This commit is contained in:
@@ -1367,12 +1367,12 @@ const HomePage: React.FC = () => {
|
||||
{/* Hero section: variant controlled by MyUIbrix (getVariant) or fallback to settings.hero_style */}
|
||||
{getVariant('hero', heroStyle) === 'grid' && isVisible('hero', true) && (
|
||||
<section data-element="hero" className="hero-grid">
|
||||
{news[0] ? (
|
||||
<a href={`/news/${news[0].slug || news[0].id}`} className="hero-card big" style={{ textDecoration: 'none' }}>
|
||||
<div className="bg" style={{ backgroundImage: `url(${assetUrl(news[0].image) || '/images/news/placeholder.jpg'})` }} />
|
||||
{featured[0] ? (
|
||||
<a href={`/news/${featured[0].slug || featured[0].id}`} className="hero-card big" style={{ textDecoration: 'none' }}>
|
||||
<div className="bg" style={{ backgroundImage: `url(${assetUrl(featured[0].image) || '/images/news/placeholder.jpg'})` }} />
|
||||
<div className="overlay">
|
||||
<div style={{ opacity: 0.8, fontSize: '0.8rem', color: 'var(--text-on-primary)' }}>{news[0].category || 'Aktuality'}</div>
|
||||
<h2 style={{ margin: '4px 0 0 0', color: 'var(--text-on-primary)' }}>{news[0].title}</h2>
|
||||
<div style={{ opacity: 0.8, fontSize: '0.8rem', color: 'var(--text-on-primary)' }}>{featured[0].category || 'Aktuality'}</div>
|
||||
<h2 style={{ margin: '4px 0 0 0', color: 'var(--text-on-primary)' }}>{featured[0].title}</h2>
|
||||
</div>
|
||||
</a>
|
||||
) : (
|
||||
@@ -1385,7 +1385,7 @@ const HomePage: React.FC = () => {
|
||||
</a>
|
||||
)}
|
||||
<div className="small-col">
|
||||
{news.slice(1, 3).map((n, idx) => (
|
||||
{featured.slice(1, 3).map((n, idx) => (
|
||||
<a key={n.id} href={`/news/${n.slug || n.id}`} className="hero-card small" style={{ textDecoration: 'none' }}>
|
||||
<div className="bg" style={{ backgroundImage: `url(${assetUrl(n.image) || '/images/news/placeholder.jpg'})` }} />
|
||||
<div className="overlay">
|
||||
@@ -1394,14 +1394,14 @@ const HomePage: React.FC = () => {
|
||||
</div>
|
||||
</a>
|
||||
))}
|
||||
{Array.from({ length: Math.max(0, 2 - Math.min(2, Math.max(0, news.length - 1))) }).map((_, idx) => (
|
||||
<div key={`placeholder-${idx}`} className="hero-card small" style={{ pointerEvents: 'none' }}>
|
||||
{Array.from({ length: Math.max(0, 2 - Math.min(2, Math.max(0, featured.length - 1))) }).map((_, idx) => (
|
||||
<a key={`placeholder-${idx}`} href="/news" className="hero-card small" style={{ textDecoration: 'none' }}>
|
||||
<div className="bg" style={{ backgroundImage: `url('/images/news/placeholder.jpg')`, filter: 'grayscale(50%) brightness(0.7)' }} />
|
||||
<div className="overlay">
|
||||
<div style={{ opacity: 0.8, fontSize: '0.8rem', color: '#fff' }}>Aktuality</div>
|
||||
<h3 style={{ margin: '4px 0 0 0', color: '#fff' }}>Připravujeme...</h3>
|
||||
</div>
|
||||
</div>
|
||||
</a>
|
||||
))}
|
||||
</div>
|
||||
</section>
|
||||
@@ -1418,20 +1418,7 @@ const HomePage: React.FC = () => {
|
||||
</section>
|
||||
)}
|
||||
|
||||
{/* Featured articles grid (uses Articles.featured flag) */}
|
||||
{featured.length > 0 && isVisible('news', true) && (
|
||||
<section data-element="news" className="three-cols" style={{ marginTop: 8 }}>
|
||||
{featured.map((n) => (
|
||||
<a key={n.id} href={`/news/${n.slug || n.id}`} className="hero-card small" style={{ textDecoration: 'none', height: 220 }}>
|
||||
<div className="bg" style={{ backgroundImage: `url(${assetUrl(n.image) || '/images/news/placeholder.jpg'})` }} />
|
||||
<div className="overlay">
|
||||
<div style={{ opacity: 0.8, fontSize: '0.8rem', color: '#fff' }}>Vybrané</div>
|
||||
<h3 style={{ margin: '4px 0 0 0', color: '#fff' }}>{n.title}</h3>
|
||||
</div>
|
||||
</a>
|
||||
))}
|
||||
</section>
|
||||
)}
|
||||
{/* Featured articles are now shown in the hero grid above, not here */}
|
||||
|
||||
{/* Sidebar banners (homepage_sidebar) */}
|
||||
{(banners || []).some(b => b.placement === 'homepage_sidebar') && (
|
||||
@@ -1545,27 +1532,7 @@ const HomePage: React.FC = () => {
|
||||
<a href="/kalendar" className="see-all">Všechny zápasy <FiArrowRight /></a>
|
||||
</div>
|
||||
<div className="matches-grid">
|
||||
<div className="matches-track"
|
||||
ref={trackRef}
|
||||
onMouseDown={(e) => {
|
||||
const el = e.currentTarget as HTMLDivElement;
|
||||
el.dataset.dragging = '1';
|
||||
el.dataset.startX = String(e.pageX - el.offsetLeft);
|
||||
el.dataset.scrollLeft = String(el.scrollLeft);
|
||||
}}
|
||||
onMouseLeave={(e) => { (e.currentTarget as HTMLDivElement).dataset.dragging = ''; }}
|
||||
onMouseUp={(e) => { (e.currentTarget as HTMLDivElement).dataset.dragging = ''; }}
|
||||
onMouseMove={(e) => {
|
||||
const el = e.currentTarget as HTMLDivElement;
|
||||
if (el.dataset.dragging !== '1') return;
|
||||
e.preventDefault();
|
||||
const startX = Number(el.dataset.startX || 0);
|
||||
const scrollLeft = Number(el.dataset.scrollLeft || 0);
|
||||
const x = e.pageX - el.offsetLeft;
|
||||
const walk = (x - startX) * 1; // scroll-fast factor
|
||||
el.scrollLeft = scrollLeft - walk;
|
||||
}}
|
||||
>
|
||||
<div className="matches-track" ref={trackRef}>
|
||||
{(facrCompetitions[matchesTab]?.matches || []).map((m:any, idx:number) => {
|
||||
const handleMatchClick = (e: React.MouseEvent) => {
|
||||
e.preventDefault();
|
||||
|
||||
Reference in New Issue
Block a user