Skip to content

Let's use AI to Earn!

bannenr切换

daoyian00db9e981b11
diff --git a/src/app/[lng]/page.tsx b/src/app/[lng]/page.tsx
index aacb6ba1..ceb003db 100644
--- a/src/app/[lng]/page.tsx
+++ b/src/app/[lng]/page.tsx
@@ -11,6 +11,9 @@ import wxSphIcon from '@/assets/svgs/plat/wx-sph.svg';
import xhsIcon from '@/assets/svgs/plat/xhs.svg';
import youtubeIcon from '@/assets/svgs/plat/youtube.svg';
+import logo from '@/assets/images/logo.png';
+import logo2 from '@/assets/images/vipcard.png';
+
// 版本发布横幅
function ReleaseBanner() {
return (
@@ -193,6 +196,74 @@ function BrandBar() {
// 功能介绍区
function BuildSection() {
+ const [currentImageIndex, setCurrentImageIndex] = useState(0);
+ const [autoRotate, setAutoRotate] = useState(true);
+ const images = [logo.src, logo2.src];
+ const autoRotateRef = useRef<NodeJS.Timeout | null>(null);
+ const carouselRef = useRef<HTMLDivElement>(null);
+
+ // 自动轮播
+ useEffect(() => {
+ if (autoRotate) {
+ autoRotateRef.current = setInterval(() => {
+ setCurrentImageIndex(prev => (prev + 1) % images.length);
+ }, 3000);
+ } else {
+ if (autoRotateRef.current) {
+ clearInterval(autoRotateRef.current);
+ autoRotateRef.current = null;
+ }
+ }
+
+ return () => {
+ if (autoRotateRef.current) {
+ clearInterval(autoRotateRef.current);
+ }
+ };
+ }, [autoRotate, images.length]);
+
+ // 滚轮控制
+ useEffect(() => {
+ const handleWheel = (e: WheelEvent) => {
+ // 检查是否在轮播区域内
+ if (carouselRef.current && carouselRef.current.contains(e.target as Node)) {
+ e.preventDefault();
+
+ if (e.deltaY > 0) {
+ // 向下滚动
+ if (currentImageIndex < images.length - 1) {
+ setCurrentImageIndex(prev => prev + 1);
+ setAutoRotate(false); // 用户操作时暂停自动轮播
+ } else {
+ // 到达最后一张图,恢复页面滚动
+ setAutoRotate(true);
+ return;
+ }
+ } else {
+ // 向上滚动
+ if (currentImageIndex > 0) {
+ setCurrentImageIndex(prev => prev - 1);
+ setAutoRotate(false);
+ }
+ }
+
+ // 3秒后恢复自动轮播
+ setTimeout(() => {
+ setAutoRotate(true);
+ }, 3000);
+ }
+ };
+
+ const carousel = carouselRef.current;
+ if (carousel) {
+ carousel.addEventListener('wheel', handleWheel, { passive: false });
+
+ return () => {
+ carousel.removeEventListener('wheel', handleWheel);
+ };
+ }
+ }, [currentImageIndex, images.length]);
+
return (
<section className={styles.buildSection}>
<div className={styles.buildContainer}>
@@ -227,8 +298,42 @@ function BuildSection() {
</div>
<div className={styles.buildRight}>
- <div className={styles.productScreenshot}>
- <img src="/api/placeholder/600/400" alt="Dify Workflow Interface" className={styles.screenshotImg} />
+ <div
+ className={styles.imageCarousel}
+ ref={carouselRef}
+ >
+ <div className={styles.carouselContainer}>
+ {images.map((image, index) => (
+ <div
+ key={index}
+ className={`${styles.carouselSlide} ${index === currentImageIndex ? styles.active : ''}`}
+ >
+ <img
+ src={image}
+ alt={`AI ToEarn Feature ${index + 1}`}
+ className={styles.carouselImage}
+ />
+ </div>
+ ))}
+ </div>
+
+ <div className={styles.carouselIndicators}>
+ {images.map((_, index) => (
+ <button
+ key={index}
+ className={`${styles.indicator} ${index === currentImageIndex ? styles.active : ''}`}
+ onClick={() => {
+ setCurrentImageIndex(index);
+ setAutoRotate(false);
+ setTimeout(() => setAutoRotate(true), 3000);
+ }}
+ />
+ ))}
+ </div>
+
+ <div className={styles.carouselHint}>
+ <span>使用滚轮切换图片</span>
+ </div>
</div>
</div>
</div>
diff --git a/src/app/[lng]/styles/difyHome.module.scss b/src/app/[lng]/styles/difyHome.module.scss
index c05b027a..4e2734fd 100644
--- a/src/app/[lng]/styles/difyHome.module.scss
+++ b/src/app/[lng]/styles/difyHome.module.scss
@@ -424,7 +424,15 @@
display: grid;
grid-template-columns: 1fr 1fr;
gap: 80px;
- align-items: center;
+ align-items: stretch;
+ min-height: 500px;
+}
+
+.buildLeft,
+.buildRight {
+ display: flex;
+ flex-direction: column;
+ justify-content: center;
}
.buildTitle {
@@ -1317,6 +1325,10 @@
font-size: 32px;
}
+ .buildContent {
+ min-height: 400px;
+ }
+
.statsGrid {
grid-template-columns: 1fr;
}
@@ -1345,6 +1357,25 @@
.footerText {
font-size: 14px;
}
+
+ // 轮播组件移动端适配
+ .imageCarousel {
+ height: 100%;
+ }
+
+ .carouselHint {
+ display: none; // 移动端隐藏滚轮提示
+ }
+
+ .carouselIndicators {
+ right: 15px;
+ gap: 10px;
+ }
+
+ .indicator {
+ width: 10px;
+ height: 10px;
+ }
}
@keyframes fadeInUp {
@@ -1403,6 +1434,112 @@
animation: slideInRight 1s ease-out;
}
+// 轮播组件样式
+.imageCarousel {
+ position: relative;
+ width: 100%;
+ height: 100%;
+ overflow: hidden;
+ border-radius: 12px;
+ box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
+ cursor: pointer;
+}
+
+.carouselContainer {
+ position: relative;
+ width: 100%;
+ height: 100%;
+}
+
+.carouselSlide {
+ position: absolute;
+ top: 0;
+ left: 0;
+ width: 100%;
+ height: 100%;
+ opacity: 0;
+ transition: opacity 0.5s ease-in-out;
+
+ &.active {
+ opacity: 1;
+ }
+}
+
+.carouselImage {
+ width: 100%;
+ height: 100%;
+ object-fit: fill;
+ transition: transform 0.3s ease;
+
+ .carouselSlide:hover & {
+ transform: scale(1.02);
+ }
+}
+
+.carouselIndicators {
+ position: absolute;
+ right: 20px;
+ top: 50%;
+ transform: translateY(-50%);
+ display: flex;
+ flex-direction: column;
+ gap: 12px;
+ z-index: 10;
+}
+
+.indicator {
+ width: 12px;
+ height: 12px;
+ border-radius: 50%;
+ border: none;
+ background: rgba(255, 255, 255, 0.5);
+ cursor: pointer;
+ transition: all 0.3s ease;
+
+ &.active {
+ background: #fff;
+ transform: scale(1.3);
+ }
+
+ &:hover {
+ background: rgba(255, 255, 255, 0.8);
+ }
+}
+
+.carouselHint {
+ position: absolute;
+ top: 20px;
+ right: 20px;
+ background: rgba(0, 0, 0, 0.7);
+ color: white;
+ padding: 8px 12px;
+ border-radius: 6px;
+ font-size: 12px;
+ opacity: 0;
+ transition: opacity 0.3s ease;
+ pointer-events: none;
+ z-index: 10;
+
+ .imageCarousel:hover & {
+ opacity: 1;
+ }
+}
+
+@keyframes carouselFadeIn {
+ from {
+ opacity: 0;
+ transform: translateY(20px);
+ }
+ to {
+ opacity: 1;
+ transform: translateY(0);
+ }
+}
+
+.carouselSlide.active {
+ animation: carouselFadeIn 0.5s ease-out;
+}
+
.connectLeft {
animation: slideInLeft 1s ease-out;
}