-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
9293533
commit 6f556f7
Showing
10 changed files
with
111 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
// globalThis.S=SPA({ | ||
// target : document.querySelector("#app"), | ||
// wrapper : Section().style({ | ||
// display : "flex", | ||
// justifyContent: "center", | ||
// alignItems : "center", | ||
// height : "100vh" | ||
// }), | ||
// routes:{ | ||
// "/":()=>text("Hello world"), | ||
// "/id/:id":async ({id})=>{ | ||
// let resp = await fetch(`https://jsonplaceholder.typicode.com/todos/${id}`) | ||
// let data = await resp.json() | ||
// return Flex( | ||
// text(data.title) | ||
// ) | ||
// }, | ||
// "/users/:user":async ({user})=>{ | ||
// let resp = await fetch(`https://api.github.com/users/${user}`) | ||
// const {name,followers,public_repos, avatar_url}= await resp.json() | ||
// // console.log({name, followers, public_repos, avatar_url}) | ||
// useTitle(name) | ||
// useFavIcon(avatar_url) | ||
// const Card = Flex( | ||
// text(name).style({ | ||
// color : "darkblue", | ||
// fontSize : "1.4rem", | ||
// border : "2px darkblue solid", | ||
// padding : "10px", | ||
// background:"tomato" | ||
// }), | ||
// image(avatar_url).size("200px","auto").style({outline : "2px darkblue solid"}), | ||
// Flex( | ||
// text(`N° followers : ${followers}`), | ||
// text(`N° repos : ${public_repos}`) | ||
// ).horizontal("space-around",0).size("80%","auto").style({ | ||
// color : "darkblue", | ||
// border : "2px darkblue solid", | ||
// padding : "10px", | ||
// background:"tomato" | ||
// }) | ||
// ).size("400px","400px").vertical(0,"space-around").style({ | ||
// border : "2px darkblue solid", | ||
// background : "coral" | ||
// }) | ||
// return Card | ||
// }, | ||
// } | ||
// }) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,2 @@ | ||
import {Section,SPA, text} from "ziko" | ||
__Ziko__.__Config__.default.target = document.body | ||
const main=Section() | ||
const p1=Section() | ||
const p2=Section() | ||
let S=SPA( | ||
main,{ | ||
"/":text("Hi"), | ||
"/page1":text("p1"), | ||
"/page2":text("p2") | ||
}) | ||
import { FileBasedRouting } from "ziko"; | ||
FileBasedRouting(import.meta.glob('./src/pages/**/*.js')) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
export default ({blog,lang})=>{ | ||
console.log({blog,lang}) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
export default (params)=>{ | ||
console.log(params) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import { p } from "ziko" | ||
export default ()=>{ | ||
return p("About ").style({ | ||
color:"red", | ||
}) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import { text } from "ziko"; | ||
export default ({data,color})=>{ | ||
return text(data).style({ | ||
color : color | ||
}) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import { p } from "ziko" | ||
export default ()=>{ | ||
return p("Bla bla bla ").style({ | ||
color:"red", | ||
}) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import { p,App,Flex } from "ziko" | ||
|
||
const {QueryParams} = __Ziko__ | ||
export default ()=>{ | ||
return App({ | ||
head : { | ||
title : "ziko", | ||
}, | ||
wrapper : ()=>Flex(p("Hello world").style({ | ||
color : QueryParams.color ?? "black" | ||
})).size("100vw","100vh").vertical(0,0) | ||
}) | ||
} | ||
document.body.style.overflow = "hidden" | ||
// export default ()=>{ | ||
// return p("Hello from zikojs File based routing ").style({ | ||
// color:"red", | ||
// fontFamily : "Gloria Hallelujah" | ||
// }) | ||
// } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
export default ()=>{ | ||
console.log("me") | ||
} |