1module Container.Landing where
4import Button.Component (ButtonType(..), mkButton)
5import CSS.Safer (cssSafer)
6import Data.Foldable (for_)
7import Data.Nullable (null)
9import Effect.Uncurried (runEffectFn1)
10import React.Basic.DOM as R
11import React.Basic.Events (handler_)
12import React.Basic.Hooks (ReactComponent, component, element, readRefMaybe, useRef)
13import React.Basic.Hooks as React
14import SVG.Icon (trianglelogoIcon)
15import SVG.Image (mkLandingPageBackground)
16import Scroll.Hook (useScrollYPosition)
17import Theme.Styles (makeStyles, useTheme)
18import Theme.Types (CSSTheme)
19import Typography.Header (mkH)
20import Unsafe.Coerce (unsafeCoerce)
21import Web.HTML (window)
22import Web.HTML.HTMLElement (getBoundingClientRect)
23import Web.HTML.HTMLElement as HTMLElement
25mkLandingPage ∷ Effect (ReactComponent {})
28 makeStyles \(theme ∷ CSSTheme) ->
37 { position: "absolute"
46 , flexDirection: "row"
48 , justifyContent: "center"
49 , alignItems: "space-around"
53 { fill: theme.textColour
79 , paddingRight: "10px"
83 { position: "absolute"
90 backgroundImage <- mkLandingPageBackground
91 component "LandingPage" \{} -> React.do
95 scrollY <- useScrollYPosition
99 , className: classes.landing
101 [ element backgroundImage { className: classes.landingImage }
103 { className: classes.textLayer
106 { className: classes.topBar
107 , children: [ element trianglelogoIcon { className: classes.logo } ]
109 , R.div { className: classes.welcomeText, children: [ R.text welcomeText ] }
110 , R.div { className: classes.welcomeCopy, children: [ R.text copyText ] }
112 { className: classes.actionButton
118 maybeNode <- readRefMaybe ref
119 for_ (maybeNode >>= HTMLElement.fromNode) \n -> do
120 height <- getBoundingClientRect n <#> _.height
122 runEffectFn1 ((unsafeCoerce win).scrollTo)
123 { top: height, left: 0, behavior: "smooth" }
125 , buttonType: HighlightedButton
126 , kids: [ R.text buttonText ]
127 , className: classes.actualActionButton
137welcomeText = "Enter the college of Kleisli"
140copyText = "Learn how to tame and harness the compiler, whether you're a λ or a Λ"
143buttonText = "I can't wait, let's go!"
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list