Skip to content

Commit 954e6b6

Browse files
author
adnan wahab
committed
yay
1 parent 2be6358 commit 954e6b6

File tree

5 files changed

+83
-87
lines changed

5 files changed

+83
-87
lines changed

web-ui/my-app/src/index.ts

+18-36
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,11 @@ app.all('/llama-tools', (c) => {
2424
return c.html(utils.llama_);
2525
})
2626

27+
app.all('/dynamcicland_cognition_egnine', (c) => {
28+
29+
return c.html('soroy totodo --- see everything you like - everything there is to know - ---- -research papers and the itnerstections between them and things that could use implementation because if you see it in 4-5 different ways -then its easier to make cool stuff. () venn daigrams of ff 2 papeprs ---- -goododoogo ??? i ithoenkfla skdfnao');
30+
})
31+
2732
app.all('/iframe/*', (c) => {
2833
let basename = c.req.path.split('/').pop()
2934
console.log('basename', basename)
@@ -47,19 +52,7 @@ app.all('/_/DynamicHow.tsx', async (c) => {
4752
})
4853

4954
app.all('/', async (c) => {
50-
return c.html(`<div>
51-
<h1> hono index </h1>
52-
<div><a href="/odyssey">Robotics Odyssey</a></div>
53-
<div><a href="/llama-tools">llamatools</a></div>
54-
<div><a href="/blag">blag</a></div>
55-
56-
<div>
57-
<li> add magic iframe -- htmx + some observable links --- grid %s
58-
<li> auto refresh like vite
59-
<li> add livekit screenshare
60-
holman
61-
</div>
62-
</div>`)
55+
return c.html(utills.indexPage)
6356
})
6457

6558
app.all('/livekit_screenshare', async (c) => {
@@ -73,36 +66,25 @@ app.all('/views/*', async (c) => {
7366
const html = fs.readFileSync('src/'+c.req.path, 'utf8')
7467
return c.html(html)
7568
})
69+
app.post('/livekit_connect', utils.livekit_connect);
7670

7771
// app.get('/api/replay_analyzer', (c) => c.json({'Pretty Blog API': 1}));
7872
console.log('app', 'hono', Date.now())
7973

8074
//app.fire()
8175
export default app
82-
83-
84-
85-
app.post('/livekit_connect', async (c) => {
86-
console.log('livekit_connect');
87-
88-
// Identity creation with timestamp to avoid conflicts
89-
const jsonData = { identity: 'voice to prompt?' + Date.now() };
90-
const identity = jsonData.identity;
91-
92-
if (!identity) {
93-
return c.text("Identity parameter is missing", 400);
94-
}
95-
96-
// Connecting to LiveKit
97-
const json = await utils.connect_to_livekit(jsonData);
98-
console.log('Generated token and wsUrl:', json);
99-
100-
return c.json(json);
101-
});
102-
10376
//3d css react tw
104-
10577
//app.get('/blag', (c) => c.json({'Pretty Blog API': 1}));
10678
//app.get('/blag-archive', (c) => c.json({'Pretty Blog API': 1}));
10779
//app.get('/api/magic_llama', (c) => c.json({'Pretty Blog API': 1}));
108-
//app.get('/api/measure_magic_llama', (c) => c.json({'Pretty Blog API': 1}))
80+
//app.get('/api/measure_magic_llama', (c) => c.json({'Pretty Blog API': 1}))
81+
82+
app.all('/iframe_observablbehq', async (c) => {
83+
const response = await fetch('http://127.0.0.1:3001' + c.req.path, {
84+
method: c.req.method,
85+
headers: c.req.headers,
86+
body: c.req.method === 'POST' ? await c.req.text() : null,
87+
});
88+
const data = await response.text();
89+
return c.html(data);
90+
})

web-ui/my-app/src/odysssey/ObservablePreview.tsx

+6-44
Original file line numberDiff line numberDiff line change
@@ -3,55 +3,17 @@ import React from "react";
33
function ObservablePreview() {
44
return (
55
<div className="overflow-hidden" style={{height: "50vh"}}>
6-
<iframe className="h-full w-full" src="http://localhost:3000"></iframe>
7-
8-
{/* <div className="pb-24 px-6 lg:px-8">
9-
<div className="mx-auto max-w-2xl lg:max-w-7xl"> */}
10-
{/* <h2 className="max-w-3xl text-pretty text-4xl font-medium tracking-tighter text-gray-950 data-[dark]:text-white sm:text-6xl">
11-
A snapshot of your entire sales pipeline.
12-
</h2> */}
13-
{/* <div
14-
className="sm:h-auto sm:w-[76rem] relative [--radius:theme(borderRadius.xl)]
15-
16-
17-
flex flex-row"
18-
> */}
6+
<h1 className="text-2xl text-blue-200 font-bold">Observable Preview</h1>
7+
198
<iframe
209
className="h-full w-full"
21-
src="http://127.0.0.1:3000"
10+
src="/iframe_observable"
2211
></iframe>
23-
24-
25-
26-
27-
28-
{/* <iframe
29-
className="h-screen w-1/2 flex-1"
30-
src="/public/dist/index.html"
31-
></iframe> */}
32-
{/* <img
33-
alt=""
34-
src="https://radiant.tailwindui.com/screenshots/app.png"
35-
className="h-full rounded-[var(--radius)] shadow-2xl ring-1 ring-black/10"
36-
/> */}
37-
38-
{/* <div className="h-full w-1/4 flex flex-col justify-center border border-white/10">
39-
<h1 className="text-blue-500">Hello</h1>
40-
<h1 className="text-blue-500">Hello</h1>
41-
<h1 className="text-blue-500">Hello</h1>
42-
<h1 className="text-blue-500">Hello</h1>
43-
<h1 className="text-blue-500">Hello</h1>
44-
<h1 className="text-blue-500">Hello</h1>
45-
<h1 className="text-blue-500">Hello</h1>
46-
<h1 className="text-blue-500">Hello</h1>
47-
48-
</div> */}
49-
50-
{/* </div> */}
51-
{/* </div>*/}
52-
{/* </div> */}
5312
</div>
5413
);
14+
// https://threejs.org/examples/?q=cloth#physics_ammo_cloth
15+
// https://tailwindcss.com/docs/mix-blend-mode
16+
// https://jsfiddle.net/qLcfnm2z/7/
5517
}
5618

5719
export default ObservablePreview;

web-ui/my-app/src/robotics-odyssey.tsx

+18-4
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,31 @@ const OdysseyIntro = function () {}
44
import Footer from "../views/Footer.js";
55
import Sisterschools from "../views/sisterschools.js";
66
import _ from 'https://esm.sh/lodash';
7+
8+
9+
10+
11+
function LLama_Grid_cell ({src, title}: {src: string, title: string}) {
12+
return <>
13+
<h1 className="text-2xl text-blue-200 font-bold">{title}</h1>
14+
<iframe width="100%" height="736" frameborder="0"
15+
src={src}></iframe>
16+
</>
17+
}
18+
19+
720
function RoboticsOdyssey() {
821
return (
922
<div className="dark">
1023
{/* <Header /> */}
1124
<div className="text-gray-950 antialiased bg-slate-900">
1225
<div className="overflow-hidden flex justify-center items-center min-h-screen">
1326
<main>
14-
<iframe src="/_/OdysseyIntro.tsx" className="border-2 border-red-500 w-full h-full"></iframe>
15-
<iframe src="/_/TeleGuidance.tsx" className="border-2 border-red-500 w-full h-full"></iframe>
16-
<iframe src="/_/ObservablePreview.tsx" className="border-2 border-red-500 w-full h-full"></iframe>
17-
<iframe src="/_/DynamicHow.tsx" className="border-2 border-red-500 w-full h-full"></iframe>
27+
<LLama_Grid_cell title="1. Perception" src="https://observablehq.com/embed/@roboticsuniversity/perception@102?cells=andrew_ng"/>
28+
<LLama_Grid_cell title="2. Predcition and Planning" src="https://observablehq.com/embed/@roboticsuniversity/3-planning-prediction@84?cells=paper" />
29+
<LLama_Grid_cell title="3. Simulation" src="https://observablehq.com/embed/@roboticsuniversity/voxels-diffusion-policy-3d?cells=LOGO%2CNOTCH" />
30+
<LLama_Grid_cell title="4. Alan How" src="https://observablehq.com/embed/@roboticsuniversity/alan_how?cells=Complex_Systems" />
31+
<LLama_Grid_cell title="5. Dynamicland" src="https://observablehq.com/embed/@roboticsuniversity/dynamicland@83?cells=magic_cube%2Cladder_%2CSeeing_space" />
1832
<Sisterschools />
1933
<Footer />
2034
{/* <Hardware_Picker></Hardware_Picker> */}

web-ui/my-app/src/utils.ts

+33-1
Original file line numberDiff line numberDiff line change
@@ -158,4 +158,36 @@ export const llama_ = `
158158
</div>
159159
</body>
160160
</html>
161-
`
161+
`
162+
163+
export const indexPage = `<div>
164+
<h1> hono index </h1>
165+
<div><a href="/odyssey">Robotics Odyssey</a></div>
166+
<div><a href="/llama-tools">llamatools</a></div>
167+
<div><a href="/blag">blag</a></div>
168+
169+
<div>
170+
<li> add magic iframe -- htmx + some observable links --- grid %s
171+
<li> auto refresh like vite
172+
<li> add livekit screenshare
173+
holman
174+
</div>
175+
</div>`
176+
177+
export const livekit_connect = async (c) => {
178+
console.log('livekit_connect');
179+
180+
// Identity creation with timestamp to avoid conflicts
181+
const jsonData = { identity: 'voice to prompt?' + Date.now() };
182+
const identity = jsonData.identity;
183+
184+
if (!identity) {
185+
return c.text("Identity parameter is missing", 400);
186+
}
187+
188+
// Connecting to LiveKit
189+
const json = await connect_to_livekit(jsonData);
190+
console.log('Generated token and wsUrl:', json);
191+
192+
return c.json(json);
193+
}

web-ui/my-app/views/Footer.tsx

+8-2
Original file line numberDiff line numberDiff line change
@@ -198,13 +198,19 @@ const navigation = {
198198
],
199199
};
200200

201+
// sometimes its okay to go against the grain - as long as you dont go against the life of another
202+
//if you affect the life of another, you have to be more careful
203+
// a good way to be more careful is to get 100% agreement of all liviing beings --- or close to it.
204+
// if you can get 100% agreement, you can do anything.
205+
//but 100% should also be backed by repeatable evidence, annd reasoning why ---- why is good. cause and effect is friend. c
206+
201207
export default function Example() {
202208
return (
203209
<footer aria-labelledby="footer-heading" className="bg-gray-900">
204210
<h2 id="footer-heading" className="sr-only">
205211
Footer
206212
</h2>
207-
<div className="mx-auto max-w-7xl px-6 pb-8 pt-20 sm:pt-24 lg:px-8 lg:pt-32">
213+
<div className="mx-auto max-w-7xl px-6 pb-8 lg:px-8 ">
208214
<div className="xl:grid xl:grid-cols-3 xl:gap-8">
209215
<div className="grid grid-cols-2 gap-8 xl:col-span-2 hidden">
210216
<div className="md:grid md:grid-cols-2 md:gap-8">
@@ -280,7 +286,7 @@ export default function Example() {
280286

281287
</div>
282288
</div>
283-
<div className="border-t border-white/10 pt-8 sm:mt-20 md:flex md:items-center md:justify-between lg:mt-24">
289+
<div className="border-t border-white/10 pt-8 md:flex md:items-center md:justify-between">
284290
<div className="flex space-x-6 md:order-2">
285291
{navigation.social.map((item) => (
286292
<a

0 commit comments

Comments
 (0)