Skip to content

Commit d7c6be0

Browse files
authored
Merge pull request #16 from AustinMusiku/revamp-landing-page-ui
Feat: Revamped landing page UI
2 parents 40057b7 + 2ff84bc commit d7c6be0

File tree

3 files changed

+84
-7
lines changed

3 files changed

+84
-7
lines changed

public/index.html

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8" />
5+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
6+
<meta
7+
name="description"
8+
content="GraphQL-fpl-api | Get the stats you want. No more, no less."
9+
/>
10+
<title>GraphQL-fpl-api</title>
11+
12+
<link rel="stylesheet" href="/style.css" />
13+
</head>
14+
<body>
15+
<main>
16+
<div class="headings">
17+
<h1 class="heading">Get the stats you want.</h1>
18+
<h1 class="heading">No more, no less.</h1>
19+
</div>
20+
21+
<div class="links">
22+
<a class="links__link link--primary" href="/graphql"
23+
>GraphQL playground</a
24+
>
25+
26+
<a
27+
class="links__link link--secondary"
28+
href="https://www.github.com/austinmusiku/graphql-fpl-api"
29+
>Github repo</a
30+
>
31+
</div>
32+
</main>
33+
</body>
34+
</html>

public/style.css

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
* {
2+
margin: 0;
3+
padding: 0;
4+
box-sizing: border-box;
5+
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
6+
}
7+
main {
8+
display: flex;
9+
flex-direction: column;
10+
align-items: center;
11+
justify-content: center;
12+
height: 100vh;
13+
gap: 2rem;
14+
text-align: center;
15+
}
16+
.heading {
17+
font-size: 2rem;
18+
font-weight: 700;
19+
}
20+
.links {
21+
display: flex;
22+
flex-direction: row;
23+
gap: 1rem;
24+
width: fit-content;
25+
}
26+
.links__link {
27+
padding: 0.5rem;
28+
text-decoration: none;
29+
font-size: 1.2rem;
30+
color: #37003c;
31+
background-color: #ffffff00;
32+
text-decoration: underline;
33+
}
34+
35+
@media screen and (max-width: 768px) {
36+
main {
37+
gap: 3rem;
38+
}
39+
.heading {
40+
font-size: 1.5rem;
41+
}
42+
.links {
43+
flex-direction: column;
44+
font-size: 1rem;
45+
}
46+
}

src/routes/index.ts

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import path from 'path'
12
import { Application } from 'express'
23
import { createYoga } from 'graphql-yoga'
34
import { cpus, totalmem } from 'os'
@@ -9,13 +10,9 @@ import { loaders } from '../loaders'
910
class Routes {
1011
// default route
1112
public mountDefault(_express: Application): Application {
12-
return _express.get('/', (req, res) => {
13-
// return html page with link to graphql playground
14-
res.send(`
15-
<h1>Fplfriend</h1>
16-
<a href="/graphql">Click here to go to GraphQL Playground</a>
17-
<p>For more information, visit <a href="https://www.github.com/austinmusiku/graphql-fpl-api">github repo</a></p>
18-
`)
13+
return _express.get('/', (_, res) => {
14+
const page = path.join(__dirname, '../../public/index.html')
15+
res.sendFile(page)
1916
})
2017
}
2118

0 commit comments

Comments
 (0)