Skip to content

Commit

Permalink
css tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
abernier committed Aug 6, 2024
1 parent 0f0b1a4 commit 0ff15d0
Show file tree
Hide file tree
Showing 6 changed files with 43 additions and 30 deletions.
7 changes: 5 additions & 2 deletions apps/website/app/demos/[demoname]/Dev.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,16 @@ export function Dev({ demoname }: { demoname: string }) {
const cmd = `npm run -w demos/${demoname} dev3`;

return (
<div>
<div className="Dev">
<style
dangerouslySetInnerHTML={{
__html: `
@scope {
pre {background:rgb(13,13,13); padding:1rem; border-radius:.35rem;}
code {color:white;}
code {
color:white;
text-overflow:ellipsis; overflow:hidden; display:block;
}
code:before {content:"$ ";}
pre {
Expand Down
22 changes: 21 additions & 1 deletion apps/website/app/demos/[demoname]/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,25 @@ export default function Layout({
}>) {
// const { demoname } = params;

return <>{children}</>;
return (
<div>
<style
dangerouslySetInnerHTML={{
__html: `
@scope {
:scope {
height:100%;
display:flex; align-items:center; justify-content:center;
>.Dev {max-width:100%;}
}
.Dev {padding-inline:1rem;}
iframe {width:100%; min-height:100dvh;}
}
`,
}}
/>
{children}
</div>
);
}
17 changes: 2 additions & 15 deletions apps/website/app/demos/[demoname]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -69,25 +69,12 @@ export default async function Page(props: Props) {
// console.log("isUp=", isUp);

return (
<div>
<style
dangerouslySetInnerHTML={{
__html: `
@scope {
:scope {
height:100%;
display:flex; align-items:center; justify-content:center;
}
iframe {width:100%; min-height:100dvh;}
}
`,
}}
/>
<>
{isDev && !isUp ? (
<Dev demoname={demoname} />
) : (
<iframe src={embed_url} />
)}
</div>
</>
);
}
11 changes: 11 additions & 0 deletions apps/website/app/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,17 @@ export default function RootLayout({
main {
position:fixed; width:100%; height:100dvh;
}
.Nav {
position:fixed; bottom:0;
width:100%; overflow:auto;
@media (min-aspect-ratio:1/1) {
display:inline-block;
position:static;
}
}
}
`,
}}
Expand Down
12 changes: 2 additions & 10 deletions apps/website/components/Nav.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,27 +39,19 @@ export default function Nav({
}, [demoname, demos]);

return (
<div>
<div className="Nav">
<style
dangerouslySetInnerHTML={{
__html: `
@scope {
nav {
width:100%; overflow:auto;
position:fixed;
bottom:0;
@media (min-aspect-ratio:1/1) {
display:inline-block;
position:static;
ul {display:inline-flex; flex-direction:column;}
}
}
ul {
padding-inline-start:unset;
list-style:none;
padding-inline-start:unset; list-style:none;
padding:2rem;
display:flex; gap:1rem; position:relative;
Expand Down
4 changes: 2 additions & 2 deletions demos/aquarium/src/App.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ import turtleModel from './model_52a_-_kemps_ridley_sea_turtle_no_id-transformed

export default function App({ spheres }) {
return (
<Canvas shadows camera={{ position: [30, 0, -3], fov: 35, near: 1, far: 50 }} gl={{ stencil:true }}>
<color attach="background" args={['#c6e5db']} />
<Canvas shadows camera={{ position: [30, 0, -3], fov: 35, near: 1, far: 50 }} gl={{ stencil: true }}>
<color attach="background" args={['yellow']} />
{/** Glass aquarium */}
<Aquarium position={[0, 0.25, 0]}>
<Float rotationIntensity={2} floatIntensity={10} speed={2}>
Expand Down

0 comments on commit 0ff15d0

Please sign in to comment.