Skip to content

Commit

Permalink
simplify
Browse files Browse the repository at this point in the history
  • Loading branch information
adnanwahab committed Oct 15, 2024
1 parent 89d548d commit 9c81943
Show file tree
Hide file tree
Showing 6 changed files with 85 additions and 43 deletions.
11 changes: 6 additions & 5 deletions views/odyssey/Box.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import * as d3 from "d3"

import "./demon-mirror-wall.css"
// In a Vite project, you can import non-JS/TS files like markdown using the `import.meta.glob` or similar methods.
// However, since we can't actually perform file imports here, I'll simulate this by creating a component that
// represents the readme content.

import readmeContent from '../../readme.md'; // This is how you might import in a Vite setup
//import readmeContent from '../../readme.md'; // This is how you might import in a Vite setup

function ReadmeInfo() {
return (
Expand Down Expand Up @@ -372,6 +372,7 @@ function PeriodicTable() {
function Hafu() {
<img src="/static/reflections.png" />
return <>


<div class="scene">
<div class="mirror"></div>
Expand Down Expand Up @@ -407,10 +408,10 @@ function _() {

const elements = d3.shuffle([

<PeriodicTable />,
<Hafu />,
// <PeriodicTable />,
// <Hafu />,
<BotNDolly />,
<_ />,
// <_ />,
// <ReadmeInfo />
])

Expand Down
8 changes: 4 additions & 4 deletions views/odyssey/ObservablePreview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ function ObservablePreview() {
A snapshot of your entire sales pipeline.
</h2> */}
<div
style={{ "--width": 1216, "--height": 768 }}
className="mt-16 h-[36rem] sm:h-auto sm:w-[76rem] relative aspect-[var(--width)/var(--height)] [--radius:theme(borderRadius.xl)]

className="mt-16 sm:h-auto sm:w-[76rem] relative [--radius:theme(borderRadius.xl)]
flex flex-row"
Expand All @@ -21,10 +21,10 @@ function ObservablePreview() {
className="h-full rounded-[var(--radius)] shadow-2xl ring-1 ring-black/10"
/> */}
<iframe
className="h-full w-1/3 flex-1"
className="h-screen w-1/3 flex-1"
src="http://localhost:3001"
></iframe>
<div className="h-full w-1/4 flex flex-col justify-center">
<div className="h-full w-1/4 flex flex-col justify-center border border-white/10">
<h1 className="text-blue-500">Hello</h1>
<h1 className="text-blue-500">Hello</h1>
<h1 className="text-blue-500">Hello</h1>
Expand Down
7 changes: 4 additions & 3 deletions views/odyssey/PowerPoints.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,18 @@ import reflectNotionHomage from '../../static/reflect_notion_homage.png';

function PowerPoint() {
return ([
,

<iframe
key="youtube"
width="560"
height="315"
src="https://www.youtube.com/embed/SxdOUGdseq4?si=dh0gFVybuG8m3Mgw"
title="YouTube video player"
frameBorder="0"
allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share"
allowFullScreen

></iframe>,
<iframe src="http://davidcole.me/mechanics-design.html"></iframe>,
<iframe key="mechanics-design" src="http://davidcole.me/mechanics-design.html"></iframe>,
<img

className="rainbow-ify"
Expand Down
49 changes: 20 additions & 29 deletions views/odyssey/TeleGuidance.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,10 @@ import {
import define from "https://api.observablehq.com/@roboticsuniversity/livekit.js?v=4";
import define2 from "https://api.observablehq.com/@roboticsuniversity/robotics-hardware.js?v=4";
//import define3 from "https://api.observablehq.com/@roboticsuniversity/voxels-diffusion-policy-3d.js?v=4";
import define3 from "https://api.observablehq.com/@roboticsuniversity/[email protected]?v=4";
//import define3 from "https://api.observablehq.com/@roboticsuniversity/[email protected]?v=6";

// v??? - -- adsf
import VoxelNotebook from "https://api.observablehq.com/@roboticsuniversity/[email protected]?v=4";


//import {Runtime, Inspector} from "https://cdn.jsdelivr.net/npm/@observablehq/runtime@5/dist/runtime.js";
Expand Down Expand Up @@ -48,7 +49,7 @@ function Livekit() {
useEffect(() => {
const runtime = new Runtime();
runtime.module(define, (name) => {
console.log(name);
//console.log(name);
if (name === "LOGO") return new Inspector(lOGORef.current);
});
return () => runtime.dispose();
Expand Down Expand Up @@ -88,7 +89,7 @@ function RoboticsHardware() {
const runtime = new Runtime();
runtime.module(define2, (name) => {
if (name === "LOGO") return new Inspector(viewofModuleNameRef.current);
console.log(name);
//console.log(name);
//if (name === "viewof moduleName") return new Inspector(viewofModuleNameRef.current);
return [
"basicRequire",
Expand Down Expand Up @@ -124,43 +125,33 @@ function RoboticsHardware() {

// https://files.hashirama.blog/static/blog/arm-day1.gif
function DiffusionVoxelPointCloud() {
const viewofModuleNameRef = useRef();
const viewofModuleNameRef2 = useRef();
const lOGORef = useRef();
const nOTCHRef = useRef();

useEffect(() => {
const runtime = new Runtime();
runtime.module(define3, (name) => {
//if (name === "viewof moduleName") return new Inspector(viewofModuleNameRef.current);
//if (name === "NOTCH") return new Inspector(viewofModuleNameRef.current);
if (name === "LOGO") return new Inspector(viewofModuleNameRef2.current);
return [
"basicRequire",
"dynamicImport",
"skypackImport",
"bundleRun",
"scavengingForLinks",
"globalLeaksPattern",
"pkg",
].includes(name);
runtime.module(VoxelNotebook, name => {
if (name === "LOGO") return new Inspector(lOGORef.current);
if (name === "NOTCH") return new Inspector(nOTCHRef.current);
});
return () => runtime.dispose();
}, []);


//return <></>
return (
<>
<div ref={viewofModuleNameRef} />
<p className="text-green-100">
Credit:{" "}
<a href="https://observablehq.com/@observablehq/module-require-debugger">
LIVE KIT = WEBRTC = GREAT
</a>
</p>
<VoxelPainter />
<div ref={lOGORef} />
<div ref={nOTCHRef} />
{/* <p>Credit: <a href="https://observablehq.com/@roboticsuniversity/voxels-diffusion-policy-3d@88">Voxels + diffusion-policy-3d by roboticsuniversity</a></p> */}
</>


);

// https://files.hashirama.blog/static/blog/animated_gifs/Animated%20GIF%20optimizer.gif
}



// https://files.hashirama.blog/static/blog/seeing/cropped_image_0.png
// https://files.hashirama.blog/static/blog/animated_gifs/Optimized%20%281%29.gif
// https://files.hashirama.blog/static/blog/animated_gifs/samus.jpeg
Expand All @@ -182,7 +173,7 @@ function TeleGuidance() {
<Livekit />
</div>
<div className="lg:col-span-2 flex flex-col rounded-lg bg-gray-800 overflow-hidden" style={{ maxHeight: '50vh' }}>
{/* <TwitchPlaysPokemonPanel/> */}
<TwitchPlaysPokemonPanel/>
</div>
<div className="lg:col-span-2 flex flex-col rounded-lg bg-gray-800 overflow-hidden" style={{ maxHeight: '50vh' }}>
<RoboticsHardware />
Expand Down
44 changes: 44 additions & 0 deletions views/odyssey/demon-mirror-wall.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@

.hafu {
margin: 0;
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
background: #222;
perspective: 1000px;
}

.scene {
width: 300px;
height: 300px;
position: relative;
transform-style: preserve-3d;
animation: rotate 10s infinite linear;
}

.mirror {
width: 100px;
height: 150px;
position: absolute;
background: linear-gradient(45deg, rgba(255,255,255,0.8), rgba(0,0,0,0.2));
border: 2px solid rgba(255, 255, 255, 0.3);
transform-origin: center;
box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
}

/* Positioning mirrors in a 3D grid */
.mirror:nth-child(1) { transform: rotateY(0deg) translateZ(150px); }
.mirror:nth-child(2) { transform: rotateY(45deg) translateZ(150px); }
.mirror:nth-child(3) { transform: rotateY(90deg) translateZ(150px); }
.mirror:nth-child(4) { transform: rotateY(135deg) translateZ(150px); }
.mirror:nth-child(5) { transform: rotateY(180deg) translateZ(150px); }
.mirror:nth-child(6) { transform: rotateY(225deg) translateZ(150px); }
.mirror:nth-child(7) { transform: rotateY(270deg) translateZ(150px); }
.mirror:nth-child(8) { transform: rotateY(315deg) translateZ(150px); }

@keyframes rotate {
from { transform: rotateY(0deg); }
to { transform: rotateY(360deg); }
}

9 changes: 7 additions & 2 deletions views/odyssey/robotics-odyssey.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import TwitchPlaysPokemonPanel from "./TwitchPlaysPokemonPanel";
import TeleGuidance from "./TeleGuidance";
import DynamicHow from "./Dynamichow";
import PowerPoint from "./PowerPoints";
import Box from "./Box";

function RoboticsOdyssey() {
return (
Expand All @@ -23,14 +24,18 @@ function RoboticsOdyssey() {
<TeleGuidance />{" "}
</div>
<div className="border border-white/10">
{" "}
<ObservablePreview></ObservablePreview>{" "}

{/* <ObservablePreview></ObservablePreview>{" "} */}



</div>
<div className="border border-white/10">
{" "}
<DynamicHow />{" "}
</div>
<PowerPoint />
<Box />
<Footer />
</main>
</div>
Expand Down

0 comments on commit 9c81943

Please sign in to comment.