Browse Source

mobile loader

master
gsd 1 year ago
parent
commit
f14c3940e9
  1. 1
      src/App.vue
  2. 1
      src/api/AdminApi.js
  3. 8
      src/api/GlobalApi.js
  4. 4
      src/api/Stages.js
  5. BIN
      src/assets/sounds/right_behind_you.mp3
  6. 4
      src/components/Others/LoaderPage.vue

1
src/App.vue

@ -47,7 +47,6 @@ export default {
this.$API.load().then(() => {
this.l = this.$API.loading;
this.f = this.$API.failed;
console.log('s', this.l,this.f);
}).catch(() => {
console.log('e', this.l,this.f);
})

1
src/api/AdminApi.js

@ -19,7 +19,6 @@ export default class AdminApi {
async load(stages) {
console.log(`[AdminAPI] request permissions`);
console.log(document.cookie);
if (document.cookie.indexOf("steam64=") === -1) return;
stages.add("permitions")
await Promise.all([

8
src/api/GlobalApi.js

@ -31,6 +31,7 @@ export default class GlobalApi {
load_stages = new Stages();
constructor() {
document.title = "Факты 13";
}
async fillThis(value) {
@ -78,6 +79,7 @@ export default class GlobalApi {
async load() {
this.loading = true;
document.title = `Загрузка - Факты 13`;
await Promise.all(
[this.fillThis('statistic'),
this.fillThis('uniq'),
@ -85,12 +87,14 @@ export default class GlobalApi {
this.admin.load(this.load_stages),
this.player.load(this.load_stages)]
).then(() => {
console.log("end loading");
console.log("[Loader] success end");
this.loading = false;
document.title = `Факты 13`;
}).catch(() => {
this.loading = false;
this.failed = true;
console.log("some error in loading");
document.title = `Факты 13 УМЕРЛИ`;
console.log("[Loader] some error in loading");
});
}

4
src/api/Stages.js

@ -18,4 +18,8 @@ export default class Stages {
default: return s;
}
}
percent() {
return 100 - this.stages.length * 100 / 5;
}
}

BIN
src/assets/sounds/right_behind_you.mp3

Binary file not shown.

4
src/components/Others/LoaderPage.vue

@ -1,7 +1,7 @@
<template>
<md-dialog :md-active.sync="this.l" class="bbb">
<md-progress-spinner :md-diameter="200" :md-stroke="10" md-mode="indeterminate"/>
<h1 style="color: #fd8846">Загрузка</h1>
<h1 style="color: #fd8846; text-align: center">Загрузка</h1>
<p v-for="stage in this.$API.load_stages.stages" :key="stage" style="text-align: center; margin: 0%">{{$API.load_stages.human(stage)}}</p>
</md-dialog>
</template>
@ -23,7 +23,7 @@ export default {
<style>
.md-progress-spinner {
stroke: #fd8846 !important;
margin: 60px;
margin: 90px;
}
.bbb {

Loading…
Cancel
Save