- 页面顶部添加限时特惠横幅,提示当前为特价 - 每个套餐卡片增加"特惠价"徽章 - 价格区域增加折扣百分比标签和涨价提示 - 中英文 i18n 键补全 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2 lines
1.8 KiB
JavaScript
2 lines
1.8 KiB
JavaScript
import{r as n,j as i}from"./index-DFuC01Yj.js";import{b as C,c as R}from"./CountUp-CbiQotWO.js";import{u as M}from"./use-animation-frame-B0UtZweQ.js";import{m as c}from"./proxy-DSSek5uX.js";function A({children:h,className:k="",colors:f=["#5227FF","#FF9FFC","#B19EEF"],animationSpeed:m=8,showBorder:d=!1,direction:t="horizontal",pauseOnHover:o=!1,yoyo:x=!0}){const[v,b]=n.useState(!1),r=C(0),l=n.useRef(0),a=n.useRef(null),s=m*1e3;M(e=>{if(v){a.current=null;return}if(a.current===null){a.current=e;return}const $=e-a.current;if(a.current=e,l.current+=$,x){const y=s*2,u=l.current%y;u<s?r.set(u/s*100):r.set(100-(u-s)/s*100)}else r.set(l.current/s*100)}),n.useEffect(()=>{l.current=0,r.set(0)},[m,r,x]);const g=R(r,e=>t==="horizontal"?`${e}% 50%`:t==="vertical"?`50% ${e}%`:`${e}% 50%`),j=n.useCallback(()=>{o&&b(!0)},[o]),z=n.useCallback(()=>{o&&b(!1)},[o]),F=t==="horizontal"?"to right":t==="vertical"?"to bottom":"to bottom right",E=[...f,f[0]].join(", "),p={backgroundImage:`linear-gradient(${F}, ${E})`,backgroundSize:t==="horizontal"?"300% 100%":t==="vertical"?"100% 300%":"300% 300%",backgroundRepeat:"repeat"};return i.jsxs(c.div,{className:`relative mx-auto flex max-w-fit flex-row items-center justify-center rounded-[1.25rem] font-medium backdrop-blur transition-shadow duration-500 overflow-hidden cursor-pointer ${d?"py-1 px-2":""} ${k}`,onMouseEnter:j,onMouseLeave:z,children:[d&&i.jsx(c.div,{className:"absolute inset-0 z-0 pointer-events-none rounded-[1.25rem]",style:{...p,backgroundPosition:g},children:i.jsx("div",{className:"absolute bg-black rounded-[1.25rem] z-[-1]",style:{width:"calc(100% - 2px)",height:"calc(100% - 2px)",left:"50%",top:"50%",transform:"translate(-50%, -50%)"}})}),i.jsx(c.div,{className:"inline-block relative z-2 text-transparent bg-clip-text",style:{...p,backgroundPosition:g,WebkitBackgroundClip:"text"},children:h})]})}export{A as G};
|