11import { driver , type Driver } from "driver.js" ;
22
3- document . getElementById ( "help-button" ) . addEventListener ( "click" , ( ) => {
4- driverInitialIntro . drive ( ) ;
5- } ) ;
3+ export function introFirsttimeInit ( ) : void {
4+ const flagKeyFirsttime : string = "pitch-flagKeyFirsttime" ;
5+
6+ document . getElementById ( "help-button" ) . addEventListener ( "click" , ( ) => {
7+ driverFirsttime . drive ( ) ;
8+ } ) ;
9+
10+ const driverFirsttime : Driver = driver ( {
11+ showProgress : true ,
12+ overlayOpacity : 1.0 ,
13+ allowClose : false ,
14+ steps : [
15+ { popover : {
16+ align : "center" ,
17+ description : `
18+ <div class="intro-popover">
19+ <img src="./pitch-logo.svg" class="pitch-logo">
20+ Welcome to Pitch.
21+ <br>
22+ CSS components and tweaks, designed specifically for your itch.io project pages.
23+ </div>` ,
24+ } } ,
25+ { element : "#components-list" , popover : {
26+ title : "find ur perfec components" ,
27+ description : `
28+ Click on the component's name to see
29+ live preview and its HTML codes.
30+ ` ,
31+ side : "right" ,
32+ align : "center" ,
33+ } } ,
34+ { element : "#components-list > .onboard-check-dummy" , popover : {
35+ title : "Add the components" ,
36+ description : `
37+ Tick the checkbox to add it to your selection.
38+ ` ,
39+ side : "right" ,
40+ align : "center" ,
41+ } } ,
42+ { element : "#compile-components-btn" , popover : {
43+ title : "Copy the CSS" ,
44+ description : `
45+ Copy the CSS codes of your selected components.
46+ ` ,
47+ side : "top" ,
48+ align : "end" ,
49+ } } ,
50+ { element : "#show-css-btn" , popover : {
51+ title : "Can't copy the CSS?" ,
52+ description : `
53+ Click here, and copy the CSS codes manually, if you're unable to copy it via the button.
54+ ` ,
55+ side : "top" ,
56+ align : "end" ,
57+ } } ,
58+ { element : ".theme-selector-container" , popover : {
59+ title : "Theme preview" ,
60+ description : `
61+ The components are designed to adapt to your page's theme.
62+ Click on the various theme preset to see how they would look on different themes.
63+ ` ,
64+ side : "bottom" ,
65+ align : "end" ,
66+ } } ,
67+ { element : "#help-button" , popover : {
68+ title : "Help" ,
69+ description : `
70+ Click on this button to re-run this guide again.
71+ ` ,
72+ side : "bottom" ,
73+ align : "end" ,
74+ } } ,
75+ ] ,
76+ } ) ;
77+
78+ if ( localStorage . getItem ( flagKeyFirsttime ) === null ) {
79+ driverFirsttime . drive ( ) ;
80+ localStorage . setItem ( flagKeyFirsttime , "" ) ;
81+ }
82+ }
83+
84+ // Tweaks-related info
85+
86+ export const flagKeyTweaksfirsttime : string = "pitch-flagKeyTweaksfirsttime" ;
687
7- const driverInitialIntro : Driver = driver ( {
8- showProgress : true ,
88+ export const driverTweaksfirsttimeGet : ( ) => Driver = ( ) : Driver => driver ( {
89+ showProgress : false ,
990 overlayOpacity : 1.0 ,
10- allowClose : false ,
91+ allowClose : true ,
1192 steps : [
1293 { popover : {
1394 align : "center" ,
1495 description : `
15- <div class="intro-popover">
16- <img src="./pitch-logo.svg" class="pitch-logo">
17- Welcome to Pitch.
18- <br>
19- CSS components and tweaks, designed specifically for your itch.io project pages.
96+ <div class="tweaks-intro">
97+ <h1>Here be dragons!</h1>
98+ <p>
99+ Pitch's Tweaks relies on itch.io's HTML structures,
100+ which can change in the future if the site got updated, and might possibly breaks the Tweaks' functionalities!!
101+ </p>
102+ <p>
103+ We'll keep you updated if there's breaking changes, and update the Tweaks as soon as possible.
104+ </p>
105+ <p>
106+ Follow the project, so you won't miss it!!
107+ </p>
20108 </div>` ,
21109 } } ,
22- { element : "#components-list" , popover : {
23- title : "find ur perfec components" ,
24- description : `
25- Click on the component's name to see
26- live preview and its HTML codes.
27- ` ,
28- side : "right" ,
29- align : "center" ,
30- } } ,
31- { element : "#components-list > .onboard-check-dummy" , popover : {
32- title : "Add the components" ,
33- description : `
34- Tick the checkbox to add it to your selection.
35- ` ,
36- side : "right" ,
37- align : "center" ,
38- } } ,
39- { element : "#compile-components-btn" , popover : {
40- title : "Copy the CSS" ,
41- description : `
42- Copy the CSS codes of your selected components.
43- ` ,
44- side : "top" ,
45- align : "end" ,
46- } } ,
47- { element : "#show-css-btn" , popover : {
48- title : "Can't copy the CSS?" ,
49- description : `
50- Click here, and copy the CSS codes manually, if you're unable to copy it via the button.
51- ` ,
52- side : "top" ,
53- align : "end" ,
54- } } ,
55- { element : ".theme-selector-container" , popover : {
56- title : "Theme preview" ,
57- description : `
58- The components are designed to adapt to your page's theme.
59- Click on the various theme preset to see how they would look on different themes.
60- ` ,
61- side : "bottom" ,
62- align : "end" ,
63- } } ,
64- { element : "#help-button" , popover : {
65- title : "Help" ,
66- description : `
67- Click on this button to re-run this guide again.
68- ` ,
69- side : "bottom" ,
70- align : "end" ,
71- } } ,
72110 ] ,
73111} ) ;
74-
75- const introFlagKey : string = "pitchIntroFinished" ;
76-
77- if ( localStorage . getItem ( introFlagKey ) === null ) {
78- driverInitialIntro . drive ( ) ;
79- localStorage . setItem ( introFlagKey , "" ) ;
80- }
0 commit comments