From ddb38fc873d6bbce5a69d059237374e6ab23422f Mon Sep 17 00:00:00 2001 From: Terry Truong Date: Wed, 25 Jan 2023 19:39:09 +1100 Subject: Add intro modal --- src/App.vue | 15 ++++++++++ src/components/HelpModal.vue | 12 ++------ src/components/IntroModal.vue | 68 +++++++++++++++++++++++++++++++++++++++++++ src/lib.ts | 2 +- src/store.ts | 2 ++ 5 files changed, 89 insertions(+), 10 deletions(-) create mode 100644 src/components/IntroModal.vue (limited to 'src') diff --git a/src/App.vue b/src/App.vue index f807836..c258b0d 100644 --- a/src/App.vue +++ b/src/App.vue @@ -59,6 +59,9 @@ + + + @@ -74,6 +77,7 @@ import InfoModal from './components/InfoModal.vue'; import SearchModal from './components/SearchModal.vue'; import SettingsModal from './components/SettingsModal.vue'; import HelpModal from './components/HelpModal.vue'; +import IntroModal from './components/IntroModal.vue'; import LoadingModal from './components/LoadingModal.vue'; import IconButton from './components/IconButton.vue'; @@ -421,6 +425,17 @@ function onSettingChg(option: string){ const helpOpen = ref(false); +// ========== For intro modal ========== + +const showIntro = ref(!store.introSkip); +function onCloseIntro(){ + showIntro.value = false; + if (store.introSkip == false){ + store.introSkip = true; + store.save('introSkip'); + } +} + // ========== For loading modal ========== const SERVER_WAIT_MSG = 'Loading data'; diff --git a/src/components/HelpModal.vue b/src/components/HelpModal.vue index 64df474..0aed405 100644 --- a/src/components/HelpModal.vue +++ b/src/components/HelpModal.vue @@ -5,12 +5,6 @@

Help

-

- This is an interactive historical timeline, displaying events from - {{dateToDisplayStr(MIN_DATE)}} to {{dateToDisplayStr(MAX_DATE)}}. - {{touchDevice ? 'Drag the screen' : 'Scroll or press ' + (vert ? 'up/down': 'left/right')}} to pan. - {{touchDevice ? 'Pinch' : 'Hold shift'}} to zoom. -