\usemodule[pre-general]
\startmode[asintended] \setupbodyfont[lbr] \stopmode
\setupbodyfont[14.4pt]
\setuplayout
[style=smallbodyfont]
\setuppapersize
[S6][S6]
\setuplayout
[backspace=1cm,
topspace=1cm,
margin=0pt,
header=0pt,
footer=0pt,
bottomdistance=.875cm,
bottom=1cm,
width=fit,
height=fit]
\setupwhitespace
[medium]
\setuptyping
[margin=standard]
\definecolor [BackgroundColor] [r=.8, g=.8, b=.8]
\definecolor [OrnamentColor] [r= 0, g=.7, b=.4]
\setupcolors
[state=start]
\setupinteraction
[state=start,
color=OrnamentColor,
contrastcolor=OrnamentColor]
\setupinteractionscreen
[option=max,
width=fit,
height=fit]
\setupitemize
[color=OrnamentColor]
\startuniqueMPgraphic{PageBackground}
fill unitsquare
xyscaled(OverlayWidth,OverlayHeight)
withcolor OverlayColor ;
draw unitsquare
xyscaled(OverlayWidth,OverlayHeight)
enlarged (-2*OverlayLineWidth)
withpen pencircle scaled OverlayLineWidth
withcolor OverlayLineColor ;
\stopuniqueMPgraphic
\defineoverlay
[PageBackground]
[\uniqueMPgraphic{PageBackground}]
\setupbackgrounds
[page]
[background=PageBackground,
backgroundcolor=BackgroundColor,
rulethickness=.125cm,
framecolor=OrnamentColor]
\startuniqueMPgraphic{TextBackground}
draw unitsquare
xyscaled(OverlayWidth,OverlayHeight)
enlarged (4*OverlayLineWidth)
withpen pencircle scaled OverlayLineWidth
withcolor OverlayLineColor ;
\stopuniqueMPgraphic
\defineoverlay
[TextBackground]
[\uniqueMPgraphic{TextBackground}]
\defineoverlay
[NextPage]
[\overlaybutton{nextpage}]
\setupbackgrounds
[text]
[background={TextBackground,NextPage},
backgroundcolor=BackgroundColor,
rulethickness=.0625cm,
framecolor=OrnamentColor]
\setupMPvariables[RightArrow][height=\bottomheight]
\setupMPvariables[LeftArrow] [height=\bottomheight]
\setupMPvariables[Circle] [height=\bottomheight]
\setupMPvariables[UpArrow] [height=\bottomheight]
\startuniqueMPgraphic{RightArrow}{height}
z1=(0,0) ; z2=(\MPvar{height},.5y3) ; z3=(0,\MPvar{height}) ;
drawfill z1--z2--z3--cycle
withpen pencircle scaled (\MPvar{height}/5)
withcolor \MPcolor{OrnamentColor} ;
\stopuniqueMPgraphic
\startuniqueMPgraphic{LeftArrow}{height}
z1=(\MPvar{height},0) ; z2=(0,.5y3) ; z3=(\MPvar{height},\MPvar{height}) ;
drawfill z1--z2--z3--cycle
withpen pencircle scaled (\MPvar{height}/5)
withcolor \MPcolor{OrnamentColor} ;
\stopuniqueMPgraphic
\startuniqueMPgraphic{Circle}{height}
drawfill fullcircle scaled \MPvar{height}
withpen pencircle scaled (\MPvar{height}/5)
withcolor \MPcolor{OrnamentColor} ;
\stopuniqueMPgraphic
\startuniqueMPgraphic{UpArrow}{height}
z1=(0,0) ; z2=(\MPvar{height},0) ; z3=(.5x2,\MPvar{height}) ;
drawfill z1--z2--z3--cycle
withpen pencircle scaled (\MPvar{height}/5)
withcolor \MPcolor{OrnamentColor} ;
\stopuniqueMPgraphic
\setupinteractionmenu
[bottom]
[state=start,
frame=off,
width=.3\textwidth,
height=\bottomheight]
\setupinteraction
[menu=on]
\def\WhateverButton
{\doifreferencefoundelse{Whatever}
{\raw [Whatever] \uniqueMPgraphic{UpArrow} \\}
{}}
\startinteractionmenu[bottom]
\but [Topics] \\
\hfill
\WhateverButton
\kern2\bottomheight
\raw [previouspage] \uniqueMPgraphic{LeftArrow} \\
\kern.5\bottomheight
\raw [CloseDocument] \uniqueMPgraphic{Circle} \\
\kern.5\bottomheight
\raw [nextpage] \uniqueMPgraphic{RightArrow} \\
\kern.5\bottomheight
\stopinteractionmenu
\def\StartTitlePage
{\startstandardmakeup
\bfd\setupinterlinespace
\setupalign[middle]
\vfil
\let\\=\vfil}
\def\StopTitlePage
{\vfil\vfil\vfil
\stopstandardmakeup}
\def\TitlePage#1
{\StartTitlePage#1\StopTitlePage}
\definehead [Topic] [chapter]
\definehead [Subject] [section]
\definehead [Nopic] [title]
\setuphead
[Topic, Nopic]
[after={\blank[3*medium]},
number=no,
style=\tfb,
page=yes,
alternative=middle]
\setuphead
[Subject]
[after=\blank,
number=no,
page=yes,
continue=no,
style=\tfa]
\setuplist
[Topic,Subject]
[alternative=g,
interaction=all,
before=,
after=]
\setuplist
[Topic]
[criterium=all]
\def\Topics#1
{\determinelistcharacteristics[Topic]
\doifmode{*list}
{\Nopic[Topics]{#1}
\startcolumns
\placelist[Topic]
\stopcolumns}}
\setuplist
[Subject]
[criterium=Topic]
\def\Subjects
{\determinelistcharacteristics[Subject]
\doifmode{*list}
{\placelist[Subject]}}
\setuphead
[Topic]
[after={\blank[3*medium]\Subjects}]
\doifnotmode{demo}{\endinput}
\starttext
\TitlePage{Title Page\\pre-green}
\Topics{Some Nice Quotes}
\Topic{A Few}
\Subject{Knuth} \input knuth
\Subject{Tufte} \input tufte
\Topic{Some More}
\Subject{Zapf} \input zapf
\Subject{Bryson} \input bryson
\stoptext