Appearance
ranran Chinese Page GSAP Migration Plan
Background
Target repository:
https://github.com/Lshbosheth/ranran- Target folder:
chinese/
This is an older static Chinese-style page created around 2016. The page uses:
- HTML / CSS / Less
- jQuery
- jquery.fullPage
- wow.js
- animate.css
The page theme is Chinese literary / classical style, including sections related to 楚辞, 九歌, 山鬼, 河伯, 东皇太一, 湘夫人, 离骚, and 七谏.
Goal: modernize the animation layer with GSAP while preserving the original visual identity and static-page character.
Main Goal
Replace old jQuery/wow/fullPage animation behavior with GSAP-based animation.
Do not rewrite the whole project into React/Vue unless explicitly requested later.
Keep the first migration small and reversible:
- Preserve existing HTML structure as much as possible.
- Preserve existing images and Chinese-style visual assets.
- Replace interaction animations in
china.jswith GSAP. - Only remove
wow.js,animate.css, orjquery.fullPageafter equivalent GSAP behavior is verified.
Suggested Migration Phases
Phase 1: Audit Current Behavior
Inspect these files first:
chinese/index.htmlchinese/js/china.jschinese/css/china.csschinese/css/china.lesschinese/css/banner.css
Document the current behavior:
- Which elements trigger panel changes.
- Which sections are full-page sections.
- Which
.intro,.intro1,.intro2,.know, or similar panels are shown/hidden. - Which animations come from
animate.css/wow.js. - Which behavior is controlled by
jquery.fullPage.
Phase 2: Add GSAP
Use GSAP from npm if the project is converted to a small build setup.
If keeping the page fully static, use CDN script tags:
html
<script src="https://cdn.jsdelivr.net/npm/gsap@3/dist/gsap.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/gsap@3/dist/ScrollTrigger.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/gsap@3/dist/ScrollToPlugin.min.js"></script>Register plugins when needed:
js
gsap.registerPlugin(ScrollTrigger, ScrollToPlugin);Phase 3: Replace Simple jQuery Effects First
Replace old effects like:
js
$(".know").fadeOut(1000);
$(".intro").eq(0).show(1000);with GSAP equivalents:
js
gsap.to(".know", {
autoAlpha: 0,
duration: 0.6,
ease: "power2.out"
});
gsap.fromTo(
".intro",
{ autoAlpha: 0, scale: 0.98 },
{ autoAlpha: 1, scale: 1, duration: 0.8, ease: "power2.out" }
);Prefer autoAlpha instead of manually mixing display, visibility, and opacity.
Phase 4: Organize Animation Code
Refactor china.js into small functions.
Suggested structure:
js
function initPageTransitions() {}
function initIntroPanels() {}
function initChapterAnimations() {}
function initScrollScenes() {}
function showPanel(selector) {}
function hidePanel(selector) {}
document.addEventListener("DOMContentLoaded", () => {
initPageTransitions();
initIntroPanels();
initChapterAnimations();
initScrollScenes();
});Avoid a large chain of nth-child click handlers if possible. Prefer data attributes:
html
<button data-panel-target="#shangui">山鬼</button>js
document.querySelectorAll("[data-panel-target]").forEach((trigger) => {
trigger.addEventListener("click", () => {
showPanel(trigger.dataset.panelTarget);
});
});Phase 5: Replace wow.js / animate.css
Use GSAP entrance animations instead of wow.js.
Example:
js
gsap.utils.toArray("[data-gsap-reveal]").forEach((el) => {
gsap.from(el, {
autoAlpha: 0,
y: 24,
duration: 0.8,
ease: "power2.out",
scrollTrigger: {
trigger: el,
start: "top 80%"
}
});
});Phase 6: Replace fullPage Behavior Carefully
If the page should keep one-screen-per-section navigation, consider:
ScrollTriggerpinned sections.ScrollToPluginfor section navigation.Observeronly if wheel/touch section snapping needs to be very strict.
Do not remove jquery.fullPage until the section navigation is visually verified.
Suggested intermediate approach:
- Keep
jquery.fullPage. - Replace panel and entrance animations with GSAP.
- Verify behavior.
- Then replace
jquery.fullPagewith GSAP scroll behavior if still desired.
Visual Direction
Keep the original Chinese-style atmosphere.
Possible GSAP upgrades:
- Soft ink-like fade-in for text.
- Slow parallax for background mountains, clouds, or decorative images.
- Scroll-triggered chapter reveals.
- Slight scale and opacity changes for character / poem panels.
- Pinned section transitions for major literary sections.
Avoid over-modernizing the page into a generic flashy landing page.
The goal is:
- More fluid.
- More maintainable.
- Still classical and restrained.
Acceptance Criteria
The migration is done when:
- The page opens normally from
chinese/index.html. - Existing sections and content remain visible.
- Existing click interactions still work.
- The page no longer depends on
wow.jsfor reveal animations. - jQuery animation calls such as
fadeIn,fadeOut,show(duration), andhide(duration)are replaced with GSAP. - No obvious layout overlap or broken image appears on desktop.
- If full-page scroll behavior is changed, section navigation remains smooth and predictable.
Verification
After implementation:
- Open
chinese/index.htmllocally or through a simple static server. - Test all major click interactions.
- Scroll through the page from top to bottom.
- Check browser console for errors.
- Verify the page at desktop width first.
- If mobile layout already existed, verify mobile width as a follow-up.
Notes for Codex
Keep the first pass conservative.
This is a 2016 static project with personal / nostalgic value. Preserve its original structure and atmosphere unless a change is required for the GSAP migration.
Do not replace all CSS or redesign the page from scratch.
Do not introduce a heavy frontend framework in the first migration pass.