Skip to content

Commit 89d6c98

Browse files
committed
Auto merge of #2481 - Turbo87:progress, r=pichfl
Replace "Loading..." screen with progress bar at the top of the page <img width="1440" alt="Bildschirmfoto 2020-05-01 um 19 15 46" src="https://user-images.githubusercontent.com/141300/80825365-80ea5f00-8be0-11ea-9717-6ad6f476a00b.png"> Implemented via https://github.com/tigressbailey/ember-cli-page-progress r? @pichfl
2 parents dc9bdd5 + c0d87fe commit 89d6c98

File tree

8 files changed

+38
-15
lines changed

8 files changed

+38
-15
lines changed

app/routes/application.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import { inject as service } from '@ember/service';
44
export default Route.extend({
55
flashMessages: service(),
66
googleCharts: service(),
7+
pageProgress: service(),
78
session: service(),
89

910
beforeModel() {
@@ -15,6 +16,13 @@ export default Route.extend({
1516
},
1617

1718
actions: {
19+
loading(transition) {
20+
let { pageProgress } = this;
21+
pageProgress.start(transition.targetName);
22+
transition.promise.finally(() => pageProgress.done());
23+
return true;
24+
},
25+
1826
didTransition() {
1927
this.flashMessages.step();
2028
},

app/styles/application.module.css

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
--link-color: rgb(0, 172, 91);
1818
--link-hover-color: #007940;
1919
--separator-color: #284725;
20+
--yellow: #ffc833;
2021
}
2122

2223
:global(.new-design) {
@@ -47,6 +48,20 @@ body {
4748
align-items: center;
4849
}
4950

51+
:global(.page-progress) {
52+
position: fixed;
53+
pointer-events: none;
54+
55+
:global(.bar) {
56+
position: fixed;
57+
left: 0;
58+
width: 0;
59+
height: 3px;
60+
box-shadow: 0 0 10px rgba(0, 13, 41, 0.8);
61+
background: var(--yellow) !important;
62+
}
63+
}
64+
5065
h1 {
5166
@media only screen and (max-width: 400px) {
5267
font-size: 1.5em;

app/styles/loading.module.css

Lines changed: 0 additions & 12 deletions
This file was deleted.

app/templates/application.hbs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
{{title "crates.io: Rust Package Registry" separator=' - ' prepend=true}}
44

5+
<PageProgress/>
56
<Header/>
67

78
<main local-class="main">

app/templates/loading.hbs

Lines changed: 0 additions & 3 deletions
This file was deleted.

ember-cli-build.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,9 @@ module.exports = function (defaults) {
3434
before: [require('postcss-nested')],
3535
},
3636
},
37+
'ember-cli-page-progress': {
38+
includeCss: false,
39+
},
3740
fingerprint: {
3841
extensions: ['js', 'css', 'png', 'jpg', 'gif', 'map', 'svg', 'ttf', 'woff', 'woff2'],
3942
},

package-lock.json

Lines changed: 10 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@
6464
"ember-cli-meta-tags": "^6.0.0",
6565
"ember-cli-mirage": "^1.1.6",
6666
"ember-cli-moment-shim": "^3.7.1",
67+
"ember-cli-page-progress": "^2.0.0",
6768
"ember-cli-sri": "2.1.1",
6869
"ember-cli-uglify": "^3.0.0",
6970
"ember-click-outside": "^1.3.0",

0 commit comments

Comments
 (0)