aboutsummaryrefslogtreecommitdiff
path: root/viewer/src/views/SplashScreen.vue
diff options
context:
space:
mode:
Diffstat (limited to 'viewer/src/views/SplashScreen.vue')
-rw-r--r--viewer/src/views/SplashScreen.vue75
1 files changed, 75 insertions, 0 deletions
diff --git a/viewer/src/views/SplashScreen.vue b/viewer/src/views/SplashScreen.vue
new file mode 100644
index 0000000..c6c2d09
--- /dev/null
+++ b/viewer/src/views/SplashScreen.vue
@@ -0,0 +1,75 @@
1<!-- ldgallery - A static generator which turns a collection of tagged
2-- pictures into a searchable web gallery.
3--
4-- Copyright (C) 2019-2022 Guillaume FOUET
5--
6-- This program is free software: you can redistribute it and/or modify
7-- it under the terms of the GNU Affero General Public License as
8-- published by the Free Software Foundation, either version 3 of the
9-- License, or (at your option) any later version.
10--
11-- This program is distributed in the hope that it will be useful,
12-- but WITHOUT ANY WARRANTY; without even the implied warranty of
13-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14-- GNU Affero General Public License for more details.
15--
16-- You should have received a copy of the GNU Affero General Public License
17-- along with this program. If not, see <https://www.gnu.org/licenses/>.
18-->
19
20<template>
21 <LdLoading v-if="isFetching" />
22 <div
23 v-else-if="!error && data"
24 :class="$style.splashscreen"
25 class="scrollbar"
26 >
27 <LdMarkdown
28 :style="config.style"
29 class="flex-grow-1"
30 :markdown="data"
31 />
32 <button
33 tabindex="1"
34 autofocus
35 @click="emit('validation')"
36 >
37 {{ buttonAcknowledgeLabel }}
38 </button>
39 </div>
40</template>
41
42<script setup lang="ts">
43import { LdMarkdown } from '@/components/async';
44import LdLoading from '@/components/LdLoading.vue';
45import { useLdFetch } from '@/services/api/ldFetch';
46import { useUiStore } from '@/store/uiStore';
47import { computed, readonly } from 'vue';
48import { useI18n } from 'vue-i18n';
49
50const emit = defineEmits(['validation']);
51
52const { t } = useI18n();
53const uiStore = useUiStore();
54
55const config = readonly(uiStore.splashScreenConfig ?? {});
56
57const buttonAcknowledgeLabel = computed(() => config.buttonAcknowledgeLabel ?? t('splashScreen.button.acknowledge'));
58const itemResourceUrl = computed(() => `${process.env.VUE_APP_DATA_URL}${config.resource}?${config.acknowledgmentKey ?? ''}`);
59
60const { isFetching, data, error } = useLdFetch(itemResourceUrl).text();
61</script>
62
63<style lang="scss" module>
64.splashscreen {
65 display: flex;
66 flex-flow: column;
67 align-items: center;
68 padding: 32px;
69
70 button {
71 font-size: 1.5rem;
72 margin-top: 1em;
73 }
74}
75</style>