Skip to content

Commit f67ddf9

Browse files
authored
feat(reference-app): adopt Pico CSS for the login, logout, and landing pages (#192)
Vendors Pico v2.1.1 as static/pico.min.css and restyles the pages as a centered card. Login now pre-fills the demo credentials with a caption so they are obvious. Page titles are normalized to h1, and the screenshot viewport is pinned to 576x520 so captures are a uniform, GitHub-column-friendly size.
1 parent dad7ab3 commit f67ddf9

5 files changed

Lines changed: 42 additions & 20 deletions

File tree

reference-app/src/main/resources/static/pico.min.css

Lines changed: 4 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

reference-app/src/main/resources/templates/demo.ftlh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,10 @@
33
<head>
44
<meta charset="UTF-8">
55
<title>Ory Hydra Reference App</title>
6+
<link rel="stylesheet" href="/pico.min.css">
67
</head>
78
<body>
9+
<main class="container"><article>
810
<h1>Ory Hydra Reference App</h1>
911

1012
<p>This app implements the login, consent, and logout screens for an
@@ -68,5 +70,6 @@ curl -X PATCH \
6870
</pre>
6971
</div>
7072
</details>
73+
</article></main>
7174
</body>
7275
</html>

reference-app/src/main/resources/templates/login.ftlh

Lines changed: 21 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,24 +2,33 @@
22
<html lang="en">
33
<head>
44
<meta charset="UTF-8">
5+
<title>Log In</title>
6+
<link rel="stylesheet" href="/pico.min.css">
57
</head>
68
<body>
7-
<h2>Log In</h2>
8-
<form action="/login/usernamePassword" method="post">
9-
<input type="hidden" name="loginChallenge" value="${loginChallenge}" />
9+
<main class="container"><article>
10+
<h1>Log In</h1>
11+
<p><small>Demo credentials are pre-filled. Select Log in to continue.</small></p>
12+
<form action="/login/usernamePassword" method="post">
13+
<input type="hidden" name="loginChallenge" value="${loginChallenge}" />
1014

11-
<label for="loginEmail">Email:</label>
12-
<input type="email" name="loginEmail" placeholder="foo@bar.com" /><br>
13-
<label for="loginPassword">Password:</label>
14-
<input type="password" name="loginPassword" placeholder="password" /><br>
15+
<label for="loginEmail">Email</label>
16+
<input type="email" id="loginEmail" name="loginEmail" value="foo@bar.com" />
1517

16-
<label for="remember">Remember me:</label>
17-
<input type="checkbox" id="remember" name="remember" /><br>
18+
<label for="loginPassword">Password</label>
19+
<input type="password" id="loginPassword" name="loginPassword" value="password" />
1820

19-
<input type="submit" name="submit" value="Log in" />
20-
</form>
21+
<label>
22+
<input type="checkbox" id="remember" name="remember" />
23+
Remember me
24+
</label>
2125

22-
<p>${(error)!}</p>
26+
<input type="submit" name="submit" value="Log in" />
27+
</form>
2328

29+
<#if (error)?has_content>
30+
<p>${error}</p>
31+
</#if>
32+
</article></main>
2433
</body>
2534
</html>

reference-app/src/main/resources/templates/logout.ftlh

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,21 @@
22
<html lang="en">
33
<head>
44
<meta charset="UTF-8">
5+
<title>Log Out</title>
6+
<link rel="stylesheet" href="/pico.min.css">
57
</head>
68
<body>
7-
<h2>Log Out</h2>
8-
<p>Do you want to log out ${subject}?</p>
9-
<form action="/logout" method="post">
10-
<input type="hidden" name="logoutChallenge" value="${logoutChallenge}" />
9+
<main class="container"><article>
10+
<h1>Log Out</h1>
11+
<p>Do you want to log out ${subject}?</p>
12+
<form action="/logout" method="post">
13+
<input type="hidden" name="logoutChallenge" value="${logoutChallenge}" />
1114

12-
<input type="submit" id="confirm" name="confirm" value="Yes, log out" />
13-
<input type="submit" id="cancel" name="cancel" value="Cancel" />
14-
</form>
15+
<div role="group">
16+
<input type="submit" id="confirm" name="confirm" value="Yes, log out" />
17+
<input type="submit" id="cancel" name="cancel" value="Cancel" class="secondary" />
18+
</div>
19+
</form>
20+
</article></main>
1521
</body>
1622
</html>

reference-app/src/test/java/com/ardetrick/oryhydrareference/OryHydraReferenceApplicationFunctionalTests.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ void stopTestEnvironment() {
128128
// because GitHub scales README images down to its ~880px column but never up: captures
129129
// narrower than the column render 1:1, and the unstyled pages carry less dead space.
130130
private Page newPage() {
131-
return browser.newPage(new Browser.NewPageOptions().setViewportSize(640, 400));
131+
return browser.newPage(new Browser.NewPageOptions().setViewportSize(576, 520));
132132
}
133133

134134
@BeforeEach

0 commit comments

Comments
 (0)