一键导入
frontend-gsap-ui-promax
Kỹ năng thiết kế giao diện React/HTML cao cấp (UX/UI Promax) và tạo chuyển động đồ họa động mượt mà bằng GSAP (GreenSock) trong Remotion.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Kỹ năng thiết kế giao diện React/HTML cao cấp (UX/UI Promax) và tạo chuyển động đồ họa động mượt mà bằng GSAP (GreenSock) trong Remotion.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
| name | frontend-gsap-ui-promax |
| description | Kỹ năng thiết kế giao diện React/HTML cao cấp (UX/UI Promax) và tạo chuyển động đồ họa động mượt mà bằng GSAP (GreenSock) trong Remotion. |
Kỹ năng này giúp Agent thiết kế các giao diện web dashboard hiện đại, tinh tế và tạo ra các chuyển động đồ họa (motion graphics) chất lượng cao bằng GSAP được đồng bộ hoàn hảo trong môi trường làm video Remotion.
Để giao diện web hoặc slide video trông đẳng cấp, chuyên nghiệp và có chiều sâu, luôn áp dụng các nguyên tắc thiết kế sau:
bg-[#0B0F19], bg-[#111827]), tránh dùng màu đen thuần khiết (#000).Áp dụng cho các panel, thẻ kịch bản hoặc khung kết quả để tạo chiều sâu lớp:
.glass-panel {
background: rgba(17, 24, 39, 0.7);
backdrop-filter: blur(12px);
border: 1px solid rgba(255, 255, 255, 0.08);
}
transition-all duration-300 ease-out.hover:-translate-y-0.5) hoặc tăng nhẹ độ sáng viền để phản hồi hành động của người dùng.[!IMPORTANT] Trong Remotion, KHÔNG chạy hoạt ảnh GSAP theo thời gian thực (time-based) mặc định. Nếu dùng
gsap.to()thông thường, khi render video thông qua Headless Chromium, các khung hình sẽ bị lệch hoặc giật vì quá trình render không diễn ra theo thời gian thực 1 giây = 1 giây thật.
Bạn phải liên kết thuộc tính .progress() của timeline GSAP với trục frame của Remotion thông qua hook useCurrentFrame().
import { useCurrentFrame, useVideoConfig } from 'remotion';
import { useRef, useEffect } from 'react';
import gsap from 'gsap';
import { useGSAP } from '@gsap/react';
// Đăng ký hook React của GSAP
gsap.registerPlugin(useGSAP);
export const MotionSlideElement: React.FC = () => {
const frame = useCurrentFrame();
const { durationInFrames } = useVideoConfig();
const containerRef = useRef<HTMLDivElement>(null);
const titleRef = useRef<HTMLHeadingElement>(null);
const boxRef = useRef<HTMLDivElement>(null);
const timelineRef = useRef<gsap.core.Timeline | null>(null);
// 1. Tạo Timeline GSAP ở trạng thái paused
useGSAP(() => {
const tl = gsap.timeline({ paused: true });
// Định nghĩa các chuyển động
tl.fromTo(titleRef.current,
{ opacity: 0, y: 50 },
{ opacity: 1, y: 0, duration: 1, ease: 'power3.out' }
);
tl.fromTo(boxRef.current,
{ scale: 0.5, rotation: -45, opacity: 0 },
{ scale: 1, rotation: 0, opacity: 1, duration: 1.5, ease: 'elastic.out(1, 0.5)' },
'-=0.5' // Overlap animation
);
timelineRef.current = tl;
}, { scope: containerRef });
// 2. Đồng bộ hóa tiến trình hoạt ảnh với số frame của Remotion
useEffect(() => {
if (timelineRef.current) {
const progress = frame / durationInFrames;
// Giới hạn progress trong khoảng từ 0 đến 1
timelineRef.current.progress(Math.min(1, Math.max(0, progress)));
}
}, [frame, durationInFrames]);
return (
<div ref={containerRef} className="w-full h-full flex flex-col justify-center items-center">
<h1 ref={titleRef} className="text-4xl font-bold text-white mb-8">
AI91 Medimation
</h1>
<div ref={boxRef} className="w-32 h-32 bg-indigo-500 rounded-2xl glass-panel shadow-2xl" />
</div>
);
};
Khi có yêu cầu thiết kế giao diện động hoặc tạo slide video: