一切皆为插件的开发者工具运行时框架
🧩 核心特性:
- 插件热插拔 (importlib 动态加载)
- 依赖自动解析 (拓扑排序 + 循环检测)
- 企业级稳定 (熔断/降级/重试/隔离)
- 事件驱动 (发布/订阅事件总线)
- 完整配置 (YAML 配置 + 热重载)
36 lines
1.1 KiB
JavaScript
36 lines
1.1 KiB
JavaScript
// 动画入口
|
|
gsap.registerPlugin(ScrollTrigger);
|
|
|
|
// 页面元素入场
|
|
gsap.utils.toArray('.feature-card, .step-card, .arch-layer, .arch-plugin').forEach((el, i) => {
|
|
gsap.fromTo(el,
|
|
{ y: 40, opacity: 0 },
|
|
{
|
|
y: 0, opacity: 1, duration: 0.6,
|
|
ease: 'power3.out',
|
|
scrollTrigger: { trigger: el, start: 'top 85%' },
|
|
delay: (i % 4) * 0.1
|
|
}
|
|
);
|
|
});
|
|
|
|
// Hero 动画
|
|
if (document.querySelector('.hero-content')) {
|
|
gsap.fromTo('.hero-content > *',
|
|
{ y: 50, opacity: 0 },
|
|
{ y: 0, opacity: 1, duration: 0.8, stagger: 0.1, ease: 'power3.out', delay: 0.2 }
|
|
);
|
|
gsap.fromTo('.hero-visual',
|
|
{ scale: 0.85, opacity: 0 },
|
|
{ scale: 1, opacity: 1, duration: 1, ease: 'back.out(1.4)', delay: 0.4 }
|
|
);
|
|
}
|
|
|
|
// 平滑滚动
|
|
document.querySelectorAll('a[href^="#"]').forEach(a => {
|
|
a.addEventListener('click', e => {
|
|
const target = document.querySelector(a.getAttribute('href'));
|
|
if (target) { e.preventDefault(); target.scrollIntoView({ behavior: 'smooth' }); }
|
|
});
|
|
});
|