Skip to content

Commit

Permalink
Update homepage
Browse files Browse the repository at this point in the history
  • Loading branch information
typicode committed May 21, 2019
1 parent 6da9597 commit a843cf1
Show file tree
Hide file tree
Showing 5 changed files with 118 additions and 86 deletions.
15 changes: 0 additions & 15 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,6 @@
"husky": "^2.3.0",
"jest": "^24.8.0",
"markdown-toc": "^1.2.0",
"milligram": "^1.3.0",
"mini-css-extract-plugin": "^0.6.0",
"mkdirp": "^0.5.1",
"npm-run-all": "^4.1.5",
Expand Down
124 changes: 73 additions & 51 deletions src/front/index.html
Original file line number Diff line number Diff line change
@@ -1,59 +1,81 @@
<html>
<head>
<link
rel="stylesheet"
href="https://use.fontawesome.com/releases/v5.8.2/css/all.css"
integrity="sha384-oS3vJWv+0UjzBfQzYUhtDYW+Pj2yciDJxpsK1OYPAYjqT085Qq/1cq5FLXAZQ7Ay"
crossorigin="anonymous"
/>
<title>JSON Server</title>
</head>

<head>
<title>JSON Server</title>
</head>
<body>
<header>
<div class="container">
<nav>
<ul>
<li class="title">
JSON Server
</li>
<li>
<a href="https://www.patreon.com/typicode">
<i class="fab fa-patreon"></i>Patreon
</a>
</li>
<li>
<a href="https://thanks.typicode.com">
<i class="far fa-laugh"></i>Supporters
</a>
</li>
<li>
<a href="https://my-json-server.typicode.com">
<i class="fas fa-burn"></i>My JSON Server
</a>
</li>
</ul>
</nav>
</div>
</header>
<main>
<div class="container">
<h1>Congrats!</h1>
<p>
You're successfully running JSON Server
<br />
✧*。٩(ˊᗜˋ*)و✧*。
</p>

<body>
<header>
<div class="container">
<h3>JSON Server</h3>
</div>
</header>
<main>
<div class="container">
<h4>Congrats!</h4>
<p>
You're successfully running JSON Server
<br> ✧*。٩(ˊᗜˋ*)و✧*。
</p>
<div id="resources"></div>

<div id="resources"></div>
<p>
To access and modify resources, you can use any HTTP method
<br />
<code>GET</code>
<code>POST</code>
<code>PUT</code>
<code>PATCH</code>
<code>DELETE</code>
<code>OPTIONS</code>
</p>

<p>
To access and modify resources, you can use any HTTP method
<br>
<code>GET</code>
<code>POST</code>
<code>PUT</code>
<code>PATCH</code>
<code>DELETE</code>
<code>OPTIONS</code>
</p>
<div id="custom-routes"></div>

<div id="custom-routes"></div>
<h1>Documentation</h1>
<p>
<a href="https://github.com/typicode/json-server">
<i class="fab fa-github-alt"></i>README
</a>
</p>
</div>
</main>

<h4>Documentation</h4>
<p>
View
<a href="https://github.com/typicode/json-server">README</a>
</p>

<h4>See also</h4>
<ul>
<li><a href="https://www.patreon.com/typicode">Patreon</a></li>
<li><a href="https://thanks.typicode.com">Supporters</a></li>
</ul>
</div>
</main>

<footer>
<div class="container">
<p>
To replace this page, create a
<code>./public/index.html</code> file.
</p>
</div>
</footer>
</body>
<footer>
<div class="container">
<p>
To replace this page, create a
<code>./public/index.html</code> file.
</p>
</div>
</footer>
</body>
</html>
5 changes: 2 additions & 3 deletions src/front/index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import 'promise-polyfill/src/polyfill'
import 'whatwg-fetch'
import 'milligram/dist/milligram.css'
import './style.css'

function ResourceItem({ name, length }) {
Expand Down Expand Up @@ -34,7 +33,7 @@ function NoResources() {
function ResourcesBlock({ db }) {
return `
<div>
<h4>Resources</h4>
<h1>Resources</h1>
${Object.keys(db).length ? ResourceList({ db }) : NoResources()}
</div>
`
Expand All @@ -53,7 +52,7 @@ function CustomRoutesBlock({ customRoutes }) {
if (rules.length) {
return `
<div>
<h4>Custom Routes</h4>
<h1>Custom Routes</h1>
<table>
${rules
.map(
Expand Down
59 changes: 43 additions & 16 deletions src/front/style.css
Original file line number Diff line number Diff line change
@@ -1,38 +1,63 @@
html {
font-size: 70%;
}

body {
display: flex;
min-height: 100vh;
font-family: -apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Oxygen-Sans,Ubuntu,Cantarell,"Helvetica Neue",sans-serif;
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
flex-direction: column;
padding:0;
padding: 0;
margin: 0;
color: #333;
letter-spacing: 0;
}

.container {
max-width: 960px;
margin: auto;
padding: 1rem;
}

header {
padding-top: 2.0rem;
border-bottom: 1px solid #EEE;
border-bottom: 1px solid #eee;
}

header a, header a:hover {
header a,
header a:hover {
text-decoration: none;
}

nav ul {
display: flex;
flex-wrap: nowrap;
justify-content: space-between;
}

nav li.title {
flex-grow: 5;
text-align: left;
font-weight: bold;
}

nav li {
flex-grow: 1;
text-align: right;
}

main {
flex: 1;
}

footer {
padding-top: 2.5rem;
border-top: 1px solid #EEE;
margin-top: 4rem;
border-top: 1px solid #eee;
}

h4 {
h1 {
margin-top: 4rem;
font-weight: normal;
}

i {
margin-right: 0.5rem;
}

a {
Expand All @@ -50,8 +75,7 @@ table {

td {
border: 0;
padding: 0 1em .5em 0;
font-weight: 300;
padding: 0 1em 0.5em 0;
}

td:first-child {
Expand All @@ -66,9 +90,12 @@ ul {

li {
list-style-type: none;
margin-bottom: .2rem;
margin-bottom: 0.2rem;
}

code {
border-radius: 0;
padding: 0.2rem;
margin: 0rem 0.2rem;
border-radius: 0.2rem;
background: #eee;
}

0 comments on commit a843cf1

Please sign in to comment.