Foundations: Setup, Mindset, and Your Toolchain đ§°
Before writing a single line of animation code, you need a rock-solid foundation. This chapter establishes the mental models that separate hobbyists from professionalsâunderstanding that great animation isn't about flashy tricks, but about timing, motion, and meaning working in harmony. We'll configure your WordPress environment with BricksBuilder and PhpStorm so that debugging is painless, script loading is predictable, and you're never fighting your tools instead of creating.
- 1.1.1 â What âPro-Level GSAPâ Actually Means â
- 1.1.2 â How to Use This Course Page-by-Page (Deliverables per Page) đ§
- 1.1.3 â The âAnimation Triadâ: Timing, Motion, Meaning đď¸
- 1.2.1 Recommended Local Dev Setup: LocalWP / Docker Options Conceptually đ§°
1.1.1 â What âPro-Level GSAPâ Actually Means â
(Skills checklist + what âgoodâ looks like in real WordPress/Bricks projects)
Pro-level GSAP isnât about knowing every method; itâs about delivering motion that feels intentional, resilient, performant, and maintainableâespecially under real constraints: responsive layouts, CMS content changes, caching/minification plugins, popups, query loops, and client edits.
Below is a practical checklist you can use to self-assess and to guide what weâll build throughout the course.
1) Motion Design Fundamentals (Youâre animating meaning, not pixels) đď¸
A pro can explain why something movesânot just how.
-
Intent & hierarchy
- You can articulate the purpose of each animation:
- Guidance (direct attention)
- Feedback (confirm an action)
- Continuity (connect states)
- Delight (brand personalityâused sparingly)
- You avoid âanimation for animationâs sake.â If it doesnât help, it goes.
- You can articulate the purpose of each animation:
-
Timing literacy
- You intentionally choose durations (not random defaults).
- You understand the âfeelâ difference between:
- Quick UI feedback (often ~0.12â0.25s)
- Content reveals (often ~0.4â0.9s)
- Storytelling sequences (often 1.2s+ total, composed of smaller beats)
- You can speed up or slow down an entire experience consistently (tokens / global defaults).
-
Easing literacy
- You know what easing communicates:
- Ease out = arrives gently (common for entrances)
- Ease in = leaves decisively (common for exits)
- Ease in-out = smooth travel (common for continuous motion)
- You keep easing consistent across a site (design system approach).
- You know what easing communicates:
-
Spatial consistency
- Your distances match layout scale (e.g., cards move 12â24px, not 200px).
- You avoid moving elements so far they feel disconnected from where they came from.
- You consider directionality:
- Upward motion often reads as âlifting / appearingâ
- Downward motion often reads as âdropping / dismissingâ
- Horizontal motion can imply ânavigation / progressionâ
2) GSAP Core Mastery (Fluent with the primitives) đ
A pro is fast because they deeply understand the foundational building blocks.
-
Tween fluency
- You know when to use:
gsap.to()(animate to a known end state)gsap.from()(reveal from an initial state without manually setting it in CSS)gsap.fromTo()(when you need exact start and end control)
- You understand that
from()can be tricky if something else sets the starting styles (CSS, inline styles, other scripts).
- You know when to use:
-
Property fluency
- You prefer transforms and opacity for performance.
- You know the difference between:
x/yvstranslateX/translateYautoAlphavsopacityautoAlphatoggles visibility at0(often ideal for entrances/exits)
- You recognize âexpensiveâ properties (e.g., layout-triggering ones like
top/left/width/height) and avoid them when possible.
-
Stagger fluency
- You can stage lists of elements without writing loops manually.
- You can produce different rhythms:
- Subtle (small stagger, gentle ease)
- Snappy (short duration, tighter stagger)
- Dramatic (longer stagger, stronger ease)
-
Callbacks & lifecycle
- You use callbacks for integration:
- Toggling classes
- Updating ARIA states
- Enabling pointer events only after animation completes
- You avoid heavy work in
onUpdatethat causes jank.
- You use callbacks for integration:
3) Timelines (The âpro multiplierâ) đŹ
Pros default to timelines because they scale.
-
Composition & readability
- You structure timelines so the sequence reads like a story.
- You use labels and the position parameter to avoid âmagic delays.â
-
Control
- You can
play(),pause(),reverse(),restart(), and set progress. - You can attach a timeline to UI state (menu open/close, modal in/out).
- You can
-
Modularity
- You can write functions that return timelines:
- One function per component (hero, cards, nav, modal)
- No shared global selectors that accidentally target other sections
- You can write functions that return timelines:
4) ScrollTrigger Competence (Real-world scroll without fragile hacks) đ§
Scroll is where âtoy demosâ often break. Pros make it robust.
-
Trigger calibration
- You understand
trigger,start,end,toggleActions,scrub, andpin. - You use markers for calibration during devâand remove/disable for production.
- You understand
-
Responsiveness
- You implement different scroll behaviors by viewport size using
ScrollTrigger.matchMedia(). - You anticipate layout changes (fonts, images, accordions) and handle refresh correctly.
- You implement different scroll behaviors by viewport size using
-
Performance
- You batch repeated elements rather than creating a heavy trigger per item when needed.
- You avoid massive scrubbed transforms on huge images unless youâve tested mobile.
5) WordPress + Bricks Integration (Where pros quietly win) đ§ą
In WP/Bricks, âit works on my machineâ isnât enough.
-
Script loading discipline
- You know where code should live:
- Global vs page vs template vs component
- You avoid loading the same GSAP init multiple times through templates/popups.
- You know where code should live:
-
Targeting strategy
- You use stable selectors:
- Classes and
data-*attributes (often best) - Avoid brittle auto-generated IDs or deeply nested selectors
- Classes and
- You scope animations per component instance:
- If a section repeats, each instance animates independently.
- You use stable selectors:
-
Dynamic DOM awareness
- You handle:
- Bricks popups/off-canvas that mount/unmount
- Query loops (unknown item count)
- AJAX-ish content changes (where applicable)
- You defend against missing elements (no console errors on pages where a component doesnât exist).
- You handle:
-
Compatibility with caching/minification
- You know how to debug when:
- Scripts are deferred
- Order changes
- Minifiers rewrite or bundle unexpectedly
- You know how to debug when:
6) Maintainability (Code you can ship and revisit) đ§
Pros are trusted because their work stays stable over time.
-
Consistent patterns
- You have a repeatable component pattern:
- Find root element
- Query children within root
- Create timeline/tweens
- Return cleanup function (when applicable)
- You have a repeatable component pattern:
-
Configuration & âmotion tokensâ
- You define shared constants for:
- Durations (fast/medium/slow)
- Eases (standard set)
- Distances (small/medium/large)
- You can adjust the entire siteâs âfeelâ centrally without editing 40 tweens.
- You define shared constants for:
-
Naming and documentation
- Your code reads like intent, not like a puzzle.
- You leave notes where Bricks/WP behavior is non-obvious.
7) Accessibility & UX Responsibility âż
This is non-negotiable at a pro level.
-
Reduced motion
- You respect
prefers-reduced-motion:- Provide alternative behavior (fade only, shorter motion, or none)
- Donât punish users with broken layouts if animations are disabled
- You respect
-
Keyboard & focus
- You donât animate in a way that traps or loses focus.
- For modals/menus, you synchronize:
- Visual state
- ARIA state
- Focus management
-
Avoiding âharmfulâ motion
- You avoid aggressive parallax and excessive scrub on large sections unless thereâs a strong reason.
- You consider readability for text animations (no over-kinetic type).
8) Performance Engineering (Smooth on real devices) âď¸
Pros test on the devices clients actually have.
-
Performance intuition
- You understand the rough cost stack:
- Layout (often expensive)
- Paint (can be expensive)
- Composite (usually best-case)
- You choose properties and strategies that land you in âcompositeâ territory (transforms/opacity).
- You understand the rough cost stack:
-
Profiling
- You can use DevTools to:
- Spot long frames
- Identify layout thrashing
- Confirm smoothness during scroll
- You can use DevTools to:
-
Cleanup
- You kill timelines and ScrollTriggers when they shouldnât persist.
- You avoid duplicate instances after page builder edits, partial reloads, or popup reopens.
9) A Quick Self-Assessment (Score yourself) đ§ž
Rate each item 0â2:
- Design intent
- I can explain the purpose of each animation.
- Tween fundamentals
- I confidently use
to/from/fromTo, easing, stagger, callbacks.
- I confidently use
- Timelines
- I structure sequences with labels/positioning (not delay hacks).
- ScrollTrigger
- I can build responsive, calibrated triggers and debug them.
- Bricks/WP integration
- My selectors are stable, scoped, and my scripts donât duplicate.
- Accessibility
- I respect reduced motion and keyboard/focus needs.
- Performance
- I can profile, optimize, and keep things smooth on mobile.
- Maintainability
- My code is modular, reusable, and documented.
Interpretation
- 0â6: You can build effects, but they may be fragile or inconsistent.
- 7â11: Youâre functional; pro habits are emerging.
- 12â16: Youâre operating professionallyânow refine style, systems, and speed.
1.1.2 â How to Use This Course Page-by-Page (Deliverables per Page) đ§
This course is designed like a production checklist: every page (lesson) ends with clear deliverables you can verify in your Bricks/WordPress build. The goal is that you never âkind of understandââyou either shipped the artifact (code + Bricks setup + notes), or you didnât.
The Page-by-Page Workflow (Repeatable Every Time) â
1) Before You Start: Prepare the âLesson Sandboxâ (5â10 min)
- Pick one page to implement (e.g.,
1.1.2) and commit to finishing it end-to-end. - Choose a controlled location in Bricks:
- A dedicated Course Sandbox page (recommended), or
- A specific template/section you wonât reuse yet.
- Disable variables that hide problems (temporarily):
- Cache/minify plugins (or bypass via dev mode)
- CDN optimizations
- Aggressive script deferring (until your baseline works)
Deliverable: A dedicated Bricks page/template you can safely break and reset.
2) Implementation: Build What the Lesson AsksâNothing More đŻ
Each lesson page will include:
- Goal (what youâre building)
- Why it matters (the mental model)
- Bricks implementation (exact placement + selectors)
- Code (copy/paste + explanation)
- Micro-exercises (small variations that prove understanding)
- Troubleshooting (common failure modes)
Rule: implement exactly the described effect first.
Polish (styling, extra features) comes after the effect is reliable.
Deliverable: The animation/behavior works exactly as described in the lesson.
3) Verification: Prove It Works (Not Just âLooks OKâ) đ
For every page, youâll verify four categories:
- Functional verification
- Does it run on first load?
- Does it run after refresh?
- Does it run on hard reload (cache bypass)?
- Selector verification
- Does it still work if there are two instances of the section?
- Does it break if the DOM structure changes slightly?
- Responsive verification
- Test at least: mobile, tablet, desktop breakpoints
- Confirm no overflow, clipping, or unexpected shifts
- Accessibility/motion sanity check
- If motion is significant: consider
prefers-reduced-motion - Ensure no focus traps or invisible-but-clickable overlays
- If motion is significant: consider
Deliverable: A short checklist (written by you) marking what you tested.
What âDeliverables per Pageâ Actually Means đŚ
Each page produces artifacts you keep. Over time, these become your personal GSAP toolkit.
Core Deliverables (Every Page)
- Working demo inside Bricks
- A section/page where the effect is visible
- Uses robust selectors (usually classes/data attributes)
- Saved code snippet
- Stored in your project in a predictable place (see âFolder patternâ below)
- Includes a short header comment: what it does + how to apply
- One-liner notes
- What surprised you?
- What broke first?
- What youâd do differently next time
Optional Deliverables (When the page includes them)
- Reusable function (e.g.,
initHeroReveal(rootEl)) - Mini utility (e.g., a scoped selector helper)
- A variation (e.g., âsame reveal but staggeredâ)
Standard Folder + Naming Pattern (So You Donât Lose Anything) đď¸
Even if youâre not using a bundler yet, use a consistent structure.
- Create a âcourse labâ area in your theme or child theme (or a snippets plugin):
gsap-lab/gsap-lab/pages/gsap-lab/utils/
- Name files by lesson number:
pages/01-01-02-workflow.js- Later:
pages/04-01-first-tween.js, etc.
- Add a short header comment at the top of each file:
- What it does
- Where itâs used (Bricks page/template)
- Dependencies (GSAP core, ScrollTrigger, etc.)
Deliverable: A place where your âlesson codeâ lives permanently, not in random Bricks textareas.
Bricks Placement Rules (So Scripts Donât Turn Into Chaos) đ§ą
Youâll repeatedly choose where code goes. Use these rules while learning:
- During learning (recommended):
- Put lesson JS in one predictable place (global or the sandbox page)
- Keep selectors scoped to the sandbox section to avoid side effects
- When you turn a lesson into a reusable component:
- Move code into a âcomponent initâ function
- Initialize per section instance (important for query loops/repeated sections)
Deliverable: You can explain why your code is placed where it is (not âbecause it worked onceâ).
The âTwo-Instance Testâ (Your Fastest Pro Filter) đ§Ş
A huge amount of WordPress/Bricks animation pain comes from accidental global targeting.
Do this after most lessons:
- Duplicate the animated section in Bricks (same page).
- Reload.
- Confirm:
- Both instances animate correctly
- One instance doesnât hijack the otherâs elements
- Timing doesnât âdouble fireâ
If it fails, you learn a key professional habit: scope your selectors.
Deliverable: A screenshot or note: âTwo-instance test: pass/fail + fixâ.
What You Should Send Me After Completing Any Page đ¤
When you finish a lesson page, reply with:
- Where you put the code (Bricks global/page/element OR theme file)
- Your selectors (classes/data attributes you used)
- What worked immediately
- What broke
- One screenshot (optional but helpful) or a short description
Then I can:
- Suggest improvements (scoping, maintainability)
- Flag performance/accessibility risks early
- Provide a cleaner âcomponent versionâ of your solution
Your Deliverables for This Page (1.1.2) â
- A written personal workflow checklist you will follow for each lesson page (copy the sections above and simplify to your taste).
- A sandbox page/template in Bricks dedicated to course experiments.
- A project structure decision:
- Where lesson JS will live for now
- How you will name and store lesson code snippets
- A quick two-instance test habit added to your checklist.
Quick Micro-Exercise (5 minutes) âď¸
Create a checklist you can paste at the top of each future lesson file:
- Goal:
- Where installed (Bricks/page/global/file):
- Selectors used:
- Tested:
- Refresh
- Hard reload
- Two-instance test
- Mobile/tablet/desktop
- Reduced motion (if relevant)
- Notes:
1.1.3 â The âAnimation Triadâ: Timing, Motion, Meaning đď¸
Professional-looking animation isnât primarily about âcool effectsââitâs about making the user feel that the interface is responsive, intentional, and clear. This lesson gives you a repeatable decision framework you can apply to any GSAP animation in WordPress/Bricks.
https://codepen.io/editor/ZcarecroW/pen/019da77a-6995-7501-9af8-4866e69b7f1c
1) Goal â
By the end of this page you will be able to:
- Diagnose why an animation feels âoffâ using Timing / Motion / Meaning.
- Design an animation intentionally (instead of guessing eases/durations).
- Implement a tiny Bricks sandbox demo that lets you feel the triad by toggling settings.
- Build the habit of writing a 1â2 line âmeaning statementâ before animating.
2) The Triad (The Mental Model) đ§
2.1 Timing = When and how fast things happen âąď¸
Timing includes:
- Duration: how long a tween runs.
- Delay: how long before it begins.
- Stagger: spacing between repeated items (lists, cards).
- Rhythm: consistency across the site (so the UI feels coherent).
What timing communicates:
- Fast timing â responsiveness, precision, confidence (common in UI).
- Slower timing â weight, calm, luxury (common in editorial / hero).
- Inconsistent timing â âcheapâ feeling because the site has no rhythm.
Practical rules of thumb (web UI):
- Micro feedback (hover/press/focus):
- Usually 0.08â0.20s
- Should feel instant, not âanimatedâ
- Component transitions (menu open, accordion, modal):
- Usually 0.25â0.60s
- Decorative/hero sequences:
- Often 0.6â1.2s, but keep it purposeful
If youâre unsure: start at 0.35s for UI transitions and adjust.
2.2 Motion = What path/shape the movement takes đ§
Motion includes:
- Properties you animate:
- Prefer
x/y,scale,rotate,opacity/autoAlpha - Avoid animating
top/left/width/heightunless you know why (layout + jank risk)
- Prefer
- Easing (the velocity curve)
- Distance (how far an element moves)
- Direction (does it match the visual hierarchy and reading direction?)
What motion communicates:
- Ease-out-ish motion â natural settling (common for UI entering)
- Overshoot/bounce â playful or âtoy-likeâ (use deliberately)
- Too much distance â feels like the element is âtravelingâ instead of âappearingâ
A simple motion quality checklist:
- Does it feel like it has mass? (even a tiny bit)
- Does it start/stop in a way that matches the product tone?
- Does motion support the layout (not fight it)?
2.3 Meaning = Why the animation exists â¨
Meaning is the most ignoredâand the most âproââpart.
Meaning includes:
- What the user learns from the animation:
- âThis opened.â
- âThis is clickable.â
- âThis is the next step.â
- What it prioritizes:
- Which element is âprimaryâ in the moment?
- What it prevents:
- Confusion
- Misclicks
- Losing context during state changes
Meaning statement (habit): before animating, write:
- Trigger: what causes it? (load / click / scroll)
- User benefit: what clarity/feedback do they get?
- Constraint: what must not happen? (motion sickness, layout shift, delay)
Example:
- âWhen the modal opens, the backdrop fades in quickly to signal a new layer, then the dialog rises slightly to confirm focus moved to itâwithout shifting layout.â
If you canât write the meaning statement, youâre probably adding motion âbecause it looks coolâ (which is fine in a Dribbble shot, risky in production).
3) How the Triad Solves Real Problems (Common âIt Feels Offâ Diagnoses) đ§°
3.1 The animation feels laggy đŹ
Usually a timing issue (too slow, too much delay), or a meaning issue (feedback arrives too late).
Fixes:
- Reduce delay (often to
0). - Shorten duration by 20â40%.
- Add a tiny instant cue:
- e.g. quick
autoAlphachange first, then movement
- e.g. quick
3.2 The animation feels floaty / cheap đ
Usually a motion issue (ease doesnât match UI), sometimes too much distance.
Fixes:
- Use a more âUIâ ease:
power2.out,power3.out,expo.out(carefulâexpo can be dramatic)
- Reduce travel distance:
y: 24instead ofy: 80
3.3 The animation feels confusing đ¤
Almost always a meaning issue.
Fixes:
- Make the state change readable:
- Backdrop + dialog separation for overlays
- Use direction to explain hierarchy:
- âNew layerâ often comes forward/up slightly
- Donât animate everything:
- Animate the one thing that clarifies what changed
3.4 The animation is âfineâ but the site feels inconsistent đ§Š
A timing rhythm problem (durations/eases vary randomly).
Fixes:
- Define site motion tokens (youâll formalize later in Chapter 14):
- 2â3 durations and 2â3 eases you reuse everywhere
4) Bricks Implementation (Sandbox Demo) đ§ą
Youâll build a small section with:
- A headline + paragraph + button.
- A âPlayâ button that runs a reveal animation.
- A âMode toggleâ that switches between:
- UI mode (snappy, restrained)
- Hero mode (slower, more cinematic)
4.1 Bricks structure (what to create)
Create a Section (or Container) and add:
- A wrapper container with class:
triad-demo - Inside it:
- Heading (H2) with class:
triad-title - Text (p) with class:
triad-text - Button row container with class:
triad-controls- Button 1: âPlayâ with class:
triad-play - Button 2: âToggle modeâ with class:
triad-toggle - (Optional) small label span with class:
triad-mode
- Button 1: âPlayâ with class:
- Heading (H2) with class:
Why these classes?
Theyâre stable, readable, and easy to scopeâperfect for WordPress where DOM can change.
4.2 Minimal CSS (Bricks â Page Settings â Custom CSS)
.triad-demo {
max-width: 720px;
margin: 0 auto;
padding: 48px 24px;
}
.triad-controls {
display: flex;
gap: 12px;
align-items: center;
margin-top: 16px;
}
/* Optional: make the âmodeâ label subtle */
.triad-mode {
margin-left: 8px;
font-size: 14px;
opacity: 0.75;
}
4.3 JavaScript (Bricks â Page Settings â Custom Code â Footer Scripts)
Put it in Footer so the DOM exists when this runs (weâll formalize DOM-ready patterns in
2.1.1) â
(() => {
// Scope everything to each .triad-demo instance (so duplicates on the page wonât collide).
const demos = document.querySelectorAll(".triad-demo");
if (!demos.length) return;
demos.forEach((root) => {
const title = root.querySelector(".triad-title");
const text = root.querySelector(".triad-text");
const playBtn = root.querySelector(".triad-play");
const toggleBtn = root.querySelector(".triad-toggle");
const modeLabel = root.querySelector(".triad-mode");
if (!title || !text || !playBtn || !toggleBtn) return;
// Two presets to FEEL the difference between "UI motion" and "Hero motion".
const presets = {
ui: {
label: "UI mode",
timing: { duration: 0.38, stagger: 0.06 },
motion: { y: 18, ease: "power2.out" },
meaning: "Fast clarity: content appears quickly with minimal travel."
},
hero: {
label: "Hero mode",
timing: { duration: 0.9, stagger: 0.12 },
motion: { y: 42, ease: "power3.out" },
meaning: "Cinematic emphasis: slower, longer travel, more presence."
}
};
let mode = "ui";
const updateModeUI = () => {
if (modeLabel) {
modeLabel.textContent = `${presets[mode].label} â ${presets[mode].meaning}`;
}
toggleBtn.setAttribute("aria-pressed", mode === "hero" ? "true" : "false");
};
// Build a function that returns a timeline, so itâs easy to reuse.
const buildRevealTl = () => {
const p = presets[mode];
// Clear any inline transforms/opacity from previous runs (keeps repeat plays consistent).
gsap.set([title, text, playBtn], { clearProps: "all" });
// Set initial state (meaning: they are "not yet here")
gsap.set([title, text, playBtn], { autoAlpha: 0, y: p.motion.y });
const tl = gsap.timeline();
tl.to([title, text, playBtn], {
autoAlpha: 1,
y: 0,
duration: p.timing.duration,
ease: p.motion.ease,
stagger: p.timing.stagger
});
return tl;
};
let activeTl = null;
playBtn.addEventListener("click", () => {
// Prevent double-firing overlapping timelines
if (activeTl) activeTl.kill();
activeTl = buildRevealTl();
});
toggleBtn.addEventListener("click", () => {
mode = mode === "ui" ? "hero" : "ui";
updateModeUI();
});
// Initial label
updateModeUI();
});
})();
5) Micro-Exercises (Prove You Understand the Triad) đ§Ş
Do these in orderâeach targets one part of the triad.
-
Timing-only experiment (no motion changes):
- Keep
yandeasethe same - Change
durationfrom0.38â0.22 - Observe: does it feel more âresponsiveâ or more âharshâ?
- Keep
-
Motion-only experiment (same duration):
- Keep duration constant
- Change ease:
power2.outâpower1.out(more linear feel)power2.outâexpo.out(more dramatic snap)
- Describe in one sentence what changed emotionally.
-
Meaning experiment (change whatâs animated):
- Animate only the title and leave text/button static
- Ask: is the state change still clear? What did you lose?
-
Rhythm experiment (site consistency):
- Pick one duration + ease you like for UI:
- e.g.
duration: 0.35,ease: power2.out
- e.g.
- Write it down somewhere as your first âmotion tokenâ.
- Pick one duration + ease you like for UI:
6) Troubleshooting (Common Failure Modes) đ§
-
Nothing happens when clicking âPlayâ
- Confirm GSAP is actually loaded on the page:
- In DevTools Console, run:
It should returntypeof gsap"function"or"object"(not"undefined").
- In DevTools Console, run:
- Confirm your class names match exactly:
.triad-demo,.triad-title,.triad-text,.triad-play,.triad-toggle
- Confirm GSAP is actually loaded on the page:
-
Only the first demo works (if you duplicated the section)
- This lessonâs code scopes per
.triad-demoinstanceâso it should work. - If it doesnât, you likely reused IDs or targeted global selectors elsewhere.
- This lessonâs code scopes per
-
Elements jump / flicker
- Ensure the initial state is set before animating:
- We use
gsap.set(...autoAlpha: 0, y: ...)for that purpose.
- We use
- If you have CSS transitions on these elements, remove them (CSS transitions can fight GSAP).
- Ensure the initial state is set before animating:
-
The mode label doesnât show
- You didnât add the optional
.triad-modeelementâeither add it, or ignore it (the demo still works).
- You didnât add the optional
7) Verification Checklist (Do This Every Lesson) â
- Functional
- Click Play: does it animate?
- Click Toggle mode then Play: does it feel noticeably different?
- Hard refresh
- Reload with cache bypass (your browserâs hard reload) and retest.
- Two-instance test
- Duplicate the
.triad-demosection in Bricks - Confirm both work independently
- Duplicate the
- Basic accessibility sanity
- Toggle button has
aria-pressedupdating (it does) - Nothing becomes invisible-but-clickable (we use
autoAlpha, which toggles visibility)
- Toggle button has
8) Your Output (What to Save) đž
- A short note in your project (or a text file) answering:
- Which preset felt better for UI?
- What duration/ease did you choose as your first âtokenâ?
- Save this snippet as:
pages/01-01-03-animation-triad.js
- Add a header comment at the top of the file like:
- What it does
- Where itâs used (Bricks sandbox page)
- Dependencies: GSAP core
1.2.1 Recommended Local Dev Setup: LocalWP / Docker Options Conceptually đ§°
This lesson is about building a safe, fast, professional development environment for WordPress animation work with BricksBuilder, GSAP, and PhpStorm.
If you want to become really good at GSAP on WordPress sites, your setup matters more than most beginners realize. A weak setup causes confusion:
-
You donât know whether a bug comes from:
- your code,
- WordPress,
- caching,
- the host,
- or Bricks.
-
You avoid experimenting because breaking a live site feels risky.
-
You waste energy on deployment and environment problems instead of learning animation.
A solid local setup fixes that. â
What you are trying to achieve
Your goal is to create a local WordPress environment where you can:
- build pages in BricksBuilder,
- write and organize JavaScript, CSS, and PHP cleanly,
- test GSAP animations safely,
- debug quickly in the browser and in PhpStorm,
- later move your work to staging/live with fewer surprises.
Think of local development as your animation laboratory đŹ
You should be able to:
- break things without fear,
- inspect everything,
- reset quickly,
- test ideas fast.
The two main local development approaches
For this course, the two main conceptual paths are:
- LocalWP
- Docker-based local environment
Both are valid.
Both can be professional.
But they serve slightly different types of learners and workflows.
Option 1: LocalWP
What LocalWP is
LocalWP is a desktop application designed to make local WordPress development easy.
It handles things like:
- PHP,
- MySQL or MariaDB,
- web server setup,
- SSL,
- site creation,
- local domains.
Instead of manually configuring all those layers, you click a few buttons and get a working WordPress site.
For a beginner, this is often the best choice because it reduces setup friction dramatically.
Why LocalWP is excellent for this course
For learning GSAP with WordPress and Bricks, LocalWP is great because:
-
Fast setup
- You can create a new site in minutes.
- You spend your time learning animation, not server administration.
-
Good for experimentation
- You can spin up test sites for specific lessons.
- You can destroy and recreate environments with low risk.
-
WordPress-friendly
- It is built around WordPress workflows.
- It feels less abstract than Docker for newcomers.
-
Easy SSL and local domains
- Useful when testing scripts and realistic browser behavior.
- Makes your local environment feel closer to a real site.
-
Lower cognitive load
- As a beginner, you already need to learn GSAP, JavaScript, CSS, Bricks, and WP structure.
- LocalWP avoids adding âcontainer orchestrationâ to that list too early.
When LocalWP is the right choice for you
Choose LocalWP first if:
- you are still learning WordPress internals,
- you want to focus on GSAP + Bricks rather than DevOps,
- you want the easiest path to a working local site,
- you work mostly alone on your machine,
- you value convenience over full environment portability.
For most students starting this course, this is my recommendation â
Potential downsides of LocalWP
LocalWP is convenient, but it is not perfect.
-
Less explicit infrastructure knowledge
- A lot is handled for you.
- Thatâs good at first, but it can hide how the environment actually works.
-
Machine-specific quirks
- Your setup may behave slightly differently from another developerâs.
- This matters more in teams.
-
Less âinfrastructure as codeâ
- Docker setups are often more reproducible.
- With LocalWP, your environment is more GUI-managed.
-
Advanced customization may be less elegant
- You can customize things,
- but Docker often gives more systematic control.
These are not deal-breakers. They only matter more as your workflow becomes more advanced.
Option 2: Docker
What Docker is
Docker lets you define your development environment in containers.
A container is a packaged runtime environment for part of your app, such as:
- PHP,
- database,
- web server,
- mail tools,
- node tooling.
Instead of saying âit works on my machine,â Docker tries to make the machine behavior more predictable by defining the environment in configuration files.
For WordPress, this often means you have services such as:
wordpressorphp,nginxorapache,mysqlormariadb,- optionally
phpmyadmin, - optionally
mailhog, - optionally
node.
Why Docker is powerful
Docker is attractive because:
-
Reproducibility
- Team members can use the same environment definition.
- Fewer âworks for meâ problems.
-
Version control of environment
- Your environment config can live in the project.
- That means setup becomes part of the codebase.
-
Closer to professional engineering workflows
- Useful if you want to work in teams or agencies.
- Useful if you deploy to containerized infrastructure.
-
More explicit setup
- You become more aware of the layers involved.
- That deeper knowledge can help debugging.
Why Docker may be harder at first
For a beginner, Docker adds complexity:
-
You may need to understand:
- containers,
- images,
- ports,
- volumes,
- service names,
- networking.
-
When something breaks, the failure may come from:
- WordPress,
- PHP,
- file permissions,
- networking,
- container config.
-
That can distract from the main goal of this course:
- learning GSAP deeply,
- inside WordPress and Bricks.
So Docker is excellentâbut often better as a phase-2 setup, not necessarily day-1.
My recommendation for this course
Here is the practical recommendation:
-
Start with LocalWP
- It will get you productive fastest.
- It reduces noise while you learn core concepts.
-
Understand Docker conceptually
- So you know what more advanced teams may use.
- So you can migrate later if needed.
-
Move to Docker later only if one of these becomes true
- you work in a team,
- you need reproducible onboarding,
- you want environment config in version control,
- you become comfortable enough that the added complexity is worth it.
So: LocalWP now, Docker awareness from the start đ
The professional mindset: environment goals
No matter which tool you choose, a professional local environment should give you these capabilities:
-
Isolation
- Each project should be able to run without polluting other projects.
- Different PHP or plugin setups should not constantly clash.
-
Repeatability
- You should be able to recreate the setup.
- âI forgot what I installedâ is a bad sign.
-
Visibility
- You should be able to inspect logs, files, network requests, and script loading.
- Animation debugging depends on visibility.
-
Speed
- Slow feedback kills experimentation.
- GSAP learning requires many tiny test iterations.
-
Safety
- You should be free to test destructive changes locally.
- Never use a live site as your primary learning playground.
A great starter architecture for your learning setup
Here is the setup I recommend for you as a learner:
-
One main local WordPress site for the course
- Use it as your central learning sandbox.
- Install Bricks and create lesson pages there.
-
Optional extra âthrowawayâ test sites
- Use these when a lesson is highly experimental.
- For example, testing script loading edge cases or plugin conflicts.
-
A dedicated child theme or code organization strategy
- Even if Bricks lets you inject code in multiple places, keep your logic organized.
- Weâll cover that more later.
-
PhpStorm connected to the project files
- So your local files and editor reflect the actual WordPress site.
- This is crucial for scaling beyond tiny snippets.
-
Browser DevTools always part of the workflow
- GSAP work is visual.
- You need the browser open while coding, not just the editor.
Suggested folder-level mental model
Even before we get into exact project structure, you should understand the broad layers of your project.
A WordPress site typically involves:
-
Core WordPress
- The CMS itself.
- Usually not where you write your custom animation logic.
-
Themes
- This is often where your site presentation lives.
- Child themes are commonly used for safe customizations.
-
Plugins
- Third-party functionality.
- Sometimes custom behavior can also be placed in a plugin.
-
Uploads / generated content
- Media, cache artifacts, generated assets.
- Usually not where handcrafted source code should live.
For this course, your custom GSAP work will usually belong in one of these places:
- a child theme,
- a custom code organization layer used with Bricks,
- in some cases a custom plugin for reusable site behavior.
Why local development is especially important for animation
Animation work is more sensitive than many other frontend tasks.
A regular content change either appears or does not appear.
An animation can fail in much subtler ways:
- it runs too early,
- it runs too late,
- it fights CSS,
- it stutters,
- it causes layout shifts,
- it works on desktop but not mobile,
- it breaks after minification,
- it becomes inaccessible for motion-sensitive users.
That means your environment must help you inspect:
- timing,
- layout,
- script loading,
- responsive behavior,
- performance.
A local setup is where you can observe all of this safely.
Brief JavaScript insight: why environment affects JS learning đĄ
Since you asked for JS insights along the way, hereâs an important one.
JavaScript in WordPress is not just âwrite code and it runs.â
Your code depends on:
- when it loads,
- where it loads,
- whether dependencies loaded first,
- whether the target DOM elements exist yet,
- whether another tool modifies the page after load.
That matters a lot for GSAP.
For example, conceptually, this can fail:
gsap.to(".card", { y: 100 });
Why?
- Maybe GSAP isnât loaded yet.
- Maybe
.carddoesnât exist on that page. - Maybe Bricks rendered content differently than you expected.
- Maybe your script runs before the DOM is ready.
- Maybe CSS prevents you from seeing the movement clearly.
So your local environment is not just for âhosting WordPress.â
It is the stage on which your JavaScript execution model becomes visible.
Brief CSS insight: why environment affects CSS learning đ¨
GSAP often animates CSS-related properties such as:
transform,opacity,x/yequivalents through transforms,- scale,
- rotation.
But CSS can interfere in subtle ways.
If an element already has layout constraints or conflicting styles, your animation may appear broken even when the JavaScript is correct.
For example:
- a parent may have
overflow: hidden, - a flex or grid layout may influence positioning,
- an element may already be transformed,
- transitions may conflict with GSAP,
- responsive styles may override assumptions.
A local environment helps you inspect computed styles, not just your source CSS.
Thatâs a huge professional skill:
you stop guessing, and start verifying.
LocalWP setup strategy I recommend
You asked for detail, so here is the practical strategy Iâd use if I were setting you up for this course.
Site profile
Create one main site specifically for this course.
Use it as your GSAP lab.
Suggested characteristics:
-
Clean WordPress install
- Avoid a bloated starter stack at first.
- Less noise means easier debugging.
-
Bricks installed
- This will be your page-building environment.
- Keep your experiments tied to actual Bricks workflows.
-
Minimal plugin count
- Install only what you need.
- Extra plugins increase variables and conflict potential.
-
Readable local domain
- Something like
gsap-bricks-course.local - Easy to recognize in browser tabs and tools.
- Something like
-
SSL enabled if possible
- This keeps the environment closer to modern real-world browsing conditions.
- It also helps avoid mixed-content confusion in some cases.
Plugin philosophy for the learning environment
Keep the plugin list minimal.
A beginner mistake is installing many helper plugins too early. That creates mystery behavior.
For the course environment, use only what supports the learning goal.
Good philosophy:
- install only what you can explain,
- remove what you donât actively need,
- add tooling deliberately, not emotionally.
Why this matters:
- animation bugs are hard enough,
- plugin interactions multiply uncertainty,
- clean systems teach faster.
Theme philosophy
You should aim for a setup where custom code has a clear home.
Even if Bricks allows code injection in multiple places, your long-term goal is maintainability.
At this stage, the high-level rule is:
- use Bricks for building,
- use a structured place for reusable custom code,
- avoid scattering important logic randomly across pages.
Weâll refine this throughout the course.
Docker setup strategy I recommend conceptually
If you go the Docker route later, your mindset should be:
- define services clearly,
- keep volumes understandable,
- make project startup predictable,
- know where your WordPress files live,
- make sure PhpStorm edits the real mounted code,
- keep your
.envand compose setup readable.
In a typical conceptual Docker WordPress project, you would think in terms of:
-
application service
- Runs WordPress/PHP.
- Serves your site logic.
-
database service
- Stores WP content and settings.
-
web server layer
- Sometimes separate, sometimes bundled.
-
persistent volumes
- Preserve DB and/or project files between runs.
-
port mapping
- Exposes your local site to the browser.
-
project-mounted code
- Lets you edit files in PhpStorm and see them in the containerized site.
This is powerfulâbut it requires comfort with infrastructure vocabulary.
Comparison: LocalWP vs Docker
Here is the practical comparison for your use case.
| Criteria | LocalWP | Docker |
|---|---|---|
| Beginner friendliness | Excellent | Moderate to difficult |
| Setup speed | Very fast | Slower |
| WordPress focus | Strong | General-purpose |
| Learning curve | Low | Higher |
| Team reproducibility | Medium | High |
| Environment as code | Low | High |
| Debugging simplicity for beginners | Better | Harder at first |
| Best for this course start | Yes | Later |
So if your question is, âWhat should I use now?â
The answer is: LocalWP.
Your actual recommended starting stack
Here is the stack I recommend for you right now:
-
LocalWP
- For local WordPress site management.
-
WordPress
- Clean install dedicated to course exercises.
-
BricksBuilder
- Your visual building system.
-
PhpStorm
- Your code editor and project navigator.
-
Chrome or Edge DevTools
- For inspecting the DOM, CSS, network, and JS console.
-
GSAP loaded in a controlled way
- Weâll cover script loading soon.
- Donât worry about the exact loading method yet.
This is enough to begin professionally without overwhelming yourself.
What âgood enoughâ looks like at this stage
At this point, you do not need:
- a perfect enterprise-grade infrastructure,
- CI/CD pipelines,
- a containerized multi-service architecture,
- a headless WordPress setup,
- advanced deployment automation.
You do need:
- a stable local WordPress site,
- Bricks working properly,
- PhpStorm connected to your files,
- a repeatable workflow for testing code,
- confidence that you can experiment safely.
That is the professional beginner target.
Common beginner mistakes in local setup â
1. Learning directly on a live site
This is one of the biggest mistakes.
Why itâs bad:
- every experiment carries risk,
- caching obscures cause and effect,
- users may see broken states,
- fear slows learning.
Use local first. Always.
2. Installing too many plugins
People often install optimization, helper, code snippet, animation, CSS, debug, and utility plugins all at once.
Then when something breaks, they donât know why.
Better approach:
- start minimal,
- add one tool at a time,
- verify behavior after each addition.
3. Mixing code locations randomly
A little code in Bricks page settings, a little in a code snippet plugin, a little in the theme, a little in the footerâŚ
This becomes chaos quickly.
Even before we formalize architecture, keep one principle:
- if code is reusable, give it a reusable home,
- if code is page-specific, document where it lives,
- if code becomes important, move it out of ad hoc locations.
4. Ignoring file organization because âitâs just a testâ
Todayâs quick test becomes tomorrowâs production pattern.
Messy local habits often become messy professional habits.
The goal is not perfectionâit is intentional structure.
5. Blaming GSAP for environment problems
Sometimes GSAP is not the issue at all.
The actual problem may be:
- scripts not loading,
- DOM not ready,
- selectors wrong,
- CSS hiding the effect,
- cache serving stale files.
A good local setup helps you identify the real cause.
Practical recommendation: your first environment plan
Here is your concrete plan for this course.
-
Install LocalWP
- Create one main course site.
- Give it a clear name.
-
Install WordPress cleanly
- Avoid importing a giant existing project as your first learning space.
- Start with clarity.
-
Install BricksBuilder
- Confirm it runs properly in the local environment.
- Open the builder and make sure page editing works smoothly.
-
Open the site files in PhpStorm
- Weâll discuss project structure in the next lesson.
- For now, the key is making the editor part of your workflow.
-
Use the browser and DevTools from day one
- Learn to keep Console and Elements tabs nearby.
- Animation work without DevTools is guesswork.
-
Do not over-engineer yet
- Your main job right now is to make the environment stable and understandable.
- Not fancy.
Mini mental model: your workflow loop
This is the core loop you will repeat many times throughout the course:
- change code,
- refresh page,
- inspect behavior,
- verify DOM/CSS/JS state,
- adjust,
- test again.
This loop should feel fast.
If your environment makes this loop slow or confusing, learning becomes harder than necessary.
Exercise: environment decision checklist
Answer these for yourself:
-
Do I want the fastest path to building GSAP projects in WP right now?
- If yes, choose LocalWP.
-
Am I currently trying to learn animation and WordPress implementation more than infrastructure engineering?
- If yes, choose LocalWP.
-
Do I need reproducible team environments and environment config in version control today?
- If yes, consider Docker.
- If not, Docker can wait.
-
Do I clearly understand containers, service mapping, and mounted volumes?
- If not, Docker may slow down early progress.
For most learners here, the result will be:
Start with LocalWP.
Implementation target for this lesson
By the end of this page, your intended setup should be:
-
Primary environment choice
- LocalWP
-
Primary site purpose
- Dedicated GSAP + Bricks learning sandbox
-
Editor
- PhpStorm
-
Builder
- BricksBuilder
-
Testing approach
- Local first, browser-driven, DevTools-assisted
-
Advanced environment awareness
- Docker understood conceptually, postponed unless needed
Key takeaways
- Your local environment is part of your skillset, not just a technical prerequisite.
- LocalWP is the best starting choice for this course because it removes setup friction.
- Docker is valuable, but usually better once you are comfortable with the core WP + GSAP workflow.
- Animation debugging depends heavily on environment quality because issues often involve timing, CSS, DOM state, and script loading.
- A clean, minimal, intentional setup will help you learn faster and more deeply.
Action steps before moving to 1.2.2 â
-
Decide on your primary local setup tool:
- preferably LocalWP for now.
-
Create or plan a dedicated local WordPress site for this course.
-
Commit to this rule:
- I will learn and test animations locally before touching live sites.
-
Make sure you have:
- LocalWP,
- PhpStorm,
- a modern browser with DevTools,
- access to BricksBuilder.