11import components/button
22import components/copy_button
3+ import components/footer
34import components/navbar
45import components/windows
5- import layout . { body_container , main_title , row , section , title , title_container }
6+ import ffi
7+ import layout . {
8+ body_container , column , main_title , row , section , section_explanation , title ,
9+ title_container ,
10+ }
611import redraw
12+ import redraw/handler
713import redraw/html as h
814import redraw_dom/client
915import sketch as s
1016import sketch/redraw as sr
1117import sketch/redraw/html as sh
18+ import sketch/size . { px }
1219import texts
1320
1421pub fn main ( ) {
@@ -23,6 +30,7 @@ fn app() {
2330 let plain_css_section = plain_css_section ( )
2431 let wisp_section = wisp_section ( )
2532 let navbar = navbar . navbar ( )
33+ let footer = footer . footer ( )
2634 use <- redraw . component__ ( "App" )
2735 sh . div ( s . class ( [ s . font_family ( "Lexend" ) ] ) , [ ] , [
2836 navbar ( ) ,
@@ -31,6 +39,7 @@ fn app() {
3139 redraw_section ( ) ,
3240 plain_css_section ( ) ,
3341 wisp_section ( ) ,
42+ footer ( ) ,
3443 ] )
3544}
3645
@@ -39,7 +48,7 @@ fn description_section() {
3948 title_container ( [
4049 main_title ( "Leverage on your CSS knowledge." ) ,
4150 main_title ( "Create your own styles." ) ,
42- main_title ( "Make your application Gleam ." ) ,
51+ main_title ( "Make your application Gleaming ." ) ,
4352 ] ) ,
4453 body_container ( [ ] , [
4554 title ( "Sketch, CSS for anywhere" ) ,
@@ -51,24 +60,34 @@ fn description_section() {
5160 h . div ( [ ] , [ h . text ( texts . explanation_trd ) ] ) ,
5261 h . div ( [ ] , [ h . text ( "Show me an example with…" ) ] ) ,
5362 row ( [ ] , [
54- button . primary ( "Lustre" ) ,
55- button . primary ( "Redraw" ) ,
56- button . primary ( "Plain CSS" ) ,
57- button . primary ( "SSR" ) ,
63+ button . primary ( [ scroll_to ( "lustre-section" ) ] , "Lustre" ) ,
64+ button . primary ( [ scroll_to ( "redraw-section" ) ] , "Redraw" ) ,
65+ button . primary ( [ scroll_to ( "plain-css-section" ) ] , "Plain CSS" ) ,
66+ button . primary ( [ scroll_to ( "wisp-section" ) ] , "SSR" ) ,
5867 ] ) ,
5968 ] ) ,
6069 ] )
6170}
6271
72+ fn scroll_to ( id : String ) {
73+ use _event <- handler . on_click ( )
74+ ffi . scroll_to ( id )
75+ }
76+
6377fn lustre_section ( ) {
6478 let copy_button = copy_button . copy_button ( )
6579 use <- redraw . component__ ( "LustreSection" )
66- section ( "#eee" , [
67- row ( [ ] , [
80+ section ( "lustre-section" , " #eee", [
81+ column ( [ ] , [
6882 copy_button . title ( "Sketch Lustre" ) ,
6983 copy_button ( # ( "gleam add sketch sketch_lustre" ) ) ,
7084 ] ) ,
71- layout . windows_wrapper ( [
85+ layout . windows_wrapper ( px ( 1000 ) , [
86+ column ( [ ] , [
87+ section_explanation ( [ ] , [ h . text ( texts . sketch_lustre_fst ) ] ) ,
88+ section_explanation ( [ ] , [ h . text ( texts . sketch_lustre_snd ) ] ) ,
89+ button . link ( "https://hexdocs.pm/sketch_lustre" , texts . bring_me_docs ) ,
90+ ] ) ,
7291 layout . windows_row ( [
7392 windows . scaffold ( [
7493 windows . menu_bar ( [ windows . traffic_lights ( ) ] ) ,
@@ -89,12 +108,17 @@ fn lustre_section() {
89108fn redraw_section ( ) {
90109 let copy_button = copy_button . copy_button ( )
91110 use <- redraw . component__ ( "RedrawSection" )
92- section ( "#fff" , [
93- row ( [ ] , [
111+ section ( "redraw-section" , " #fff", [
112+ column ( [ ] , [
94113 copy_button . title ( "Sketch Redraw" ) ,
95114 copy_button ( # ( "gleam add sketch sketch_redraw" ) ) ,
96115 ] ) ,
97- layout . windows_wrapper ( [
116+ layout . windows_wrapper ( px ( 1000 ) , [
117+ column ( [ ] , [
118+ section_explanation ( [ ] , [ h . text ( texts . sketch_redraw_fst ) ] ) ,
119+ section_explanation ( [ ] , [ h . text ( texts . sketch_redraw_snd ) ] ) ,
120+ button . link ( "https://hexdocs.pm/sketch_redraw" , texts . bring_me_docs ) ,
121+ ] ) ,
98122 layout . windows_row ( [
99123 windows . scaffold ( [
100124 windows . menu_bar ( [ windows . traffic_lights ( ) ] ) ,
@@ -115,12 +139,17 @@ fn redraw_section() {
115139fn plain_css_section ( ) {
116140 let copy_button = copy_button . copy_button ( )
117141 use <- redraw . component__ ( "PlainCssSection" )
118- section ( "#eee" , [
119- row ( [ ] , [
142+ section ( "plain-css-section" , " #eee", [
143+ column ( [ ] , [
120144 copy_button . title ( "Sketch CSS" ) ,
121145 copy_button ( # ( "gleam add sketch sketch_css" ) ) ,
122146 ] ) ,
123- layout . windows_wrapper ( [
147+ layout . windows_wrapper ( px ( 1400 ) , [
148+ column ( [ ] , [
149+ section_explanation ( [ ] , [ h . text ( texts . sketch_css_fst ) ] ) ,
150+ section_explanation ( [ ] , [ h . text ( texts . sketch_css_snd ) ] ) ,
151+ button . link ( "https://hexdocs.pm/sketch_css" , texts . bring_me_docs ) ,
152+ ] ) ,
124153 layout . windows_row ( [
125154 windows . scaffold ( [
126155 windows . menu_bar ( [ windows . traffic_lights ( ) ] ) ,
@@ -142,12 +171,17 @@ fn plain_css_section() {
142171fn wisp_section ( ) {
143172 let copy_button = copy_button . copy_button ( )
144173 use <- redraw . component__ ( "WispSection" )
145- section ( "#fff" , [
146- row ( [ ] , [
174+ section ( "wisp-section" , " #fff", [
175+ column ( [ ] , [
147176 copy_button . title ( "Sketch SSR" ) ,
148177 copy_button ( # ( "gleam add sketch" ) ) ,
149178 ] ) ,
150- layout . windows_wrapper ( [
179+ layout . windows_wrapper ( px ( 1400 ) , [
180+ column ( [ ] , [
181+ section_explanation ( [ ] , [ h . text ( texts . sketch_wisp_fst ) ] ) ,
182+ section_explanation ( [ ] , [ h . text ( texts . sketch_wisp_snd ) ] ) ,
183+ button . link ( "https://hexdocs.pm/sketch_lustre" , texts . bring_me_docs ) ,
184+ ] ) ,
151185 layout . windows_row ( [
152186 windows . scaffold ( [
153187 windows . menu_bar ( [ windows . traffic_lights ( ) ] ) ,
0 commit comments