Skip to content

Commit

Permalink
update[CausesPage]: Update CausesPage to have search bare fixed at th…
Browse files Browse the repository at this point in the history
…e top ensuring user friendly UX
  • Loading branch information
Fredrik Marjoni committed Apr 9, 2026
1 parent fbc4ed1 commit fe43461
Show file tree
Hide file tree
Showing 3 changed files with 59 additions and 38 deletions.
13 changes: 7 additions & 6 deletions src/main/java/edu/group5/app/view/causespage/CausesPageView.java
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,10 @@ public CausesPageView(AppState appState, NavigationController nav, OrganizationC
setCenter(createBody());
}

private ScrollPane createBody() {
private BorderPane createBody() {
BorderPane bodyRoot = new BorderPane();
bodyRoot.setTop(createSearchSection());

ScrollPane body = new ScrollPane();
body.setId("body");
body.setFitToWidth(true);
Expand All @@ -47,11 +50,9 @@ private ScrollPane createBody() {
// Load organizations INSTANTLY from cache
allOrganizations = orgController.getTrustedOrgs();

vBox.getChildren().addAll(
createSearchSection(),
createOrganizationSection(null)
);
vBox.getChildren().add(createOrganizationSection(null));
body.setContent(vBox);
bodyRoot.setCenter(body);

// Build a map of org ID -> card for quick lookup
Map<Integer, OrganizationCard> cardMap = new HashMap<>();
Expand All @@ -78,7 +79,7 @@ private ScrollPane createBody() {
});
});

return body;
return bodyRoot;
}

private HBox createSearchSection() {
Expand Down
42 changes: 26 additions & 16 deletions src/main/resources/loginpage/login.css
Original file line number Diff line number Diff line change
@@ -1,25 +1,35 @@
#image-section {
-fx-background-image: url("/loginpage/login-image.jpg");
-fx-background-size: 200%;
-fx-background-position: left center;
-fx-background-repeat: no-repeat;
-fx-pref-width: 50%;
-fx-background-image: url("/loginpage/login-image.jpg");
-fx-background-size: 200%;
-fx-background-position: left center;
-fx-background-repeat: no-repeat;
-fx-pref-width: 50%;
}

#login-btn {
-fx-background-color: #000000;
-fx-text-fill: white;
-fx-pref-height: 35px;
-fx-background-color: #000000;
-fx-text-fill: white;
-fx-pref-height: 35px;
}

#register-btn {
-fx-background-color: #000000;
-fx-text-fill: white;
-fx-pref-height: 35px;
-fx-background-color: #000000;
-fx-text-fill: white;
-fx-pref-height: 35px;
}

#login-box {
-fx-border-color: #ccc;
-fx-border-radius: 8px;
-fx-border-width: 1px;
-fx-padding: 24px;
-fx-max-width: 340px;
-fx-border-color: #ccc;
-fx-border-radius: 8px;
-fx-border-width: 1px;
-fx-padding: 24px;
-fx-max-width: 340px;
}

#login-btn:hover {
-fx-cursor: hand;
}

#register-btn:hover {
-fx-cursor: hand;
}
42 changes: 26 additions & 16 deletions src/main/resources/loginpage/signin.css
Original file line number Diff line number Diff line change
@@ -1,25 +1,35 @@
#image-section {
-fx-background-image: url("/loginpage/signin-image.png");
-fx-background-size: auto;
-fx-background-position: right center;
-fx-background-repeat: no-repeat;
-fx-pref-width: 50%;
-fx-background-image: url("/loginpage/signin-image.png");
-fx-background-size: auto;
-fx-background-position: right center;
-fx-background-repeat: no-repeat;
-fx-pref-width: 50%;
}

#login-btn {
-fx-background-color: #000000;
-fx-text-fill: white;
-fx-pref-height: 35px;
-fx-background-color: #000000;
-fx-text-fill: white;
-fx-pref-height: 35px;
}

#register-btn {
-fx-background-color: #000000;
-fx-text-fill: white;
-fx-pref-height: 35px;
-fx-background-color: #000000;
-fx-text-fill: white;
-fx-pref-height: 35px;
}

#login-box {
-fx-border-color: #ccc;
-fx-border-radius: 8px;
-fx-border-width: 1px;
-fx-padding: 24px;
-fx-max-width: 340px;
-fx-border-color: #ccc;
-fx-border-radius: 8px;
-fx-border-width: 1px;
-fx-padding: 24px;
-fx-max-width: 340px;
}

#login-btn:hover {
-fx-cursor: hand;
}

#register-btn:hover {
-fx-cursor: hand;
}

0 comments on commit fe43461

Please sign in to comment.