forked from rajun/ar-test
refactor: move armchair illustration into the login showcase
This commit is contained in:
parent
3bfbf344a6
commit
d75e0ba1c8
@ -1,43 +0,0 @@
|
|||||||
// SVG armchair drawn in the coordinate space of <ArIllustration>; relies on its gradient/filter defs.
|
|
||||||
export function Armchair() {
|
|
||||||
return (
|
|
||||||
<g>
|
|
||||||
{/* Contact shadow */}
|
|
||||||
<ellipse cx="200" cy="324" rx="68" ry="11" fill="black" opacity="0.55" filter="url(#ar-blur)" />
|
|
||||||
|
|
||||||
{/* Back legs */}
|
|
||||||
<path d="M168 286 L173 286 L171 308 L168 308 Z" fill="url(#chair-wood)" />
|
|
||||||
<path d="M227 286 L232 286 L232 308 L229 308 Z" fill="url(#chair-wood)" />
|
|
||||||
|
|
||||||
{/* Backrest */}
|
|
||||||
<path d="M156 264 C150 222 158 192 176 182 C190 175 210 175 224 182 C242 192 250 222 244 264 Z" fill="url(#chair-back)" />
|
|
||||||
<path d="M166 256 C162 222 168 199 182 191 C194 186 206 186 218 191 C232 199 238 222 234 256 Z" fill="url(#chair-back-inner)" />
|
|
||||||
<path d="M176 186 C190 179 210 179 224 186" fill="none" stroke="#fed7aa" strokeOpacity="0.45" strokeWidth="1.5" strokeLinecap="round" />
|
|
||||||
{/* Tufting */}
|
|
||||||
<g fill="#7c2d12">
|
|
||||||
{[[184, 210], [200, 206], [216, 210], [192, 230], [208, 230]].map(([cx, cy]) => (
|
|
||||||
<circle key={`${cx}-${cy}`} cx={cx} cy={cy} r="1.8" />
|
|
||||||
))}
|
|
||||||
</g>
|
|
||||||
<g fill="none" stroke="#7c2d12" strokeOpacity="0.35" strokeWidth="0.8">
|
|
||||||
<path d="M184 210 L192 230 L200 206 L208 230 L216 210" />
|
|
||||||
</g>
|
|
||||||
|
|
||||||
{/* Seat base */}
|
|
||||||
<path d="M152 280 C175 290 225 290 248 280 L248 298 C225 308 175 308 152 298 Z" fill="url(#chair-base)" />
|
|
||||||
{/* Seat cushion */}
|
|
||||||
<path d="M154 276 C160 262 240 262 246 276 C246 286 224 292 200 292 C176 292 154 286 154 276 Z" fill="url(#chair-cushion)" />
|
|
||||||
<ellipse cx="200" cy="270" rx="30" ry="3.5" fill="white" opacity="0.2" />
|
|
||||||
|
|
||||||
{/* Armrests */}
|
|
||||||
<path d="M140 300 C136 270 138 248 150 238 C158 232 168 236 168 246 L168 296 Z" fill="url(#chair-arm-left)" />
|
|
||||||
<path d="M260 300 C264 270 262 248 250 238 C242 232 232 236 232 246 L232 296 Z" fill="url(#chair-arm-right)" />
|
|
||||||
<path d="M150 238 C158 232 168 236 168 246" fill="none" stroke="#fed7aa" strokeOpacity="0.5" strokeWidth="1.5" strokeLinecap="round" />
|
|
||||||
<path d="M250 238 C242 232 232 236 232 246" fill="none" stroke="#fed7aa" strokeOpacity="0.35" strokeWidth="1.5" strokeLinecap="round" />
|
|
||||||
|
|
||||||
{/* Front legs */}
|
|
||||||
<path d="M159 299 L166 299 L163 326 L160 326 Z" fill="url(#chair-wood)" />
|
|
||||||
<path d="M234 299 L241 299 L241 326 L238 326 Z" fill="url(#chair-wood)" />
|
|
||||||
</g>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
68
app/components/auth/showcase/armchair.tsx
Normal file
68
app/components/auth/showcase/armchair.tsx
Normal file
@ -0,0 +1,68 @@
|
|||||||
|
import { useId } from 'react';
|
||||||
|
|
||||||
|
// Gradient direction (x2, y2) and colour stops, spread evenly
|
||||||
|
const GRADIENTS = {
|
||||||
|
back: { x2: 1, y2: 1, stops: ['accent-400', 'accent-700', 'accent-900'] },
|
||||||
|
backInner: { x2: 0, y2: 1, stops: ['primary', 'accent-800'] },
|
||||||
|
cushion: { x2: 0, y2: 1, stops: ['accent-300', 'accent-600'] },
|
||||||
|
base: { x2: 0, y2: 1, stops: ['accent-700', 'accent-900'] },
|
||||||
|
armLeft: { x2: 1, y2: 0, stops: ['accent-800', 'accent-600'] },
|
||||||
|
armRight: { x2: 1, y2: 0, stops: ['primary', 'accent-800'] },
|
||||||
|
wood: { x2: 0, y2: 1, stops: ['wood-light', 'wood-dark'] },
|
||||||
|
} as const;
|
||||||
|
|
||||||
|
const TUFTS = [[184, 210], [200, 206], [216, 210], [192, 230], [208, 230]] as const;
|
||||||
|
|
||||||
|
// An orange armchair, the stand-in 3D model in the login story. Its contact shadow sits at 86% of the height;
|
||||||
|
// the view box leaves room around it so the blur isn't clipped.
|
||||||
|
export function Armchair({ className }: { className?: string }) {
|
||||||
|
const id = useId();
|
||||||
|
const fill = (name: keyof typeof GRADIENTS) => `url(#${id}${name})`;
|
||||||
|
|
||||||
|
return (
|
||||||
|
<svg viewBox='115 165 170 185' className={className} aria-hidden='true'>
|
||||||
|
<defs>
|
||||||
|
{Object.entries(GRADIENTS).map(([name, { x2, y2, stops }]) => (
|
||||||
|
<linearGradient key={name} id={`${id}${name}`} x1='0' y1='0' x2={x2} y2={y2}>
|
||||||
|
{stops.map((color, i) => (
|
||||||
|
<stop key={color} offset={i / (stops.length - 1)} stopColor={`var(--color-${color})`} />
|
||||||
|
))}
|
||||||
|
</linearGradient>
|
||||||
|
))}
|
||||||
|
<filter id={`${id}blur`} x='-50%' y='-50%' width='200%' height='200%'>
|
||||||
|
<feGaussianBlur stdDeviation='5' />
|
||||||
|
</filter>
|
||||||
|
</defs>
|
||||||
|
|
||||||
|
<ellipse cx='200' cy='324' rx='68' ry='11' fill='var(--color-shadow)' opacity='0.55' filter={`url(#${id}blur)`} />
|
||||||
|
|
||||||
|
{/* Back legs */}
|
||||||
|
<path d='M168 286 L173 286 L171 308 L168 308 Z' fill={fill('wood')} />
|
||||||
|
<path d='M227 286 L232 286 L232 308 L229 308 Z' fill={fill('wood')} />
|
||||||
|
|
||||||
|
{/* Backrest with tufting */}
|
||||||
|
<path d='M156 264 C150 222 158 192 176 182 C190 175 210 175 224 182 C242 192 250 222 244 264 Z' fill={fill('back')} />
|
||||||
|
<path d='M166 256 C162 222 168 199 182 191 C194 186 206 186 218 191 C232 199 238 222 234 256 Z' fill={fill('backInner')} />
|
||||||
|
<path d='M176 186 C190 179 210 179 224 186' fill='none' stroke='var(--color-accent-200)' strokeOpacity='0.45' strokeWidth='1.5' strokeLinecap='round' />
|
||||||
|
<path d='M184 210 L192 230 L200 206 L208 230 L216 210' fill='none' stroke='var(--color-accent-900)' strokeOpacity='0.35' strokeWidth='0.8' />
|
||||||
|
{TUFTS.map(([cx, cy]) => (
|
||||||
|
<circle key={`${cx}-${cy}`} cx={cx} cy={cy} r='1.8' fill='var(--color-accent-900)' />
|
||||||
|
))}
|
||||||
|
|
||||||
|
{/* Seat */}
|
||||||
|
<path d='M152 280 C175 290 225 290 248 280 L248 298 C225 308 175 308 152 298 Z' fill={fill('base')} />
|
||||||
|
<path d='M154 276 C160 262 240 262 246 276 C246 286 224 292 200 292 C176 292 154 286 154 276 Z' fill={fill('cushion')} />
|
||||||
|
<ellipse cx='200' cy='270' rx='30' ry='3.5' fill='var(--color-primary-foreground)' opacity='0.2' />
|
||||||
|
|
||||||
|
{/* Armrests */}
|
||||||
|
<path d='M140 300 C136 270 138 248 150 238 C158 232 168 236 168 246 L168 296 Z' fill={fill('armLeft')} />
|
||||||
|
<path d='M260 300 C264 270 262 248 250 238 C242 232 232 236 232 246 L232 296 Z' fill={fill('armRight')} />
|
||||||
|
<path d='M150 238 C158 232 168 236 168 246' fill='none' stroke='var(--color-accent-200)' strokeOpacity='0.5' strokeWidth='1.5' strokeLinecap='round' />
|
||||||
|
<path d='M250 238 C242 232 232 236 232 246' fill='none' stroke='var(--color-accent-200)' strokeOpacity='0.35' strokeWidth='1.5' strokeLinecap='round' />
|
||||||
|
|
||||||
|
{/* Front legs */}
|
||||||
|
<path d='M159 299 L166 299 L163 326 L160 326 Z' fill={fill('wood')} />
|
||||||
|
<path d='M234 299 L241 299 L241 326 L238 326 Z' fill={fill('wood')} />
|
||||||
|
</svg>
|
||||||
|
);
|
||||||
|
}
|
||||||
Loading…
x
Reference in New Issue
Block a user