Skip to content

Commit fc0fbc4

Browse files
Merge pull request #3 from laravel-frontend-presets/feature/default-nprogress-theme
Add default styles for nprogress
2 parents 3cf067e + 0858794 commit fc0fbc4

File tree

3 files changed

+92
-0
lines changed

3 files changed

+92
-0
lines changed

src/InertiaJsPreset.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,9 @@ protected static function updateBootstrapping()
3636
copy(__DIR__.'/inertiajs-stubs/webpack.mix.js', base_path('webpack.mix.js'));
3737

3838
copy(__DIR__.'/inertiajs-stubs/resources/js/app.js', resource_path('js/app.js'));
39+
40+
copy(__DIR__.'/inertiajs-stubs/resources/sass/app.scss', resource_path('sass/app.scss'));
41+
copy(__DIR__.'/inertiajs-stubs/resources/sass/_nprogress.scss', resource_path('sass/_nprogress.scss'));
3942
}
4043

4144
protected static function updateWelcomePage()
Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
/* Make clicks pass-through */
2+
#nprogress {
3+
pointer-events: none;
4+
}
5+
6+
#nprogress .bar {
7+
background: #29d;
8+
9+
position: fixed;
10+
z-index: 1031;
11+
top: 0;
12+
left: 0;
13+
14+
width: 100%;
15+
height: 2px;
16+
}
17+
18+
/* Fancy blur effect */
19+
#nprogress .peg {
20+
display: block;
21+
position: absolute;
22+
right: 0px;
23+
width: 100px;
24+
height: 100%;
25+
box-shadow: 0 0 10px #29d, 0 0 5px #29d;
26+
opacity: 1.0;
27+
28+
-webkit-transform: rotate(3deg) translate(0px, -4px);
29+
-ms-transform: rotate(3deg) translate(0px, -4px);
30+
transform: rotate(3deg) translate(0px, -4px);
31+
}
32+
33+
/* Remove these to get rid of the spinner */
34+
#nprogress .spinner {
35+
display: block;
36+
position: fixed;
37+
z-index: 1031;
38+
top: 15px;
39+
right: 15px;
40+
}
41+
42+
#nprogress .spinner-icon {
43+
width: 18px;
44+
height: 18px;
45+
box-sizing: border-box;
46+
47+
border: solid 2px transparent;
48+
border-top-color: #29d;
49+
border-left-color: #29d;
50+
border-radius: 50%;
51+
52+
-webkit-animation: nprogress-spinner 400ms linear infinite;
53+
animation: nprogress-spinner 400ms linear infinite;
54+
}
55+
56+
.nprogress-custom-parent {
57+
overflow: hidden;
58+
position: relative;
59+
}
60+
61+
.nprogress-custom-parent #nprogress .spinner,
62+
.nprogress-custom-parent #nprogress .bar {
63+
position: absolute;
64+
}
65+
66+
@-webkit-keyframes nprogress-spinner {
67+
0% { -webkit-transform: rotate(0deg); }
68+
100% { -webkit-transform: rotate(360deg); }
69+
}
70+
@keyframes nprogress-spinner {
71+
0% { transform: rotate(0deg); }
72+
100% { transform: rotate(360deg); }
73+
}
74+
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
2+
// Fonts
3+
@import url('https://fonts.googleapis.com/css?family=Nunito');
4+
5+
// Variables
6+
@import 'variables';
7+
@import 'nprogress';
8+
9+
// Bootstrap
10+
@import '~bootstrap/scss/bootstrap';
11+
12+
.navbar-laravel {
13+
background-color: #fff;
14+
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.04);
15+
}

0 commit comments

Comments
 (0)