Skip to content

Commit

Permalink
Loader
Browse files Browse the repository at this point in the history
  • Loading branch information
dyakovri committed Apr 5, 2024
1 parent 44b6d80 commit 2dee279
Show file tree
Hide file tree
Showing 10 changed files with 54 additions and 11 deletions.
36 changes: 36 additions & 0 deletions src/components/FullscreenLoader.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
<script setup lang="ts"></script>

<template>
<div class="loader-container">
<div class="loader" />
</div>
</template>

<style>
.loader-container {
display: flex;
flex-direction: column;
flex: 1;
place-content: space-around center;
width: 100%;
height: 100%;
}
.loader-container > * {
margin: 16px auto;
}
.loader {
width: 60px;
aspect-ratio: 4;
background: radial-gradient(circle closest-side, #000 90%, #0000) 0 / calc(100% / 3) 100% space;
clip-path: inset(0 100% 0 0);
animation: l1 1s steps(4) infinite;
}
@keyframes l1 {
to {
clip-path: inset(0 -34% 0 0);
}
}
</style>
3 changes: 2 additions & 1 deletion src/views/apps/AppsView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import AsyncContent from './AsyncContent.vue';
import { computed } from 'vue';
import IrdomLayout from '@/components/IrdomLayout.vue';
import { useToolbar } from '@/store/toolbar';
import FullscreenLoader from '@/components/FullscreenLoader.vue';
const toolbar = useToolbar();
Expand All @@ -18,7 +19,7 @@ const version = computed(() => import.meta.env.VITE_APP_VERSION);
<Suspense>
<AsyncContent />

<template #fallback> Загрузка... </template>
<template #fallback> <FullscreenLoader /> </template>
</Suspense>
<span v-if="version" class="version">Версия приложения: {{ version }}</span>
</IrdomLayout>
Expand Down
3 changes: 2 additions & 1 deletion src/views/profile/ProfileView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import { useProfileStore } from '@/store/profile';
import { UserdataConverter } from '@/utils/UserdataConverter';
import { ToolbarActionItem } from '@/components/IrdomToolbar.vue';
import { useToolbar } from '@/store/toolbar';
import FullscreenLoader from '@/components/FullscreenLoader.vue';
const profileStore = useProfileStore();
const router = useRouter();
Expand Down Expand Up @@ -102,7 +103,7 @@ onMounted(async () => {
</section>
<section class="section">
<h2>Основная информация</h2>
<div v-if="userdataLoading">Загрузка...</div>
<FullscreenLoader v-if="userdataLoading" />
<div v-else>
<div v-for="{ name, data } of userdata" :key="name" class="userdata-section">
<div class="userdata-category">
Expand Down
2 changes: 1 addition & 1 deletion src/views/profile/achievement/AchievementsSlider.vue
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ onMounted(async () => {
</v-slide-group-item>
</v-slide-group>
<div v-else-if="!isLoaded">
<p>Загрузка...</p>
<p><FullscreenLoader /></p>
</div>
<div v-else>
<p>У тебя еще нет достижений в приложении :(</p>
Expand Down
3 changes: 2 additions & 1 deletion src/views/profile/sessions/ProfileSessionsView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import { useToolbar } from '@/store/toolbar';
import AsyncContent from './AsyncContent.vue';
import IrdomLayout from '@/components/IrdomLayout.vue';
import FullscreenLoader from '@/components/FullscreenLoader.vue';
const toolbar = useToolbar();
Expand All @@ -15,7 +16,7 @@ toolbar.setup({
<IrdomLayout>
<Suspense>
<AsyncContent />
<template #fallback> Загрузка... </template>
<template #fallback> <FullscreenLoader /> </template>
</Suspense>
</IrdomLayout>
</template>
3 changes: 2 additions & 1 deletion src/views/timetable/TimetableView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import { stringifyDate, getDateWithDayOffset } from '@/utils/date';
import { LocalStorage, LocalStorageItem } from '@/models/LocalStorage';
import IrdomLayout from '@/components/IrdomLayout.vue';
import { useToolbar } from '@/store/toolbar';
import FullscreenLoader from '@/components/FullscreenLoader.vue';
const router = useRouter();
const route = useRoute();
Expand Down Expand Up @@ -62,7 +63,7 @@ watch(date, () => {
<Suspense :key="key">
<AsyncEventsList :date="date" />

<template #fallback> Загрузка... </template>
<template #fallback> <FullscreenLoader /> </template>
</Suspense>
</IrdomLayout>
</template>
3 changes: 2 additions & 1 deletion src/views/timetable/event/TimetableEventView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import AsyncContent from './AsyncContent.vue';
import { useRoute } from 'vue-router';
import IrdomLayout from '@/components/IrdomLayout.vue';
import { useToolbar } from '@/store/toolbar';
import FullscreenLoader from '@/components/FullscreenLoader.vue';
const route = useRoute();
const toolbar = useToolbar();
Expand All @@ -19,7 +20,7 @@ toolbar.setup({
<Suspense>
<AsyncContent :id="+route.params.id" />

<template #fallback> Загрузка... </template>
<template #fallback> <FullscreenLoader /> </template>
</Suspense>
</IrdomLayout>
</template>
2 changes: 1 addition & 1 deletion src/views/timetable/init/TimetableInitView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ const sendMarketing = (e: Event) => {
<Suspense>
<AsyncGroupsList :query="query" />

<template #fallback> Загрузка... </template>
<template #fallback> <FullscreenLoader /> </template>
</Suspense>
</IrdomLayout>
</template>
Expand Down
5 changes: 3 additions & 2 deletions src/views/timetable/lecturer/TimetableLecturerView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import AsyncLecturerSchedule from './AsyncLecturerSchedule.vue';
import { useRoute } from 'vue-router';
import IrdomLayout from '@/components/IrdomLayout.vue';
import { useToolbar } from '@/store/toolbar';
import FullscreenLoader from '@/components/FullscreenLoader.vue';
const route = useRoute();
const toolbar = useToolbar();
Expand All @@ -19,15 +20,15 @@ toolbar.setup({
<IrdomLayout>
<Suspense>
<AsyncLecturerInfo :id="+route.params.id" />
<template #fallback> Загрузка... </template>
<template #fallback> <FullscreenLoader /> </template>
</Suspense>

<b class="date"
>Сегодня, {{ new Date().toLocaleDateString('ru-RU', { day: '2-digit', month: 'long' }) }}</b
>
<Suspense>
<AsyncLecturerSchedule :id="+route.params.id" />
<template #fallback>Загрузка...</template>
<template #fallback><FullscreenLoader /></template>
</Suspense>
</IrdomLayout>
</template>
Expand Down
5 changes: 3 additions & 2 deletions src/views/timetable/room/TimetableRoomView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import AsyncRoomInfo from './AsyncRoomInfo.vue';
import AsyncRoomSchedule from './AsyncRoomSchedule.vue';
import IrdomLayout from '@/components/IrdomLayout.vue';
import { useRoute } from 'vue-router';
import FullscreenLoader from '@/components/FullscreenLoader.vue';
const route = useRoute();
const toolbar = useToolbar();
Expand All @@ -21,7 +22,7 @@ toolbar.setup({
<Suspense>
<AsyncRoomInfo :id="+route.params.id" />

<template #fallback> Загрузка... </template>
<template #fallback> <FullscreenLoader /> </template>
</Suspense>
</section>

Expand All @@ -42,7 +43,7 @@ toolbar.setup({
</p>
<Suspense>
<AsyncRoomSchedule :id="+route.params.id" />
<template #fallback>Загрузка...</template>
<template #fallback><FullscreenLoader /></template>
</Suspense>
</section>
</IrdomLayout>
Expand Down

0 comments on commit 2dee279

Please sign in to comment.