feat: update homepage hero carousel images
This commit is contained in:
BIN
public/client-assets/home-hero-cave-lanterns.webp
Normal file
BIN
public/client-assets/home-hero-cave-lanterns.webp
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 268 KiB |
BIN
public/client-assets/home-hero-huangguoshu-hiker.webp
Normal file
BIN
public/client-assets/home-hero-huangguoshu-hiker.webp
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 178 KiB |
BIN
public/client-assets/home-hero-mountain-village.webp
Normal file
BIN
public/client-assets/home-hero-mountain-village.webp
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 399 KiB |
BIN
public/client-assets/home-hero-waterfall-scale.webp
Normal file
BIN
public/client-assets/home-hero-waterfall-scale.webp
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 125 KiB |
@@ -2523,15 +2523,32 @@ function HomePage() {
|
||||
const home = content.home;
|
||||
const heroSlides = useMemo(
|
||||
() => [
|
||||
'/client-assets/atlas-hero-waterfall.webp',
|
||||
'/client-assets/hero-real-travelers.webp',
|
||||
'/client-assets/hero-miao-home-meal.webp',
|
||||
{
|
||||
source: '/client-assets/home-hero-huangguoshu-hiker.webp',
|
||||
alt: { zh: '黄果树瀑布前的贵州徒步旅行者', en: 'A traveler hiking in front of Huangguoshu Waterfall' },
|
||||
position: 'center 52%',
|
||||
},
|
||||
{
|
||||
source: '/client-assets/home-hero-waterfall-scale.webp',
|
||||
alt: { zh: '贵州巨型瀑布前的旅行者', en: 'A traveler beneath a monumental Guizhou waterfall' },
|
||||
position: 'center 57%',
|
||||
},
|
||||
{
|
||||
source: '/client-assets/home-hero-mountain-village.webp',
|
||||
alt: { zh: '贵州山谷中的传统村寨', en: 'A traditional village in a Guizhou mountain valley' },
|
||||
position: 'center 50%',
|
||||
},
|
||||
{
|
||||
source: '/client-assets/home-hero-cave-lanterns.webp',
|
||||
alt: { zh: '贵州洞穴水面上的灯火与游船', en: 'Lantern light and boats inside a Guizhou cave' },
|
||||
position: 'center 52%',
|
||||
},
|
||||
],
|
||||
[],
|
||||
);
|
||||
const [heroIndex, setHeroIndex] = useState(0);
|
||||
const [heroPaused, setHeroPaused] = useState(false);
|
||||
const activeHero = heroSlides[heroIndex % heroSlides.length] || home.hero.imageUrl;
|
||||
const activeHero = heroSlides[heroIndex % heroSlides.length];
|
||||
|
||||
useGSAP(
|
||||
() => {
|
||||
@@ -2650,7 +2667,7 @@ function HomePage() {
|
||||
</div>
|
||||
|
||||
<figure className="oc-atlas-hero-media">
|
||||
<img key={activeHero} src={asset(activeHero)} alt={language === 'zh' ? '贵州瀑布秘境中的私家旅行' : 'A private journey through Guizhou waterfall country'} />
|
||||
<img key={activeHero.source} src={asset(activeHero.source)} alt={activeHero.alt[language]} style={{ objectPosition: activeHero.position }} />
|
||||
<figcaption>{pickText('贵州 · 中国西南', 'Guizhou · Southwest China', language)}</figcaption>
|
||||
</figure>
|
||||
|
||||
@@ -2671,7 +2688,7 @@ function HomePage() {
|
||||
aria-label={language === 'zh' ? `查看第 ${index + 1} 张首屏图` : `Show hero slide ${index + 1}`}
|
||||
aria-current={index === heroIndex ? 'true' : undefined}
|
||||
onClick={() => setHeroIndex(index)}
|
||||
key={slide}
|
||||
key={slide.source}
|
||||
/>
|
||||
))}
|
||||
<button
|
||||
|
||||
Reference in New Issue
Block a user