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.Helpers (jsx)
12import React.Basic.Hooks (ReactComponent, component, element, readRefMaybe, useRef)
13import React.Basic.Hooks as React
14import Unsafe.Coerce (unsafeCoerce)
15import Web.HTML (window)
16import Web.HTML.HTMLElement (getBoundingClientRect)
17import Web.HTML.HTMLElement as HTMLElement
18import Yoga.Button.Component (ButtonType(..), mkButton)
19import Yoga.SVG.Icon (trianglelogoIcon)
20import Yoga.SVG.Image (mkLandingPageBackground)
21import Yoga.Scroll.Hook (useScrollYPosition)
22import Yoga.Theme.Styles (makeStylesJSS, useTheme)
23import Yoga.Theme.Types (CSSTheme)
24import Yoga.Typography.Header (mkH)
26mkLandingPage ∷ Effect (ReactComponent {})
30 $ jssClasses \(theme ∷ CSSTheme) ->
39 { position: "absolute"
48 , flexDirection: "row"
50 , justifyContent: "center"
51 , alignItems: "space-around"
55 { fill: theme.textColour
81 , paddingRight: "10px"
85 { position: "absolute"
93 backgroundImage <- mkLandingPageBackground
94 component "LandingPage" \{} -> React.do
95 classes <- useStyles {}
98 scrollY <- useScrollYPosition
102 , className: classes.landing
104 [ element backgroundImage { className: classes.landingImage }
106 { className: classes.textLayer
109 { className: classes.topBar
110 , children: [ element trianglelogoIcon { className: classes.logo } ]
112 , R.div { className: classes.welcomeText, children: [ R.text welcomeText ] }
113 , R.div { className: classes.welcomeCopy, children: [ R.text copyText ] }
115 { className: classes.actionButton
120 maybeNode <- readRefMaybe ref
121 for_ (maybeNode >>= HTMLElement.fromNode) \n -> do
122 height <- getBoundingClientRect n <#> _.height
124 runEffectFn1 ((unsafeCoerce win).scrollTo)
125 { top: height, left: 0, behavior: "smooth" }
126 , buttonType: HighlightedButton
127 , className: classes.actualActionButton
129 [ R.text buttonText ]
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