-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: merged feat/loginpage into feat/homepage
- Loading branch information
Showing
11 changed files
with
123 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 19 additions & 0 deletions
19
src/main/java/edu/group5/app/control/HomePageController.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| package edu.group5.app.control; | ||
|
|
||
| public class HomePageController { | ||
| private final MainController controller; | ||
|
|
||
| public HomePageController(MainController controller) { | ||
| this.controller = controller; | ||
| } | ||
|
|
||
| public void handleDonateToACauseBtn() { | ||
| System.out.println("Donate to a cause button pressed"); | ||
| controller.showBrowsePage(); | ||
| } | ||
|
|
||
| public void handleAboutUsBtn() { | ||
| System.out.println("About us button pressed"); | ||
| controller.showAboutUsPage(); | ||
| } | ||
| } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
58 changes: 57 additions & 1 deletion
58
src/main/java/edu/group5/app/view/homepage/HomePageView.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,12 +1,68 @@ | ||
| package edu.group5.app.view.homepage; | ||
|
|
||
| import edu.group5.app.control.HeaderController; | ||
| import edu.group5.app.control.HomePageController; | ||
| import edu.group5.app.view.Header; | ||
| import javafx.geometry.Pos; | ||
| import javafx.scene.control.Button; | ||
| import javafx.scene.control.ScrollPane; | ||
| import javafx.scene.layout.BorderPane; | ||
| import javafx.scene.layout.StackPane; | ||
| import javafx.scene.layout.VBox; | ||
| import javafx.scene.text.Text; | ||
|
|
||
| public class HomePageView extends BorderPane { | ||
| public HomePageView(HeaderController headerController) { | ||
| private final HomePageController controller; | ||
|
|
||
| public HomePageView(HomePageController homePageController, HeaderController headerController) { | ||
| this.controller = homePageController; | ||
| getStylesheets().add(getClass().getResource("/homepage/homepage.css").toExternalForm()); | ||
| Header headerView = new Header(headerController); | ||
| setTop(headerView); | ||
| setCenter(createBody()); | ||
| } | ||
|
|
||
| private ScrollPane createBody() { | ||
| ScrollPane body = new ScrollPane(); | ||
| body.setFitToWidth(true); | ||
| VBox vBox = new VBox(); | ||
| vBox.getChildren().addAll( | ||
| createIntroductionSection(), | ||
| createCharityImageSection(), | ||
| createCharityImageSection() | ||
| ); | ||
| body.setContent(vBox); | ||
| return body; | ||
| } | ||
|
|
||
| private VBox createIntroductionSection() { | ||
| VBox introductionSection = new VBox(); | ||
| introductionSection.setId("introduction-section"); | ||
| introductionSection.setAlignment(Pos.CENTER); | ||
| introductionSection.setSpacing(10); | ||
|
|
||
| Text h1 = new Text("MAKE A DIFFERENCE TODAY"); | ||
| h1.setId("h1"); | ||
| Text h2 = new Text("SUPPORT THOSE IN NEED AROUND THE WORLD"); | ||
| h2.setId("h2"); | ||
|
|
||
| Button donateToACauseBtn = new Button("Donate to a cause"); | ||
| donateToACauseBtn.setOnAction(e -> controller.handleDonateToACauseBtn()); | ||
|
|
||
| Button aboutUsBtn = new Button("About us"); | ||
| aboutUsBtn.setOnAction(e -> controller.handleAboutUsBtn()); | ||
|
|
||
| introductionSection.getChildren().addAll(h1, h2, donateToACauseBtn, aboutUsBtn); | ||
| return introductionSection; | ||
| } | ||
|
|
||
| private StackPane createCharityImageSection() { | ||
| StackPane charityImageSection = new StackPane(); | ||
| charityImageSection.setId("charity-image-section"); | ||
| charityImageSection.setPrefHeight(300); | ||
| StackPane image = new StackPane(); | ||
| image.setId("charity-image"); | ||
| charityImageSection.getChildren().add(image); | ||
| return charityImageSection; | ||
| } | ||
| } |
File renamed without changes.
File renamed without changes
File renamed without changes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,27 @@ | ||
| #introduction-section { | ||
| -fx-border-color: black; | ||
| -fx-border-width: 2px; | ||
| -fx-padding: 20px 0; | ||
| } | ||
|
|
||
| #h1 { | ||
| -fx-text-fill: black; | ||
| -fx-font-size: 50pt; | ||
| -fx-font-weight: bold; | ||
| } | ||
|
|
||
| #h2 { | ||
| -fx-fill: #757575; | ||
| -fx-font-size: 25pt; | ||
| } | ||
|
|
||
| #charity-image-section { | ||
| -fx-border-color: black; | ||
| } | ||
|
|
||
| #charity-image { | ||
| -fx-background-image: url("/homepage/images/charityimage.jpg"); | ||
| -fx-background-position: center 55%; | ||
| -fx-background-size: 100% auto; | ||
| -fx-background-repeat: no-repeat; | ||
| } |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.