this repo has no description
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

fix: I was wondering why that thing wasn't positioned properly.

+11 -21
+5 -15
client/src/lumina_client/helpers.gleam
··· 52 52 53 53 /// Get centered position for modal box in px 54 54 pub fn get_center_positioned_style_px() -> #(Float, Float) { 55 - let #(window_w, window_h) = dom.get_window_dimensions_px() 56 - let pos_x = window_h |> int.to_float() 57 - let pos_y = window_w |> int.to_float() 58 - let x = case pos_x |> float.divide(2.0) { 59 - Ok(v) -> v 60 - Error(Nil) -> { 61 - pos_x -. 1.0 |> float.divide(2.0) |> result.unwrap(0.0) 62 - } 63 - } 64 - let y = case pos_y |> float.divide(2.0) { 65 - Ok(v) -> v 66 - Error(Nil) -> { 67 - pos_y -. 1.0 |> float.divide(2.0) |> result.unwrap(0.0) 68 - } 69 - } 55 + let #(window_w, window_h) = dom.get_window_dimensions_px() |> echo 56 + let x_int = window_h / 2 57 + let y_int = window_w / 2 58 + let x = int.to_float(x_int) 59 + let y = int.to_float(y_int) 70 60 #(x, y) 71 61 }
+6 -6
client/src/lumina_client/view/homepage.gleam
··· 107 107 ], 108 108 ) 109 109 CentralSmall(id, title, mod, closable, params) -> { 110 - let def_x = helpers.get_center_positioned_style_px().0 111 - let def_y = helpers.get_center_positioned_style_px().1 112 - let x = dict.get(params, "pos_x") 113 - let y = dict.get(params, "pos_y") 114 - let pos_x = case x { 110 + let def_x = helpers.get_center_positioned_style_px().1 111 + let def_y = helpers.get_center_positioned_style_px().0 112 + let set_x = dict.get(params, "pos_x") 113 + let set_y = dict.get(params, "pos_y") 114 + let pos_x = case set_x { 115 115 Ok(v) -> float.parse(v) |> result.unwrap(def_x) 116 116 Error(_) -> def_x 117 117 } 118 - let pos_y = case y { 118 + let pos_y = case set_y { 119 119 Ok(v) -> float.parse(v) |> result.unwrap(def_y) 120 120 Error(_) -> def_y 121 121 }