Ver código fonte

NProgress

master
Archie 2 meses atrás
pai
commit
73d8de8c4d
4 arquivos alterados com 41 adições e 0 exclusões
  1. +1
    -0
      package.json
  2. +28
    -0
      src/nprogress.css
  3. +7
    -0
      src/pages/_app.js
  4. +5
    -0
      yarn.lock

+ 1
- 0
package.json Ver arquivo

@ -15,6 +15,7 @@
"moment": "^2.27.0",
"next": "^9.5.2",
"next-cookies": "^2.0.3",
"nprogress": "^0.2.0",
"postcss-preset-env": "^6.7.0",
"react": "^16.13.1",
"react-dom": "^16.13.1",

+ 28
- 0
src/nprogress.css Ver arquivo

@ -0,0 +1,28 @@
/*! purgecss start ignore */
#nprogress {
pointer-events: none;
}
#nprogress .bar {
background: rgb(var(--color-primary));
position: fixed;
z-index: 1031;
top: 0;
left: 0;
width: 100%;
height: 2px;
}
#nprogress .peg {
display: block;
position: absolute;
right: 0px;
width: 100px;
height: 100%;
box-shadow: 0 0 10px rgb(var(--color-primary)),
0 0 5px rgb(var(--color-primary));
opacity: 1;
transform: rotate(3deg) translate(0px, -4px);
}
/*! purgecss end ignore */

+ 7
- 0
src/pages/_app.js Ver arquivo

@ -2,9 +2,11 @@ import axios from "axios";
import App from "next/app";
import Router from "next/router";
import { UserContext } from "../utils/userContext";
import NProgress from "nprogress";
import cookies from "next-cookies";
import "@alleshq/reactants/dist/index.css";
import "../nprogress.css";
export default function app({ Component, pageProps, user }) {
return (
@ -64,3 +66,8 @@ app.getInitialProps = async (appContext) => {
return { ...props };
}
};
// Progress Bar
Router.events.on("routeChangeStart", () => NProgress.start());
Router.events.on("routeChangeComplete", () => NProgress.done());
Router.events.on("routeChangeError", () => NProgress.done());

+ 5
- 0
yarn.lock Ver arquivo

@ -3814,6 +3814,11 @@ npmlog@^4.0.1, npmlog@^4.1.2:
gauge "~2.7.3"
set-blocking "~2.0.0"
nprogress@^0.2.0:
version "0.2.0"
resolved "https://registry.yarnpkg.com/nprogress/-/nprogress-0.2.0.tgz#cb8f34c53213d895723fcbab907e9422adbcafb1"
integrity sha1-y480xTIT2JVyP8urkH6UIq28r7E=
num2fraction@^1.2.2:
version "1.2.2"
resolved "https://registry.yarnpkg.com/num2fraction/-/num2fraction-1.2.2.tgz#6f682b6a027a4e9ddfa4564cd2589d1d4e669ede"

Carregando…
Cancelar
Salvar