1
1
import gleam/list
2
2
import gleam/option . { type Option , None , Some }
3
+ import gleam/string
3
4
import lustre
4
5
import lustre/attribute
5
6
import lustre/element . { type Element }
@@ -18,7 +19,15 @@ const flamingo = "#F4B9B9"
18
19
19
20
const peach = "#F2C94C"
20
21
21
- const description = "Software Engineer </> Ruby & Elixir Enthusiast </> Metalhead </> Wannabe Pixel Artist"
22
+ fn description ( ) -> String {
23
+ string . join (
24
+ [
25
+ "Software Engineer" , "Tech Enthusiast" , "Metalhead" ,
26
+ "Wannabe Pixel Artist" ,
27
+ ] ,
28
+ with : " </> " ,
29
+ )
30
+ }
22
31
23
32
const full_name = "Julio Cabrera"
24
33
@@ -77,40 +86,44 @@ fn update(model: #(Model, Nil), msg: Msg) -> #(Model, Nil) {
77
86
78
87
// VIEW
79
88
80
- fn body_styles ( ) -> List ( # ( String , String ) ) {
89
+ fn root_styles ( ) -> List ( # ( String , String ) ) {
81
90
[
82
- # ( "margin" , "0" ) ,
83
91
# ( "padding" , "0" ) ,
92
+ # ( "margin" , "0" ) ,
84
93
# ( "min-height" , "100vh" ) ,
85
94
# ( "width" , "100%" ) ,
86
95
# ( "background" , background_gradient ( ) ) ,
96
+ # ( "background-attachment" , "fixed" ) ,
97
+ # ( "background-size" , "cover" ) ,
87
98
# ( "color" , rosewater ) ,
88
99
# ( "display" , "flex" ) ,
89
- # ( "justify-content " , "center " ) ,
100
+ # ( "flex-direction " , "column " ) ,
90
101
# ( "align-items" , "center" ) ,
91
102
# ( "font-family" , "'Inter', system-ui, -apple-system, sans-serif" ) ,
92
103
# ( "box-sizing" , "border-box" ) ,
93
- # ( "min-width" , "100vw" ) ,
94
- # ( "overflow" , "hidden" ) ,
95
- # ( "position" , "fixed" ) ,
96
- # ( "top" , "0" ) ,
104
+ # ( "-webkit-font-smoothing" , "antialiased" ) ,
105
+ # ( "position" , "absolute" ) ,
97
106
# ( "left" , "0" ) ,
107
+ # ( "top" , "0" ) ,
98
108
# ( "right" , "0" ) ,
99
109
# ( "bottom" , "0" ) ,
110
+ # ( "overflow-y" , "auto" ) ,
111
+ # ( "-webkit-overflow-scrolling" , "touch" ) ,
100
112
]
101
113
}
102
114
103
115
fn container_styles ( ) -> List ( # ( String , String ) ) {
104
116
[
105
117
# ( "max-width" , "680px" ) ,
106
118
# ( "width" , "90%" ) ,
107
- # ( "min-height" , "100vh" ) ,
108
- # ( "padding" , "40px 20px" ) ,
109
119
# ( "display" , "flex" ) ,
110
120
# ( "flex-direction" , "column" ) ,
111
121
# ( "align-items" , "center" ) ,
112
122
# ( "justify-content" , "space-between" ) ,
113
- # ( "box-sizing" , "border-box" ) ,
123
+ # ( "padding" , "40px 20px" ) ,
124
+ # ( "height" , "100%" ) ,
125
+ # ( "margin" , "0 auto" ) ,
126
+ # ( "background" , "transparent" ) ,
114
127
]
115
128
}
116
129
@@ -161,6 +174,8 @@ fn main_content_styles() -> List(#(String, String)) {
161
174
# ( "align-items" , "center" ) ,
162
175
# ( "gap" , "16px" ) ,
163
176
# ( "width" , "100%" ) ,
177
+ # ( "flex" , "1" ) ,
178
+ # ( "margin-bottom" , "40px" ) ,
164
179
]
165
180
}
166
181
@@ -203,6 +218,7 @@ fn footer_styles() -> List(#(String, String)) {
203
218
# ( "font-size" , "14px" ) ,
204
219
# ( "font-weight" , "500" ) ,
205
220
# ( "width" , "100%" ) ,
221
+ # ( "background" , "transparent" ) ,
206
222
# ( "margin-top" , "auto" ) ,
207
223
]
208
224
}
@@ -218,7 +234,7 @@ fn view(model_tuple: #(Model, Nil)) -> Element(Msg) {
218
234
attribute . style ( avatar_styles ( ) ) ,
219
235
] ) ,
220
236
html . h1 ( [ attribute . style ( name_styles ( ) ) ] , [ html . text ( full_name ) ] ) ,
221
- html . p ( [ attribute . style ( bio_styles ( ) ) ] , [ html . text ( description ) ] ) ,
237
+ html . p ( [ attribute . style ( bio_styles ( ) ) ] , [ html . text ( description ( ) ) ] ) ,
222
238
] )
223
239
224
240
let link_elements =
@@ -244,7 +260,7 @@ fn view(model_tuple: #(Model, Nil)) -> Element(Msg) {
244
260
let footer =
245
261
html . footer ( [ attribute . style ( footer_styles ( ) ) ] , [ html . text ( footer_content ) ] )
246
262
247
- html . div ( [ attribute . style ( body_styles ( ) ) ] , [
263
+ html . div ( [ attribute . style ( root_styles ( ) ) ] , [
248
264
html . div ( [ attribute . style ( container_styles ( ) ) ] , [
249
265
profile ,
250
266
html . div ( [ attribute . style ( main_content_styles ( ) ) ] , link_elements ) ,
0 commit comments