Commit 05da29162cd94001b87a1366246df608c8a7fa4d
Includes manifest and progress bar indicator
Rômulo Alves committed on 5/6/2018, 11:03:50 AMParent: 1c565fd835e560d9649f1839715e501895e84f77
Files changed
components/page.js | changed |
package.json | changed |
static/manifest.json | added |
yarn.lock | changed |
components/page.js | ||
---|---|---|
@@ -1,18 +1,25 @@ | ||
1 | 1 … | import Head from 'next/head'; |
2 … | +import Router from 'next/router'; | |
3 … | +import NProgress from 'nprogress'; | |
2 | 4 … | import { |
3 | 5 … | node, |
4 | 6 … | string |
5 | 7 … | } from 'prop-types'; |
6 | 8 … | |
9 … | +Router.onRouteChangeStart = () => NProgress.start(); | |
10 … | +Router.onRouteChangeComplete = () => NProgress.done(); | |
11 … | +Router.onRouteChangeError = () => NProgress.done(); | |
12 … | + | |
7 | 13 … | const Page = ({ children, pageTitle }) => ( |
8 | 14 … | <div> |
9 | 15 … | <Head> |
10 | 16 … | <meta charSet="utf-8" /> |
11 | 17 … | <meta httpEquiv="X-UA-Compatible" content="IE=edge" /> |
12 | 18 … | <meta name="description" content="@romuloalves - Software Developer" /> |
13 | 19 … | <meta name="viewport" content="width=device-width, initial-scale=1.0" /> |
14 | 20 … | <link rel="icon" type="image/png" href="/static/favicon.png" /> |
21 … | + <link rel="manifest" href="/static/manifest.json" /> | |
15 | 22 … | <title> |
16 | 23 … | { `@romuloalves${pageTitle ? ` – ${pageTitle}` : ''}` } |
17 | 24 … | </title> |
18 | 25 … | </Head> |
@@ -40,8 +47,32 @@ | ||
40 | 47 … | } |
41 | 48 … | a:hover { |
42 | 49 … | color: #81D4FA; |
43 | 50 … | } |
51 … | + | |
52 … | + /* loading progress bar styles */ | |
53 … | + #nprogress { | |
54 … | + pointer-events: none; | |
55 … | + } | |
56 … | + #nprogress .bar { | |
57 … | + background: #22BAD9; | |
58 … | + position: fixed; | |
59 … | + z-index: 1031; | |
60 … | + top: 0; | |
61 … | + left: 0; | |
62 … | + width: 100%; | |
63 … | + height: 2px; | |
64 … | + } | |
65 … | + #nprogress .peg { | |
66 … | + display: block; | |
67 … | + position: absolute; | |
68 … | + right: 0px; | |
69 … | + width: 100px; | |
70 … | + height: 100%; | |
71 … | + box-shadow: 0 0 10px #22BAD9, 0 0 5px #22BAD9; | |
72 … | + opacity: 1.0; | |
73 … | + transform: rotate(3deg) translate(0px, -4px); | |
74 … | + } | |
44 | 75 … | `}</style> |
45 | 76 … | </div> |
46 | 77 … | ); |
47 | 78 … |
package.json | ||
---|---|---|
@@ -4,8 +4,9 @@ | ||
4 | 4 … | "description": "Rômulo Alves website", |
5 | 5 … | "dependencies": { |
6 | 6 … | "@zeit/next-preact": "^0.0.7", |
7 | 7 … | "next": "^6.0.0", |
8 … | + "nprogress": "^0.2.0", | |
8 | 9 … | "preact": "^8.2.9", |
9 | 10 … | "preact-compat": "^3.18.0", |
10 | 11 … | "prop-types": "^15.6.1", |
11 | 12 … | "react": "^16.3.2", |
static/manifest.json | ||
---|---|---|
@@ -1,0 +1,5 @@ | ||
1 … | +{ | |
2 … | + "short_name": "romuloalves", | |
3 … | + "name": "Rômulo Alves Website", | |
4 … | + "start_url": "/" | |
5 … | +} |
yarn.lock | ||
---|---|---|
The diff is too large to show. Use a local git client to view these changes. Old file size: 162069 bytes New file size: 151083 bytes |
Built with git-ssb-web