1module Container.Landing where
5import Button.Component (ButtonType(..), mkButton)
6import CSS.Safer (cssSafer)
7import Data.Foldable (for_)
8import Data.Nullable (null)
10import Effect.Uncurried (runEffectFn1)
11import React.Basic.DOM as R
12import React.Basic.Events (handler_)
13import React.Basic.Hooks (ReactComponent, component, element, readRefMaybe, useRef)
14import React.Basic.Hooks as React
15import SVG.Icon (trianglelogoIcon)
16import SVG.Image (mkLandingPageBackground)
17import Scroll.Hook (useScrollYPosition)
18import Theme.Styles (makeStyles, useTheme)
19import Theme.Types (CSSTheme)
20import Typography.Header (mkH)
21import Unsafe.Coerce (unsafeCoerce)
22import Web.HTML (window)
23import Web.HTML.HTMLElement (getBoundingClientRect)
24import Web.HTML.HTMLElement as HTMLElement
26mkLandingPage ∷ Effect (ReactComponent {})
29 makeStyles \(theme ∷ CSSTheme) ->
38 { position: "absolute"
47 , flexDirection: "row"
49 , justifyContent: "center"
50 , alignItems: "space-around"
54 { fill: theme.textColour
79 { position: "absolute"
86 backgroundImage <- mkLandingPageBackground
87 component "LandingPage" \{ } -> React.do
91 scrollY <- useScrollYPosition
95 , className: classes.landing
97 [ element backgroundImage { className: classes.landingImage }
99 { className: classes.textLayer
102 { className: classes.topBar
103 , children: [ element trianglelogoIcon { className: classes.logo } ]
105 , R.div { className: classes.welcomeText, children: [ R.text welcomeText ] }
106 , R.div { className: classes.welcomeCopy, children: [ R.text copyText ] }
108 { className: classes.actionButton
112 { onClick: handler_ do
113 maybeNode <- readRefMaybe ref
114 for_ (maybeNode >>= HTMLElement.fromNode) \n -> do
115 height <- getBoundingClientRect n <#> _.height
117 runEffectFn1 ((unsafeCoerce win).scrollTo)
118 { top: height, left: 0, behavior: "smooth"}
120 , buttonType: HighlightedButton
121 , children: [ R.text buttonText ]
131welcomeText = "Enter the college of Kleisli"
134copyText = "Learn how to tame and harness the compiler, whether you're a λ or a Λ"
137buttonText = "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