diff --git a/src/components/common/AutoScrollContainer.tsx b/src/components/common/AutoScrollContainer.tsx index 0d01241..6c9fa78 100644 --- a/src/components/common/AutoScrollContainer.tsx +++ b/src/components/common/AutoScrollContainer.tsx @@ -2,12 +2,12 @@ /** * 滚动容器 - * TODO: 自定义滚动速度 */ import React, { useRef, useEffect, useState } from 'react'; interface TextScrollProps { + auto?: boolean; hover?: boolean; speed?: number; width: string; @@ -17,10 +17,11 @@ interface TextScrollProps { const TextScroll: React.FC = ({ width = '100px', + auto = false, className = '', children = '', hover = false, - speed = 30, + speed = 5, }) => { const containerRef = useRef(null); const childrenRef = useRef(null); @@ -62,7 +63,11 @@ const TextScroll: React.FC = ({ onMouseEnter={() => handleMouseMove(true)} onMouseLeave={() => handleMouseMove(false)} > -
+
{children} {isOverflowing && ( <>