Browse Source

mobile loader

master
gsd 2 years 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.$API.load().then(() => {
this.l = this.$API.loading; this.l = this.$API.loading;
this.f = this.$API.failed; this.f = this.$API.failed;
console.log('s', this.l,this.f);
}).catch(() => { }).catch(() => {
console.log('e', this.l,this.f); console.log('e', this.l,this.f);
}) })

1
src/api/AdminApi.js

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

8
src/api/GlobalApi.js

@ -31,6 +31,7 @@ export default class GlobalApi {
load_stages = new Stages(); load_stages = new Stages();
constructor() { constructor() {
document.title = "Факты 13";
} }
async fillThis(value) { async fillThis(value) {
@ -78,6 +79,7 @@ export default class GlobalApi {
async load() { async load() {
this.loading = true; this.loading = true;
document.title = `Загрузка - Факты 13`;
await Promise.all( await Promise.all(
[this.fillThis('statistic'), [this.fillThis('statistic'),
this.fillThis('uniq'), this.fillThis('uniq'),
@ -85,12 +87,14 @@ export default class GlobalApi {
this.admin.load(this.load_stages), this.admin.load(this.load_stages),
this.player.load(this.load_stages)] this.player.load(this.load_stages)]
).then(() => { ).then(() => {
console.log("end loading"); console.log("[Loader] success end");
this.loading = false; this.loading = false;
document.title = `Факты 13`;
}).catch(() => { }).catch(() => {
this.loading = false; this.loading = false;
this.failed = true; 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; 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> <template>
<md-dialog :md-active.sync="this.l" class="bbb"> <md-dialog :md-active.sync="this.l" class="bbb">
<md-progress-spinner :md-diameter="200" :md-stroke="10" md-mode="indeterminate"/> <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> <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> </md-dialog>
</template> </template>
@ -23,7 +23,7 @@ export default {
<style> <style>
.md-progress-spinner { .md-progress-spinner {
stroke: #fd8846 !important; stroke: #fd8846 !important;
margin: 60px; margin: 90px;
} }
.bbb { .bbb {

Loading…
Cancel
Save