1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-12-26 01:50:28 +00:00

Add tour plugin

This commit is contained in:
jeremy@jermolene.com 2023-01-16 19:56:39 +00:00
parent 5b9f464f26
commit f4f37460b8
14 changed files with 161 additions and 2 deletions

View File

@ -14,7 +14,8 @@
"tiddlywiki/dynannotate",
"tiddlywiki/codemirror",
"tiddlywiki/menubar",
"tiddlywiki/jszip"
"tiddlywiki/jszip",
"tiddlywiki/tour"
],
"themes": [
"tiddlywiki/vanilla",

View File

@ -7,7 +7,8 @@
"tiddlywiki/evernote",
"tiddlywiki/internals",
"tiddlywiki/menubar",
"tiddlywiki/confetti"
"tiddlywiki/confetti",
"tiddlywiki/tour"
],
"themes": [
"tiddlywiki/vanilla",

View File

@ -0,0 +1,6 @@
{
"title": "$:/plugins/tiddlywiki/tour",
"name": "Tour",
"description": "A tour of TiddlyWiki",
"list": "readme"
}

View File

@ -0,0 +1,2 @@
title: $:/plugins/tiddlywiki/tour/readme

View File

@ -0,0 +1,2 @@
title: $:/state/tour/step
text: $:/plugins/tiddlywiki/tour/steps/open-control-panel

View File

@ -0,0 +1,16 @@
title: $:/plugins/tiddlywiki/tour/steps/close-control-panel
tags: $:/tags/TourStep
! Close the control panel
Your task now is to close the control panel.
<$list filter="[[$:/StoryList]!contains[$:/ControlPanel]limit[1]]" variable="ignore">
<$confetti/>
Congratulations, you may proceed
<<tour-previous-step-button>> <<tour-next-step-button>>
</$list>

View File

@ -0,0 +1,16 @@
title: $:/plugins/tiddlywiki/tour/steps/create-tiddler
tags: $:/tags/TourStep
! Creating Tiddlers
Your task is to create and open a tiddler titled "Congratulations"
<$list filter="[list[$:/StoryList]match[Congratulations]]" variable="ignore">
<$confetti/>
Congratulations, you may proceed
<<tour-previous-step-button>> <<tour-next-step-button>>
</$list>

View File

@ -0,0 +1,12 @@
title: $:/plugins/tiddlywiki/tour/steps/finished
! Congratulations
<$confetti/>
<$confetti delay=100/>
<$confetti delay=200/>
<$confetti delay=300/>
<$confetti delay=400/>
<$confetti delay=500/>
You have completed the tour.

View File

@ -0,0 +1,18 @@
title: $:/plugins/tiddlywiki/tour/steps/open-control-panel
tags: $:/tags/TourStep
! Welcome to ~TiddlyWiki
This tour will guide you through the process of learning to use TiddlyWiki.
Your first task is to open the control panel.
<$list filter="[[$:/StoryList]contains[$:/ControlPanel]limit[1]]" variable="ignore">
<$confetti/>
Congratulations, you may proceed
<<tour-previous-step-button>> <<tour-next-step-button>>
</$list>

View File

@ -0,0 +1,20 @@
title: $:/plugins/tiddlywiki/tour/steps/recent
tags: $:/tags/TourStep
! Searching
Your task is to use the "Recent" tab of the sidebar to open the most recently editted tiddler.
<$let recentTiddler={{{ [all[tiddlers]!is[system]!sort[modified]] }}}>
<$list filter="[list[$:/StoryList]match<recentTiddler>]" variable="ignore">
<$confetti/>
Congratulations! You may now proceed
<<tour-previous-step-button>> <<tour-next-step-button>>
</$list>
</$let>

View File

@ -0,0 +1,16 @@
title: $:/plugins/tiddlywiki/tour/steps/search
tags: $:/tags/TourStep
! Searching
Your task is to search for the phrase "help".
<$list filter="[{$:/temp/search}match[help]]" variable="ignore">
<$confetti/>
Congratulations! You may now proceed
<<tour-previous-step-button>> <<tour-next-step-button>>
</$list>

View File

@ -0,0 +1,22 @@
title: $:/plugins/tiddlywiki/tour/styles
tags: $:/tags/Stylesheet
\rules only filteredtranscludeinline transcludeinline macrodef macrocallinline macrocallblock
.tc-tour-panel {
position: fixed;
bottom: 0;
left: 0;
width: 310px;
height: 400px;
overflow: auto;
-webkit-overflow-scrolling: touch;
<<box-shadow "0px 0px 5px rgba(0, 0, 0, 0.3)">>
box-shadow: inset 0 -40px 40px rgb(0 0 0 / 6%), inset 0 25px 10px rgb(0 0 0 / 9%), 0 5px 6px 5px rgb(0 0 0 / 7%);
border: 1px solid #ff8;
background: #ffa;
border-radius: 0em;
padding: 1em;
margin: 0.5em;
z-index: 1000;
}

View File

@ -0,0 +1,2 @@
title: $:/tags/TourStep
list: $:/plugins/tiddlywiki/tour/steps/open-control-panel $:/plugins/tiddlywiki/tour/steps/close-control-panel $:/plugins/tiddlywiki/tour/steps/search $:/plugins/tiddlywiki/tour/steps/recent $:/plugins/tiddlywiki/tour/steps/create-tiddler

View File

@ -0,0 +1,25 @@
title: $:/plugins/tiddlywiki/tour/panel
tags: $:/tags/PageTemplate
\define tour-previous-step-button()
<$button>
<$action-setfield $tiddler="$:/state/tour/step" $field="text" $value={{{ [all[shadows+tiddlers]tag[$:/tags/TourStep]before{$:/state/tour/step}] }}}/>
back
</$button>
\end
\define tour-next-step-button()
<$button>
<$action-setfield $tiddler="$:/state/tour/step" $field="text" $value={{{ [all[shadows+tiddlers]tag[$:/tags/TourStep]after{$:/state/tour/step}else[$:/plugins/tiddlywiki/tour/steps/finished]] }}}/>
next
</$button>
\end
<$list filter="[{$:/config/ShowTour}!is[blank]else[show]match[show]]" variable="ignore">
<div class="tc-tour-panel">
<div class="tc-tiddler-controls">
<$button set="$:/config/ShowTour" setTo="no" class="tc-btn-invisible">{{$:/core/images/close-button}}</$button> ''Tour''
</div>
<$transclude tiddler={{$:/state/tour/step}} mode="block"/>
</div>
</$list>