1module Container.Landing where
4import Data.Foldable (for_)
5import Data.Nullable (null)
7import Effect.Uncurried (runEffectFn1)
8import JSS (jss, jssClasses)
9import React.Basic.DOM as R
10import React.Basic.Events (handler_)
11import React.Basic.Hooks (ReactComponent, component, element, readRefMaybe, useRef)
12import React.Basic.Hooks as React
13import Unsafe.Coerce (unsafeCoerce)
14import Web.HTML (window)
15import Web.HTML.HTMLElement (getBoundingClientRect)
16import Web.HTML.HTMLElement as HTMLElement
17import Yoga.Button.Component (ButtonType(..), mkButton)
18import Yoga.SVG.Icon (trianglelogoIcon)
19import Yoga.SVG.Image (mkLandingPageBackground)
20import Yoga.Scroll.Hook (useScrollYPosition)
21import Yoga.Theme.Styles (makeStylesJSS, useTheme)
22import Yoga.Theme.Types (CSSTheme)
23import Yoga.Typography.Header (mkH)
25mkLandingPage ∷ Effect (ReactComponent {})
29 $ jssClasses \(theme ∷ CSSTheme) ->
38 { position: "absolute"
47 , flexDirection: "row"
49 , justifyContent: "center"
50 , alignItems: "space-around"
54 { fill: theme.textColour
80 , paddingRight: "10px"
84 { position: "absolute"
91 backgroundImage <- mkLandingPageBackground
92 component "LandingPage" \{} -> React.do
93 classes <- useStyles {}
96 scrollY <- useScrollYPosition
100 , className: classes.landing
102 [ element backgroundImage { className: classes.landingImage }
104 { className: classes.textLayer
107 { className: classes.topBar
108 , children: [ element trianglelogoIcon { className: classes.logo } ]
110 , R.div { className: classes.welcomeText, children: [ R.text welcomeText ] }
111 , R.div { className: classes.welcomeCopy, children: [ R.text copyText ] }
113 { className: classes.actionButton
119 maybeNode <- readRefMaybe ref
120 for_ (maybeNode >>= HTMLElement.fromNode) \n -> do
121 height <- getBoundingClientRect n <#> _.height
123 runEffectFn1 ((unsafeCoerce win).scrollTo)
124 { top: height, left: 0, behavior: "smooth" }
126 , buttonType: HighlightedButton
127 , kids: [ R.text buttonText ]
128 , className: classes.actualActionButton
138welcomeText = "Enter the college of Kleisli"
141copyText = "Learn how to tame and harness the compiler, whether you're a λ or a Λ"
144buttonText = "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