Skip to content

Commit

Permalink
Improve styling of link page messages
Browse files Browse the repository at this point in the history
  • Loading branch information
rtm516 committed Aug 24, 2024
1 parent 0b62579 commit 83e5d9b
Showing 1 changed file with 25 additions and 1 deletion.
26 changes: 25 additions & 1 deletion src/main/java/org/rtm516/discordbot/http/Server.java
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,31 @@ public void stop() {
}

private void respond(String message, HttpExchange exchange) throws IOException {
String response = "<html><body><h1>" + message + "</h1></body></html>";
String response = """
<!DOCTYPE html>
<html>
<head>
<meta charset='utf-8'>
<meta http-equiv='X-UA-Compatible' content='IE=edge'>
<title>Sponsor Verification</title>
<meta name='viewport' content='width=device-width, initial-scale=1'>
<style>
body {
margin: 0;
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',
sans-serif;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
display: flex;
justify-content: center;
}
</style>
</head>
<body>
<h1>%s</h1>
</body>
</html>""".formatted(message);

exchange.getResponseHeaders().set("Content-Type", "text/html; charset=UTF-8");
byte[] bytes = response.getBytes(StandardCharsets.UTF_8);
Expand Down

0 comments on commit 83e5d9b

Please sign in to comment.