1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
|
<script lang="ts">
import {defineComponent, PropType} from 'vue';
import CloseIcon from './icon/CloseIcon.vue';
export default defineComponent({
props: {
pos: {type: Array as unknown as PropType<[number,number]>, required: true},
dims: {type: Array as unknown as PropType<[number,number]>, required: true},
uiOpts: {type: Object, required: true},
},
data(){
return {
stage: 0,
};
},
computed: {
styles(): Record<string,string> {
return {
position: 'absolute',
left: this.pos[0] + 'px',
top: this.pos[1] + 'px',
width: this.dims[0] + 'px',
height: this.dims[1] + 'px',
backgroundColor: this.uiOpts.tutorialPaneBgColor,
color: this.uiOpts.tutorialPaneTextColor,
};
},
},
methods: {
onCloseClick(evt: Event){
this.$emit('tutorial-close');
},
onTutorialStart(){
console.log("Start tutorial");
},
},
components: {CloseIcon, },
emits: ['tutorial-close', ],
});
</script>
<template>
<div :style="styles">
<close-icon @click.stop="onCloseClick" ref="closeIcon"
class="block absolute top-2 right-2 w-6 h-6 hover:cursor-pointer"/>
<div v-if="stage == 0" class="h-full flex flex-col justify-evenly">
<h1 class="px-4 text-center text-xl font-bold">Welcome</h1>
<div class="px-4 max-w-[15cm] mx-auto text-sm">
Lorem ipsum dolor sit amet, consectetur adipiscing
elit, sed do eiusmod tempor incididunt ut labore
et dolore magna aliqua. Ut enim ad minim veniam,
quis nostrud exercitation ullamco.
</div>
<div class="w-full flex justify-evenly">
<div>
<button class="w-full h-full px-4 py-2 rounded bg-stone-800 hover:bg-stone-700"
@click="onTutorialStart">
Start Tutorial
</button>
</div>
<div>
<button class="w-full h-full px-4 py-2 rounded bg-stone-800 hover:bg-stone-700"
@click="onCloseClick">
Continue
</button>
</div>
</div>
</div>
</div>
</template>
|