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
78 { position: "absolute"
85 backgroundImage <- mkLandingPageBackground
86 component "LandingPage" \{} -> React.do
90 scrollY <- useScrollYPosition
94 , className: classes.landing
96 [ element backgroundImage { className: classes.landingImage }
98 { className: classes.textLayer
101 { className: classes.topBar
102 , children: [ element trianglelogoIcon { className: classes.logo } ]
104 , R.div { className: classes.welcomeText, children: [ R.text welcomeText ] }
105 , R.div { className: classes.welcomeCopy, children: [ R.text copyText ] }
107 { className: classes.actionButton
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 , kids: [ 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