Added loading spinner while page is loading

This commit is contained in:
Chris Kankiewicz
2020-12-30 15:21:59 -07:00
parent 45cc89cd45
commit 0b256827e7
2 changed files with 9 additions and 2 deletions

View File

@@ -5,6 +5,7 @@ const app = new Vue({
el: '#app',
components: { FileInfoModal },
data: () => ({
loading: true,
theme: 'light',
menuOpen: false,
}),
@@ -37,6 +38,8 @@ const app = new Vue({
this.$refs.scrollToTop.classList.add('hidden');
}
}.bind(this));
this.loading = false;
},
watch: {
theme: value => localStorage.setItem('theme', value),

View File

@@ -17,10 +17,14 @@
<title>{{ title }} &bull; Directory Lister</title>
<div id="app" v-bind:class="{ dark: darkMode }" v-cloak>
<div id="app" v-bind:class="{ dark: darkMode }">
<div class="flex flex-col min-h-screen font-sans dark:bg-gray-800">
{% block content %}{% endblock %}
</div>
<div class="fixed inset-0 flex flex-col justify-center items-center min-h-screen bg-gray-900 bg-opacity-90" v-show="loading">
<i class="fas fa-spinner fa-pulse fa-5x text-white"></i>
</div>
</div>
<script src="{{ asset('app.js') }}" defer></script>
<script src="{{ asset('app.js') }}"></script>