Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
@font-face {
font-family: "DM Sans Regular";
src: url("../font/DMSans-Regular.ttf");
}

@font-face {
font-family: "DM Sans Bold";
src: url("../font/DMSans-Bold.ttf");
}

.not-found-page {
-fx-background-color: white;
-fx-background-image: url("../images/background.png");
-fx-background-repeat: repeat;
-fx-alignment: center;
-fx-padding: 64 0 64 0;
}

.not-found-page-container {
-fx-max-width: 600;
-fx-max-height: 368;
-fx-background-color: white;
-fx-background-radius: 8;
-fx-border-color: #3E3BC51F;
-fx-border-width: 1;
-fx-border-radius: 8;
-fx-padding: 32 24 32 24;
-fx-spacing: 32;
-fx-alignment: center;
}

.not-found-page-title {
-fx-font-family: "DM Sans Bold";
-fx-font-size: 32;
}

.not-found-page-text {
-fx-font-family: "DM Sans Regular";
-fx-font-size: 16;
}
Binary file not shown.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ object Filters {
}

def notFoundPage(): Filter = {
notFoundPage((request) => Response.node(new Label("Not Found: " + request.getPath())))
notFoundPage(_ => Response.node(new NotFoundPage()))
}
def notFoundPage(function: Route): Filter = { route =>
route.and(function)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
package one.jpro.platform.routing

import javafx.scene.control.Label
import javafx.scene.image.{Image, ImageView}
import javafx.scene.layout.{StackPane, VBox}
import javafx.scene.text.{Text, TextAlignment, TextFlow}

class NotFoundPage extends StackPane {

getStylesheets.add("/one/jpro/platform/routing/css/not-found-page.css")
getStyleClass.add("not-found-page")

val image = new ImageView(new Image(getClass.getResource("/one/jpro/platform/routing/images/404.png").toExternalForm))
val flow = new TextFlow()
val title = new Label("We couldn’t find a page here.")
val text = new Text("\n\nIt may have been moved or be temporarily unavailable.\nPlease double-check the URL, or go ")
val link = new Text("back to home")
val dot = new Text(".")

image.setFitWidth(500)
image.setFitHeight(175)

flow.getStyleClass.add("not-found-page-text")
title.getStyleClass.add("not-found-page-title")

flow.getChildren.addAll(title, text, link, dot)
flow.setTextAlignment(TextAlignment.CENTER)

LinkUtil.setLink(link, "/")

getChildren.add(new VBox(image, flow) {
getStyleClass.add("not-found-page-container")
})
}