Initial commit
This commit is contained in:
commit
cd689fde93
17 changed files with 1509 additions and 0 deletions
31
src/Components/Nav.fs
Normal file
31
src/Components/Nav.fs
Normal file
|
@ -0,0 +1,31 @@
|
|||
module DOT.Components.Nav
|
||||
|
||||
open Sutil
|
||||
open type Feliz.length
|
||||
|
||||
let view() =
|
||||
Html.div [
|
||||
Attr.style [
|
||||
Css.backgroundColor "oklch(0.2 0 0)"
|
||||
Css.displayFlex
|
||||
Css.justifyContentSpaceAround
|
||||
Css.alignItemsCenter
|
||||
Css.positionFixed
|
||||
Css.zIndex 5
|
||||
Css.top 0
|
||||
Css.height (rem 3)
|
||||
Css.width (vw 100)
|
||||
]
|
||||
|
||||
Html.div [
|
||||
Html.img [
|
||||
// TODO
|
||||
]
|
||||
]
|
||||
Html.div [
|
||||
|
||||
]
|
||||
Html.div [
|
||||
|
||||
]
|
||||
]
|
6
src/Pages/About.fs
Normal file
6
src/Pages/About.fs
Normal file
|
@ -0,0 +1,6 @@
|
|||
module DOT.Pages.About
|
||||
|
||||
open Sutil
|
||||
|
||||
let view() =
|
||||
Html.div []
|
6
src/Pages/Index.fs
Normal file
6
src/Pages/Index.fs
Normal file
|
@ -0,0 +1,6 @@
|
|||
module DOT.Pages.Index
|
||||
|
||||
open Sutil
|
||||
|
||||
let view() =
|
||||
Html.div []
|
7
src/Pages/NotFound.fs
Normal file
7
src/Pages/NotFound.fs
Normal file
|
@ -0,0 +1,7 @@
|
|||
module DOT.Pages.NotFound
|
||||
|
||||
open Sutil
|
||||
|
||||
let view() =
|
||||
Html.div []
|
||||
|
16
src/Program.fs
Normal file
16
src/Program.fs
Normal file
|
@ -0,0 +1,16 @@
|
|||
module DOT.Program
|
||||
|
||||
open DOT.Components
|
||||
open DOT.Routing
|
||||
open Sutil
|
||||
open Sutil.CoreElements
|
||||
open Sutil.Router
|
||||
|
||||
|
||||
let view() =
|
||||
fragment [
|
||||
Nav.view()
|
||||
Router.renderRouter router getHandlerFromUrl
|
||||
]
|
||||
|
||||
view() |> Program.mount
|
16
src/Routing.fs
Normal file
16
src/Routing.fs
Normal file
|
@ -0,0 +1,16 @@
|
|||
module DOT.Routing
|
||||
|
||||
open System
|
||||
open System.Reflection
|
||||
open Sutil
|
||||
open Sutil.Router
|
||||
|
||||
let router = Router.createRouter()
|
||||
let Link<'a> = Router.Link router []
|
||||
let navigate = Router.navigate router
|
||||
|
||||
let getHandlerFromUrl(url: string list) =
|
||||
match url with
|
||||
| [] -> Pages.Index.view()
|
||||
| ["about"] -> Pages.About.view()
|
||||
| _ -> Pages.NotFound.view()
|
Loading…
Add table
Add a link
Reference in a new issue