Skip to content

Commit

Permalink
Bricks: sticky 300SL
Browse files Browse the repository at this point in the history
  • Loading branch information
tmunz committed Nov 1, 2024
1 parent 1617efa commit 2a45f3f
Show file tree
Hide file tree
Showing 5 changed files with 40 additions and 30 deletions.
25 changes: 14 additions & 11 deletions src/app/content/bricks/Bricks.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ import { Mb300slContent } from './mb300sl/Mb300slContent';

const SECTIONS = [
'empty',
'',
undefined /* 300 SL 2 height*/,
undefined,
< View style={{ height: 300 }}>
<color attach="background" args={["lightblue"]} />
<ambientLight intensity={0.5} />
Expand Down Expand Up @@ -86,16 +87,18 @@ export const Bricks = () => {
}}
>
{SECTIONS.map((section, i) => {
return <section key={i} style={{ height: '100vh', overflow: 'hidden', position: 'relative' }}>{
(i === 1) ?
<>
<Mb300slContent />
<View style={{ height: '100%', width: '100vw', position: 'absolute', top: 0, left: 0 }}>
<Mb300slScroll transformations={SCROLL_STATES.mb300sl} progress={scroll} animationTrigger={[MB_300SL_TRIGGER[0] - 1 / L, MB_300SL_TRIGGER[1] + 1 / L]} />
</View>
</>
: section
}</section>
return (i === 1) ?
<section key={i} style={{ height: '200vh', overflow: 'hidden' }}>
<View style={{ width: '100vw', height: '100vh', position: 'sticky', top: 0 }}>
<Mb300slScroll transformations={SCROLL_STATES.mb300sl} progress={scroll} animationTrigger={[MB_300SL_TRIGGER[0] - 1 / L, MB_300SL_TRIGGER[1] + 1 / L]} />
</View>
{/* <Mb300slContent /> */}
</section>
:
(i === 2) ? null :
<section key={i} style={{ height: '100vh' }}>{
section
}</section>
})}

{/**************************************** overlay *******************************************/}
Expand Down
2 changes: 1 addition & 1 deletion src/app/content/bricks/brick/BrickScroll.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export function BrickScroll({ transformations, progress }: { transformations: Tr

useFrame(() => {
if (ref.current) {
transformationAnimator.apply(ref.current, progress, 0.92);
transformationAnimator.apply(ref.current, progress, 0.82, 0.92);
}
});

Expand Down
2 changes: 1 addition & 1 deletion src/app/content/bricks/mb300sl/Mb300slScroll.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,6 @@ export function Mb300slScroll({ transformations, progress, animationTrigger }: {


return (
<CarShow ref={carShowRef} Model={Mb300sl} animate={animate} quality={Quality.HIGH} controls={true} />
<CarShow ref={carShowRef} Model={Mb300sl} animate={animate} quality={Quality.HIGH} controls={false} />
);
};
Binary file not shown.
41 changes: 24 additions & 17 deletions src/assets/font/montserrat/stylesheet.css
Original file line number Diff line number Diff line change
@@ -1,20 +1,27 @@
@font-face {
font-family: 'Montserrat';
font-style: normal;
font-weight: 200;
src: url('./montserrat-v26-latin-200.woff2') format('woff2');
}
font-family: 'Montserrat';
font-style: normal;
font-weight: 200;
src: url('./montserrat-v26-latin-200.woff2') format('woff2');
}

@font-face {
font-family: 'Montserrat';
font-style: normal;
font-weight: 400;
src: url('./montserrat-v26-latin-regular.woff2') format('woff2');
}
@font-face {
font-family: 'Montserrat';
font-style: normal;
font-weight: 400;
src: url('./montserrat-v26-latin-regular.woff2') format('woff2');
}

@font-face {
font-family: 'Montserrat';
font-style: normal;
font-weight: 500;
src: url('./montserrat-v26-latin-500.woff2') format('woff2');
}

@font-face {
font-family: 'Montserrat';
font-style: normal;
font-weight: 500;
src: url('./montserrat-v26-latin-500.woff2') format('woff2');
}
@font-face {
font-family: 'Montserrat';
font-style: normal;
font-weight: 900;
src: url('./montserrat-v26-latin-900.woff2') format('woff2');
}

0 comments on commit 2a45f3f

Please sign in to comment.