feat(ui): add fluid section motion and interaction polish

This commit is contained in:
2026-11-03 18:22:51 +05:30
parent e7aa732892
commit 561718870b
3 changed files with 75 additions and 1 deletions
+45
View File
@@ -398,4 +398,49 @@ h1, h2, h3, h4, h5, h6, .text-3d-chiseled {
box-shadow: 0 4px 8px -2px rgba(37, 99, 235, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.95);
}
/* A consistent, quiet interaction language for the whole studio. */
:where(a, button, [role="button"], input, select, textarea) {
-webkit-tap-highlight-color: transparent;
}
:where(button, [role="button"], a[href]):focus-visible {
outline: 3px solid rgba(37, 99, 235, 0.42);
outline-offset: 3px;
}
:where(button, [role="button"]) {
transition: transform 220ms cubic-bezier(0.22, 1, 0.36, 1),
box-shadow 220ms ease, background-color 220ms ease, border-color 220ms ease;
}
:where(button, [role="button"]):active {
transform: scale(0.975);
}
:where(a[href]) {
text-decoration-thickness: from-font;
text-underline-offset: 0.18em;
}
[data-section-entrance] {
transform-origin: 50% 40%;
backface-visibility: hidden;
}
::selection {
color: #fff;
background: #315fcb;
}
@media (prefers-reduced-motion: reduce) {
*,
*::before,
*::after {
scroll-behavior: auto !important;
animation-duration: 0.01ms !important;
animation-iteration-count: 1 !important;
transition-duration: 0.01ms !important;
}
}
+10 -1
View File
@@ -26,6 +26,7 @@ import { WorkflowVisualizerSection } from './WorkflowVisualizerSection';
import { VerticalToolStackSection } from './VerticalToolStackSection';
import { MajorToolBannersSection } from './MajorToolBannersSection';
import { CinematicHorizontalScrollSection } from './CinematicHorizontalScrollSection';
import { SectionEntrance } from '@/components/ui/SectionEntrance';
interface SectionRendererProps {
section: SectionConfig;
@@ -45,7 +46,15 @@ interface SectionRendererProps {
};
}
export function SectionRenderer({ section, context }: SectionRendererProps) {
export function SectionRenderer(props: SectionRendererProps) {
return (
<SectionEntrance id={props.section.id}>
<SectionContent {...props} />
</SectionEntrance>
);
}
function SectionContent({ section, context }: SectionRendererProps) {
const locale = context.locale || 'en';
// Visibility Check (PRD §5.2, §5.3 CFG-09)
+20
View File
@@ -0,0 +1,20 @@
'use client';
import { motion, useReducedMotion } from 'framer-motion';
/** Subtle, viewport-triggered entrance shared by every JSON-driven page section. */
export function SectionEntrance({ children, id }: { children: React.ReactNode; id: string }) {
const reduceMotion = useReducedMotion();
return (
<motion.div
data-section-entrance={id}
initial={reduceMotion ? false : { opacity: 0, y: 22, filter: 'blur(5px)' }}
whileInView={{ opacity: 1, y: 0, filter: 'blur(0px)' }}
viewport={{ once: true, amount: 0.12, margin: '0px 0px -48px 0px' }}
transition={{ duration: 0.65, ease: [0.22, 1, 0.36, 1] }}
>
{children}
</motion.div>
);
}