4import Data.Foldable (for_)
5import Data.Maybe (Maybe(..))
6import Data.Monoid (power)
7import Data.Nullable (null)
9import Effect.Uncurried (runEffectFn1)
10import Icon.Logo (logo)
11import React.Basic (Ref)
12import React.Basic.DOM as R
13import React.Basic.Emotion as E
14import React.Basic.Events (EventHandler, handler_)
15import React.Basic.Helpers (jsx)
16import React.Basic.Hooks (ReactComponent, reactComponent, readRefMaybe, useRef)
17import React.Basic.Hooks as React
18import Unsafe.Coerce (unsafeCoerce)
19import Web.HTML (window)
20import Web.HTML.HTMLElement (getBoundingClientRect)
21import Web.HTML.HTMLElement as HTMLElement
22import Yoga ((/>), (</), (</*), (</*>), (</>))
23import Yoga.Block as Block
24import Yoga.Block.Atom.Button.Types as ButtonType
25import Yoga.Block.Container.Style (DarkOrLightMode(..), colour)
26import Yoga.Block.Internal (NodeRef)
27import Yoga.SVG.Image (mkLandingPageBackground)
28import Yoga.Scroll.Hook (useScrollYPosition)
33 { width: E.str "100vw"
34 , height: E.str "100vh"
35 , gridArea: E.str "landing"
39 { position: E.str "absolute"
41 , height: E.str "100%"
47 , display: E.str "flex"
48 , flexDirection: E.str "row"
49 , height: E.str "90px"
50 , justifyContent: E.str "center"
51 , alignItems: E.str "space-around"
55 { fill: E.str colour.text
57 , height: E.str "50px"
58 , marginTop: E.str "33px"
62 { fontSize: E.str "36pt"
63 , marginTop: E.str "33px"
64 , marginLeft: E.str "5vw"
68 { fontSize: E.str "22pt"
69 , marginTop: E.str "20px"
70 , marginLeft: E.str "5vw"
71 , maxWidth: E.str "400px"
75 { marginLeft: E.str "5vw"
76 , display: E.str "flex"
80 { paddingLeft: E.str "10px"
81 , paddingRight: E.str "10px"
85 { position: E.str "absolute"
86 , maxWidth: E.str "none"
87 , width: E.str "min(100%, 1200px)"
88 , height: E.str "100%"
92mkLandingPage ∷ Effect (ReactComponent {})
94 backgroundImage <- mkLandingPageBackground
95 reactComponent "LandingPage" \{} -> React.do
97 scrollY <- useScrollYPosition
99 themeVariant ∷ DarkOrLightMode
100 themeVariant = DarkMode -- [TODO]
104 { className: "landing-image"
105 , css: classes.landingImage
110 </*> { css: classes.actionButton
111 , className: "action-button"
114 </* { onClick: scrollTo ref
115 , buttonType: ButtonType.Primary
116 , css: classes.actualActionButton
117 , className: "lets-go-btn"
119 /> [ R.text buttonText ]
124 </*> { className: "welcome-text", css: classes.welcomeText, children: [ R.text welcomeText ] }
127 </*> { className: "welcome-copy", css: classes.welcomeCopy, children: [ R.text copyText ] }
131 , css: classes.landing
132 , className: "landing-page"
136 { className: "text-layer"
137 , css: classes.textLayer
140 </*> { className: "top-bar"
141 , css: classes.topBar
142 , children: [ Block.icon </*> { className: "logo", css: E.css { marginTop: E.var "--s0" }, size: E.var "--s3", icon: logo } ]
154 textBlock = R.text placeholderText
155 content = Block.stack </ {}
156 pure $ Block.container </> { themeVariant: Just themeVariant, content: content [ upperBlock, textBlock ] }
159welcomeText = "Enter the college of Kleisli"
162copyText = "Let's go!"
165buttonText = "I can't wait, let's go!"
167placeholderText ∷ String
168placeholderText = "Franz jagt im komplett verwahrlosten Taxi quer durch Bayern. " `power` 20
170scrollTo ∷ NodeRef -> EventHandler
173 maybeNode <- readRefMaybe ref
174 for_ (maybeNode >>= HTMLElement.fromNode) \n -> do
175 height <- getBoundingClientRect n <#> _.height
177 runEffectFn1 ((unsafeCoerce win).scrollTo)
178 { top: height, left: 0, behavior: "smooth" }
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