Skip to content

Commit

Permalink
feat:add LoginPageView with image section
Browse files Browse the repository at this point in the history
  • Loading branch information
MatheaGjerde committed Mar 10, 2026
1 parent a5aa3e0 commit 1a9aef9
Show file tree
Hide file tree
Showing 4 changed files with 47 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/main/java/edu/group5/app/view/MainView.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import edu.group5.app.control.HeaderController;
import edu.group5.app.control.MainController;
import edu.group5.app.view.homepage.HomePageView;
import edu.group5.app.view.loginpage.LoginPageView;
import javafx.scene.Scene;
import javafx.scene.layout.BorderPane;

Expand All @@ -18,7 +19,7 @@ public MainView(MainController mainController) {
}

public Scene createView() {
root.setCenter(new HomePageView(headerController));
root.setCenter(new LoginPageView(headerController));
return new Scene(root, 1280, 720);
}

Expand Down
38 changes: 38 additions & 0 deletions src/main/java/edu/group5/app/view/loginpage/LoginPageView.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
package edu.group5.app.view.loginpage;


import edu.group5.app.control.HeaderController;
import edu.group5.app.view.Header;
import javafx.geometry.Pos;
import javafx.scene.layout.*;

import java.util.Objects;

public class LoginPageView extends BorderPane {

public LoginPageView(HeaderController headerController) {
Header headerView = new Header(headerController);
setTop(headerView);

HBox content = new HBox();
content.setFillHeight(true);

VBox loginSection = new VBox();
loginSection.setAlignment(Pos.CENTER);
HBox.setHgrow(loginSection, Priority.ALWAYS);

StackPane imageSection = new StackPane();
imageSection.setId("image-section");
HBox.setHgrow(imageSection, Priority.ALWAYS);


content.getChildren().addAll(loginSection, imageSection);

String css = Objects.requireNonNull(
getClass().getResource("/loginpage/login.css")).toExternalForm();
content.getStylesheets().add(css);

setCenter(content);
}

}
Binary file added src/main/resources/loginpage/login-image.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 7 additions & 0 deletions src/main/resources/loginpage/login.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#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%;
}

0 comments on commit 1a9aef9

Please sign in to comment.