11<template >
22 <div class =" main" >
3- <p class =" header" >{{ t('welcome.message') }}</p >
4- <p class =" description" v-html =" t('welcome.description')" ></p >
5- <img class =" img" src =" ../assets/initial.jpg" height =" 250" />
6- <div class =" steps" >
7- <p class =" header" >{{ t('getStarted.message') }}</p >
8- <p class =" description" >{{ t('welcomeStart.message') }}</p >
9- <p class =" step" >1. {{ t('pinIcon.message') }}</p >
10- <p class =" description" >
11- {{ t('pinIconPart1.message') }}
12- <img src =" ../assets/icons/extension.svg" height =" 25" /> {{ t('pinIconPart2.message') }}
13- <img src =" ../assets/icons/pin.svg" height =" 25" />
14- </p >
15- <img class =" img" src =" ../assets/pin-tutorial.png" height =" 250" />
16- <p class =" step" >2. {{ t('browse.message') }}</p >
17- <p class =" description" >
18- {{ t('browse.description') }}
19- <img src =" ../assets/icons/icon.png" height =" 35" />
20- </p >
21- <p class =" step" >3.{{ t('seeData.message') }}</p >
22- <p class =" description mt-20" >
23- {{ t('seeData.description') }}
24- </p >
25- <div class =" btn-block" >
26- <button class =" close" @click =" close()" >{{ t('close.message') }}</button >
27- <button @click =" openDashboard()" >{{ t('useExtension.message') }}</button >
3+ <template v-if =" step == WelcomeStep .InitialView " >
4+ <div class =" initial-block" >
5+ <p class =" header" >{{ t('welcome.message') }}</p >
6+ <img class =" img" src =" ../assets/initial.jpg" height =" 250" />
7+ <p class =" description" v-html =" t('welcome.description')" ></p >
8+ <div class =" next-btn" >
9+ <button @click =" nextStep()" >{{ t('next.message') }}</button >
10+ </div >
2811 </div >
29- </div >
12+ </template >
13+ <template v-if =" step == WelcomeStep .Tutorial " >
14+ <div class =" steps" >
15+ <p class =" header" >{{ t('getStarted.message') }}</p >
16+ <p class =" description" >{{ t('welcomeStart.message') }}</p >
17+ <p class =" step" >1. {{ t('pinIcon.message') }}</p >
18+ <p class =" description" >
19+ {{ t('pinIconPart1.message') }}
20+ <img src =" ../assets/icons/extension.svg" height =" 25" /> {{ t('pinIconPart2.message') }}
21+ <img src =" ../assets/icons/pin.svg" height =" 25" />
22+ </p >
23+ <img class =" img" src =" ../assets/pin-tutorial.png" height =" 250" />
24+ <p class =" step" >2. {{ t('browse.message') }}</p >
25+ <p class =" description" >
26+ {{ t('browse.description') }}
27+ <img src =" ../assets/icons/icon.png" height =" 35" />
28+ </p >
29+ <p class =" step" >3. {{ t('seeData.message') }}</p >
30+ <p class =" description mt-20" >
31+ {{ t('seeData.description') }}
32+ </p >
33+ <div class =" btn-block" >
34+ <button class =" close" @click =" close()" >{{ t('close.message') }}</button >
35+ <button @click =" openDashboard()" >{{ t('useExtension.message') }}</button >
36+ </div >
37+ </div >
38+ </template >
3039 </div >
3140</template >
3241
3342<script lang="ts" setup>
43+ import { onMounted , ref } from ' vue' ;
3444import { useI18n } from ' vue-i18n' ;
3545import Browser from ' webextension-polyfill' ;
3646
3747const { t } = useI18n ();
3848
49+ enum WelcomeStep {
50+ InitialView ,
51+ Tutorial ,
52+ }
53+
54+ const step = ref <WelcomeStep >();
55+
56+ onMounted (() => {
57+ step .value = WelcomeStep .InitialView ;
58+ });
59+
60+ function nextStep() {
61+ step .value = WelcomeStep .Tutorial ;
62+ }
63+
3964async function close() {
4065 const currentTab = await Browser .tabs .getCurrent ();
4166 await Browser .tabs .remove (currentTab .id ! );
@@ -52,17 +77,19 @@ async function openDashboard() {
5277.main {
5378 margin : auto ;
5479 text-align : center ;
55- margin-top : 20px ;
56- width : 80% ;
80+ width : 60% ;
5781 height : 100% ;
5882}
83+ .initial-block {
84+ margin-top : 20% ;
85+ }
5986
6087.header {
6188 font-size : 26px ;
62- font-weight : 600 ;
89+ font-weight : 700 ;
6390}
6491.img {
65- margin : 20px 0 0 0 ;
92+ margin : 20px 0 ;
6693}
6794.description {
6895 font-size : 18px ;
@@ -73,6 +100,9 @@ async function openDashboard() {
73100.description img {
74101 margin : 0 10px ;
75102}
103+ .steps {
104+ margin-top : 50px ;
105+ }
76106.steps .step {
77107 text-align : left ;
78108 font-size : 24px ;
@@ -85,6 +115,9 @@ async function openDashboard() {
85115.steps .description {
86116 margin : 20px ;
87117}
118+ .next-btn {
119+ margin-top : 40px ;
120+ }
88121
89122button .close {
90123 background : #c5c5c5 ;
0 commit comments