https://domlink.deployments.hotsocket.fyi/
at main 38 lines 1.1 kB view raw
1import { Button, Container, Body, Node, Row, Column, Image } from "./domlink.ts"; 2import { Window } from "./windowing_mod.ts"; 3 4function webFrame(url: string) { 5 const frame = document.createElement("iframe"); 6 frame.src = url; 7 frame.style.width = "100%"; 8 frame.style.height = "100%"; 9 const controls = new Row().with( 10 "Web Frame Controls:", 11 new Button("reload", ()=>{frame.contentWindow?.location.reload();}) 12 ); 13 14 return new Column().with( 15 controls, 16 new Node(frame) 17 ).style((s)=>{ 18 s.width = "100%"; 19 s.height = "100%"; 20 }); 21} 22const userListWindow = new Window("User List").with(webFrame("./pds.html")); 23const issuesWindow = new Window("Tangled Issues").with(webFrame("./issuesearch.html")); 24const feedWindow = new Window("My Posts").with(webFrame("./main.html")); 25 26// Example usage to demonstrate the new Window class 27Body.with( 28 "you know, i really should check if adding elements normally works", 29 userListWindow, 30 issuesWindow, 31 feedWindow, 32 new Window('"native" window').with( 33 new Column().with( 34 "this doesnt have a web frame in it, but it does have a dog", 35 new Image("./media/dog.jpeg") 36 ) 37 ) 38);