From 4b3e2dee521dbd3ced6a1c74a09bdad7e4f93a1d Mon Sep 17 00:00:00 2001 From: Terry Truong Date: Mon, 23 May 2022 18:41:20 +1000 Subject: Add tutorial stages, with prev/next buttons --- src/components/TutorialPane.vue | 117 ++++++++++++++++++++++++++++++++-------- 1 file changed, 94 insertions(+), 23 deletions(-) diff --git a/src/components/TutorialPane.vue b/src/components/TutorialPane.vue index 97bb4cd..e027857 100644 --- a/src/components/TutorialPane.vue +++ b/src/components/TutorialPane.vue @@ -11,6 +11,7 @@ export default defineComponent({ data(){ return { stage: 0, + maxStage: 10, }; }, computed: { @@ -25,13 +26,30 @@ export default defineComponent({ color: this.uiOpts.tutorialPaneTextColor, }; }, + tutContentStyles(): Record { + return { + padding: '0 0.5cm', + maxWidth: '15cm', + margin: '0 auto', + fontSize: 'small', + overflow: 'auto', + }; + }, + buttonStyles(): Record { + return { + display: 'block', + padding: '8px 16px', + borderRadius: '5px', + backgroundColor: '#292524', + }; + }, }, methods: { - onCloseClick(evt: Event){ - this.$emit('tutorial-close'); + onPrevClick(){ + this.stage = Math.max(1, this.stage - 1); }, - onTutorialStart(){ - console.log("Start tutorial"); + onNextClick(){ + this.stage = Math.min(this.maxStage, this.stage + 1); }, }, components: {CloseIcon, }, @@ -40,31 +58,84 @@ export default defineComponent({ -- cgit v1.2.3