\startmode[asintended] \setupbodyfont[lbr] \stopmode
\setupbodyfont[14.4pt]
\setuppapersize
[S6][S6]
\setuplayout
[topspace=0cm,
backspace=0cm,
header=0pt,
footer=0pt,
width=middle,
height=middle]
\setupcolors
[state=start]
\definecolor[PageColor] [s=.50]
\definecolor[TextColor] [s=.80]
\definecolor[DoneColor] [s=.65]
\definecolor[TopColor] [r=.5,g=.6,b=.7]
\definecolor[BotColor] [r=.6,g=.7,b=.5]
\definecolor[DotColor] [r=.7,g=.5,b=.6]
\setupinteraction
[state=start,
color=,
contrastcolor=]
\setupinteractionscreen
[option=max,
delay=5]
\setuppagetransitions
\setupsystem
[random=medium]
\defineoverlay [shape] [\uniqueMPgraphic{shape}]
\defineoverlay [page] [\reuseMPgraphic{page}]
\startreusableMPgraphic{page}
StartPage ;
filldraw Page withcolor \MPcolor{PageColor} ;
pickup pencircle scaled .375cm ;
for i=1 upto 200 :
drawdot center Page randomized (PaperWidth,PaperHeight)
withcolor \MPcolor {DotColor} ;
endfor ;
StopPage ;
\stopreusableMPgraphic
\startuniqueMPgraphic{shape}
path p ;
p := unitsquare xyscaled(OverlayWidth,OverlayHeight) superellipsed .90 ;
draw p withpen pencircle scaled .50cm withcolor \MPcolor{PageColor} ;
fill p withcolor OverlayColor ;
draw p withpen pencircle scaled .25cm withcolor OverlayLineColor ;
currentpicture := currentpicture xysized(OverlayWidth,OverlayHeight) ;
\stopuniqueMPgraphic
\defineoverlay [forward] [\overlaybutton{forward}]
\definelayer [main] \defineoverlay [main] [\composedlayer{main}]
\definelayer [temp] \defineoverlay [temp] [\composedlayer{temp}]
\setuplayer
[main]
[state=repeat]
\setupbackgrounds
[page]
[background={page,forward,main,temp}]
\initializeboxstack{Summary}
\initializeboxstack{Subtext}
\doglobal\newcounter\CurrentSummary
\def\StartSummary
{\dodoublegroupempty\doStartSummary}
\def\doStartSummary#1#2
{\doglobal\increment\CurrentSummary
\setbox\scratchbox=\hbox{\strut#1}
\getrandomseed\RandomSeed
\setlayer[main]
{\RandomSubtextBox{DoneColor}{BotColor}{BotColor}}
\setrandomseed\RandomSeed
\savebox{Subtext}{\CurrentSummary}
{\RandomSubtextBox{TextColor}{BotColor}{black}}
\setbox\scratchbox=\hbox \bgroup
\setbox\scratchbox=\hbox{\bfb\setstrut\strut\quad#2\quad}
\SetAcceptableWidth
\framed [offset=0pt,width=fit,frame=off,align=middle,strut=no]
\bgroup \setupwhitespace[big]
\doifsomething{#2}{\noindent\box\scratchbox\blank}}
\def\StopSummary
{\egroup \egroup
\getrandomseed\RandomSeed
\setlayer[main]
{\RandomSummaryBox{DoneColor}{TopColor}{TopColor}}
\setrandomseed\RandomSeed
\savebox{Summary}{\CurrentSummary}
{\RandomSummaryBox{TextColor}{TopColor}{black}}}
\def\SetAcceptableWidth
{\scratchdimen=.5\makeupwidth
\ifdim\wd\scratchbox>.5\makeupwidth
\getrandomdimen\hsize{\wd\scratchbox}{.8\makeupwidth}
\else
\getrandomdimen\hsize{.5\makeupwidth}{.7\makeupwidth}
\fi}
\def\RandomSubtextBox#1#2#3
{\vbox to \makeupheight
{\vfill
\hbox to \makeupwidth
{\hfill
\button
[offset=2ex,frame=off,background=shape,strut=no,
backgroundcolor=#1,framecolor=#2,foregroundcolor=#3]
{\copy\scratchbox}
[previouspage]
\getrandomdimen\scratchdimen{.5cm}{2.5cm}
\hskip\scratchdimen}
\getrandomdimen\scratchdimen{.5cm}{1.5cm}
\vskip \scratchdimen}}
\definereference[thispage][page(\CurrentSummary)]
\def\RandomSummaryBox#1#2#3
{\vbox to \makeupheight
{\getrandomdimen\scratchdimen{.5cm}\makeupheight
\vskip 0pt plus \scratchdimen
\hbox to \makeupwidth
{\getrandomdimen\scratchdimen{.5cm}\makeupwidth
\hskip 0pt plus \scratchdimen
\button
[offset=3ex,frame=off,background=shape,strut=no,
backgroundcolor=#1,framecolor=#2,foregroundcolor=#3]
{\copy\scratchbox}
[thispage]
\getrandomdimen\scratchdimen{.5cm}\makeupwidth
\hskip 0pt plus \scratchdimen}
\getrandomdimen\scratchdimen{.5cm}\makeupheight
\vskip 0pt plus \scratchdimen
\vskip.2\makeupheight}}
\def\BuildPage
{\dorecurse{\CurrentSummary}
{\startstandardmakeup
\setlayer[temp]{\foundbox{Summary}\recurselevel}
\setlayer[temp]{\foundbox{Subtext}\recurselevel}
\stopstandardmakeup}}
\appendtoks \BuildPage \to \everystoptext
\def\TitlePage
{\dodoublegroupempty\doTitlePage}
\long\def\doTitlePage#1#2
{\ifsecondargument
\MakeTitlePage{#1}{#2}
\else\iffirstargument
\MakeTitlePage{\currentdate}{#1}
\else
\MakeTitlePage{\currentdate}{Welcome}
\fi\fi}
\def\MakeTitlePage#1#2
{\StartSummary{#1}{#2}\StopSummary}
\long\def\StartTopic#1\StopTopic{\StartSummary#1\StopSummary}
\doifnotmode{demo}{\endinput}
\starttext
\TitlePage{Indeed}{The Title Page}
\StartSummary{Alpha}{Title}
A simple and not too long text just to show the topic.
A simple and not too long text just to show the topic.
A simple and not too long text just to show the topic.
\StopSummary
\StartSummary{Beta and Gamma}{Another Title}
A simple and not too long text just to show the topic.
A simple and not too long text just to show the topic.
\StopSummary
\StartSummary{Delta}{Some Title}
A simple and not too long text just to show the topic.
\StopSummary
\StartSummary{Epsilon}{What A Title}
A simple and not too long text just to show the topic.
A simple and not too long text just to show the topic.
A simple and not too long text just to show the topic.
\StopSummary
\StartSummary{Zeta, Eta and Theta}{Eh, A Title}
A simple and not too long text just to show the topic.
A simple and not too long text just to show the topic.
A simple and not too long text just to show the topic.
\StopSummary
\StartSummary{Omega}
A simple and not too long text just to show the topic.
A simple and not too long text just to show the topic.
A simple and not too long text just to show the topic.
A simple and not too long text just to show the topic.
\StopSummary
\stoptext