Skip to content

Showcase section#1

Merged
Ellhen merged 2 commits intomainfrom
showcase
Apr 5, 2026
Merged

Showcase section#1
Ellhen merged 2 commits intomainfrom
showcase

Conversation

@Ellhen
Copy link
Copy Markdown
Owner

@Ellhen Ellhen commented Apr 5, 2026

Summary by CodeRabbit

  • New Features
    • Added a Showcase section featuring a looping muted video, logo mask and structured marketing content.
    • Introduces scroll-driven animated reveals and pinning effects on larger screens; animations are disabled or simplified on tablet viewports for responsiveness.
    • The main app layout now includes and displays the new Showcase section.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 5, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 1fd5283e-03f2-4ed3-b8ed-98a31b04e178

📥 Commits

Reviewing files that changed from the base of the PR and between e031584 and 0f138e3.

📒 Files selected for processing (1)
  • src/components/Showcase.jsx
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/components/Showcase.jsx

📝 Walkthrough

Walkthrough

Adds a new Showcase React component with a scroll-driven GSAP ScrollTrigger timeline and integrates it into App.jsx. The animation is conditionally initialized based on a tablet media query and pins the #showcase section while scrubbing mask and content animations.

Changes

Cohort / File(s) Summary
App Integration
src/App.jsx
Imports and renders new Showcase component (<Showcase />) inside <main>. Also contains minor JSX/formatting edits (quote/indentation/semicolons).
New Showcase Component
src/components/Showcase.jsx
New default-exported component rendering a video, mask image, and content. Uses useMediaQuery and useGSAP to create a GSAP timeline with a pinned ScrollTrigger that scales the mask and reveals .content when not on tablet viewports.

Sequence Diagram(s)

sequenceDiagram
  participant User
  participant App as App.jsx
  participant Showcase as Showcase.jsx
  participant GSAP as GSAP/ScrollTrigger
  participant DOM as Browser DOM

  User->>App: load page
  App->>Showcase: mount <Showcase />
  Showcase->>GSAP: init timeline (if not tablet)
  GSAP->>DOM: create ScrollTrigger (pin `#showcase`, scrub)
  User->>DOM: scroll
  DOM->>GSAP: trigger scrubbed timeline progress
  GSAP->>DOM: animate .mask img (scale) and .content (opacity/y)
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

🐰 I hopped in with a tiny scroll,
A masked logo took a role,
Pinned and scrubbed as pages glide,
Content peeks from where it hides,
A playful showcase lights the site.

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'Showcase section' directly and clearly describes the main change: adding a new Showcase component section to the application.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch showcase

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (2)
src/components/Showcase.jsx (2)

30-36: Consider adding video loading hints for better first render.

For an autoplay background video, poster + preload="metadata" usually improves perceived load and reduces blank-frame time.

Proposed refinement
 				<video
 					src="/videos/game.mp4"
+					poster="/videos/game-poster.jpg"
+					preload="metadata"
 					loop
 					muted
 					autoPlay
 					playsInline
 				/>
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/components/Showcase.jsx` around lines 30 - 36, In Showcase.jsx update the
<video> element to provide loading hints: add a poster attribute pointing to a
representative image (e.g., "/images/game-poster.jpg") and set
preload="metadata" on the <video> tag so the browser fetches sizing/metadata
before play; modify the video element in the Showcase component accordingly to
include poster and preload attributes while keeping loop, muted, autoPlay, and
playsInline.

8-25: Consider using scoped selectors in GSAP timeline for component isolation.

While selectors (.content, .mask img, #showcase) are currently unique to this component, using the scope property with a ref follows GSAP best practices and prevents future conflicts if similar class names are reused elsewhere.

Suggested refactor
+import { useRef } from 'react'
 import { useGSAP } from '@gsap/react'
 import { useMediaQuery } from 'react-responsive'
 import gsap from 'gsap'

 const Showcase = () => {
+	const rootRef = useRef(null)
 	const isTablet = useMediaQuery({ query: '(max-width: 1024px)' })

 	useGSAP(() => {
-		if (!isTablet) {
-			const timeline = gsap.timeline({
-				scrollTrigger: {
-					trigger: '#showcase',
-					start: 'top top',
-					end: 'bottom top',
-					scrub: true,
-					pin: true
-				}
-			})
-			timeline
-				.to('.mask img', {
-					transform: 'scale(1.1)'
-				})
-				.to('.content', { opacity: 1, y: 0, ease: 'power1.in' })
-		}
-	}, [isTablet])
+		if (isTablet) return
+		const timeline = gsap.timeline({
+			scrollTrigger: {
+				trigger: rootRef.current,
+				start: 'top top',
+				end: 'bottom top',
+				scrub: true,
+				pin: true
+			}
+		})
+		timeline
+			.to('.mask img', { scale: 1.1 })
+			.to('.content', { opacity: 1, y: 0, ease: 'power1.in' })
+	}, { dependencies: [isTablet], scope: rootRef, revertOnUpdate: true })

 	return (
-		<section id="showcase">
+		<section id="showcase" ref={rootRef}>
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/components/Showcase.jsx` around lines 8 - 25, The GSAP selectors used in
useGSAP ('.content', '.mask img', '#showcase') are global and can conflict with
other components; update the component to create a ref for the showcase
container and use GSAP's scoping so selectors are limited to that ref (e.g., use
gsap.context or pass the ref as the trigger and scope for the
timeline/ScrollTrigger). In practice, wrap the timeline creation inside a
gsap.context callback tied to the container ref (or replace trigger: '#showcase'
with trigger: ref.current) and change '.content' and '.mask img' to scoped
selectors so the animations only affect elements inside the Showcase component
referenced by useGSAP and the ref.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@src/components/Showcase.jsx`:
- Line 38: In the Showcase.jsx component update the <img src="/mask-logo.svg" />
element to include proper alt handling: if the logo is purely decorative set
alt="" and add aria-hidden="true" on that <img>, otherwise provide a meaningful
alt string (for example alt="Mask logo" or a context-appropriate label) so
assistive tech can convey the image; modify the <img> element in the Showcase
component accordingly.

---

Nitpick comments:
In `@src/components/Showcase.jsx`:
- Around line 30-36: In Showcase.jsx update the <video> element to provide
loading hints: add a poster attribute pointing to a representative image (e.g.,
"/images/game-poster.jpg") and set preload="metadata" on the <video> tag so the
browser fetches sizing/metadata before play; modify the video element in the
Showcase component accordingly to include poster and preload attributes while
keeping loop, muted, autoPlay, and playsInline.
- Around line 8-25: The GSAP selectors used in useGSAP ('.content', '.mask img',
'#showcase') are global and can conflict with other components; update the
component to create a ref for the showcase container and use GSAP's scoping so
selectors are limited to that ref (e.g., use gsap.context or pass the ref as the
trigger and scope for the timeline/ScrollTrigger). In practice, wrap the
timeline creation inside a gsap.context callback tied to the container ref (or
replace trigger: '#showcase' with trigger: ref.current) and change '.content'
and '.mask img' to scoped selectors so the animations only affect elements
inside the Showcase component referenced by useGSAP and the ref.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 0c22ea9b-9b32-491c-a75a-26e057131fd9

📥 Commits

Reviewing files that changed from the base of the PR and between f371736 and e031584.

📒 Files selected for processing (2)
  • src/App.jsx
  • src/components/Showcase.jsx

Comment thread src/components/Showcase.jsx Outdated
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
@Ellhen Ellhen merged commit 8c12825 into main Apr 5, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant