Skip to content

Commit 3d37364

Browse files
Multi-tutorial system: sci-fi restyle, hamburger menu, Tutorial 2
- Restyle Tutorial 2 (Celia's advanced interface tutorial) to match Tutorial 1's sci-fi theme: dark blue translucent bg, microchip corner traces, progress bar, step counter, fade-in animation, confetti, ENTER/SPACE keyboard nav, link styling - Add multi-tutorial infrastructure: separate step tracking per tutorial, activeTutorial switcher in Pinia store with localStorage persistence - Split tutorials: tutorial-1.ts (basics) and tutorial-2.ts (advanced) - Hamburger menu: Reset Tutorial 1, Reset Tutorial 2 (conditional), Advanced Interface Tutorial; all close menu on click - Fix crushed layer panel steps with more robust element selectors - Remove "fill out this form" badge step (badge awarded automatically) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 4b81c7e commit 3d37364

File tree

6 files changed

+1236
-456
lines changed

6 files changed

+1236
-456
lines changed

src/components/ExtensionBar.vue

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,16 @@ import { loginSession, useLoginStore } from "#src/store.js";
77
import logoGemImage from '#src/images/pyr-icon.png';
88
import logoTextImage from '#src/images/pyr-logo-wordmark.png';
99
import { useTutorialStore } from "#src/store-pyr.js";
10+
import { useDropdownListStore } from "#src/store.js";
1011
import { storeToRefs } from "pinia";
1112
1213
const login = useLoginStore();
13-
const { tutorialStep } = storeToRefs(useTutorialStore());
14+
const tutorialStore = useTutorialStore();
15+
const dropdownStore = useDropdownListStore();
16+
17+
function closeHamburger() {
18+
dropdownStore.activeDropdowns['extension-bar-right'] = undefined;
19+
}
1420
window.addEventListener("middleauthlogin", () => {
1521
login.update();
1622
});
@@ -90,8 +96,18 @@ function logout(session: loginSession) {
9096
<template #buttonTitle>☰</template>
9197
<template #listItems>
9298
<li>
93-
<div class="logoutButton button" @click="tutorialStep = 0">
94-
<span>Reset Tutorial</span>
99+
<div class="logoutButton button" @click="tutorialStore.activeTutorial = 1; tutorialStore.setTutorialStep(0); closeHamburger()">
100+
<span>Reset Tutorial 1</span>
101+
</div>
102+
</li>
103+
<li v-if="tutorialStore.tutorialStep2 >= 0">
104+
<div class="logoutButton button" @click="tutorialStore.activeTutorial = 2; tutorialStore.setTutorialStep(0); closeHamburger()">
105+
<span>Reset Tutorial 2</span>
106+
</div>
107+
</li>
108+
<li>
109+
<div class="logoutButton button" @click="tutorialStore.activeTutorial = 2; tutorialStore.setTutorialStep(0); closeHamburger()">
110+
<span>Advanced Interface Tutorial</span>
95111
</div>
96112
</li>
97113
<li>

src/components/Tutorial.vue

Lines changed: 18 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,38 +2,45 @@
22
import TutorialStep from "#src/components/TutorialStep.vue";
33
44
import { computed } from "vue";
5-
import { storeToRefs } from "pinia";
65
import { useTutorialStore } from "#src/store-pyr.js";
7-
import { steps } from "#src/tutorial-1.js";
8-
const { tutorialStep } = storeToRefs(useTutorialStore());
6+
import { steps as steps1 } from "#src/tutorial-1.js";
7+
import { steps as steps2 } from "#src/tutorial-2.js";
8+
const store = useTutorialStore();
99
10+
const steps = computed(() => store.activeTutorial === 1 ? steps1 : steps2);
11+
12+
const currentStep = computed(() =>
13+
store.activeTutorial === 1 ? store.tutorialStep1 : store.tutorialStep2
14+
);
1015
1116
const activeStep = computed(() => {
12-
const index = tutorialStep.value;
13-
if (index < steps.length) {
17+
const index = currentStep.value;
18+
if (index >= 0 && index < steps.value.length) {
1419
return {
1520
index: index,
16-
step: steps[index],
21+
step: steps.value[index],
1722
first: index === 0,
18-
last: index === steps.length - 1,
19-
23+
last: index === steps.value.length - 1,
2024
}
2125
} else {
2226
return null;
2327
}
2428
});
2529
30+
const next = () => { store.setTutorialStep(store.getTutorialStep() + 1); };
31+
const back = () => { store.setTutorialStep(Math.max(0, store.getTutorialStep() - 1)); };
2632
const exitIntro = () => {
2733
console.log('exiting intro!');
28-
tutorialStep.value = steps.length;
34+
store.setTutorialStep(steps.value.length);
2935
};
3036
3137
</script>
3238

3339
<template>
3440
<TutorialStep v-if="activeStep" :key="activeStep.index" :step="activeStep.step" :first="activeStep.first"
35-
:last="activeStep.last" v-on:next="tutorialStep = tutorialStep + 1"
36-
v-on:back="tutorialStep = Math.max(0, tutorialStep - 1)" v-on:exitIntro="exitIntro" />
41+
:last="activeStep.last" :stepIndex="activeStep.index" :totalSteps="steps.length"
42+
v-on:next="next"
43+
v-on:back="back" v-on:exitIntro="exitIntro" />
3744
</template>
3845

3946
<style scoped>

0 commit comments

Comments
 (0)