\usemodule[pre-general]
\startmode[asintended] \setupbodyfont[lbr] \stopmode
\setupbodyfont[14.4pt]
\setupcolors [state=start]
\definecolor [BackgroundColor] [s=.95]
\definecolor [OrnamentColor] [r=.6,g=.7,b=.8]
\setuppapersize
[S6][S6]
\setuplayout
[width=430pt,
height=400pt,
header=0pt,
footer=0pt,
margin=0pt,
backspace=25pt,
topspace=25pt,
rightedgedistance=20pt,
rightedge=110pt]
\setupinteractionscreen
[option=max]
\setupbackgrounds
[state=repeat]
\setupbackgrounds
[page]
[backgroundcolor=white]
\setupbackgrounds
[text][text]
[background={HashFrameA,NextPage},
backgroundoffset=20pt]
\defineoverlay
[HashFrameA]
[\useMPgraphic{HashFrameA}]
\defineoverlay
[HashFrameB]
[\useMPgraphic{HashFrameB}]
\setupinteraction
[state=start,
menu=on,
color=OrnamentColor,
contrastcolor=OrnamentColor]
\setupinteractionmenu
[right]
[background=HashFrameB,
style=smallbold,
frame=off,
offset=10pt,
height=35pt,
before=,
after=,
inbetween=\endgraf,
width=\rightedgewidth]
\startinteractionmenu[right]
\placelist
[Topic]
[criterium=all,
alternative=right,
maxwidth=.8\rightedgewidth,
interaction=all,
before=,
after=]
\vfill
\setupinteractionmenu
[right]
[height=30pt]
\but [CloseDocument] Close \\
\stopinteractionmenu
\setupwhitespace
[big]
\setupblank
[big]
\defineoverlay [TitleGraphic] [\useMPgraphic{TitleGraphic}]
\defineoverlay [NextPage] [\overlaybutton{forward}]
\def\StartTitlePage
{\setupbackgrounds[page][background={color,TitleGraphic,NextPage}]
\setupbackgrounds[text][text][background=]
\setupinteraction[menu=off]
\setupinteractionbar[state=stop]
\setuplayout[width=550pt,rightedge=0pt]
\startstandardmakeup
\switchtobodyfont[24pt]
\bfd\setupinterlinespace
\setupalign[middle]
\vfil
\let\\=\vfil}
\def\StopTitlePage
{\vfil\vfil\vfil
\stopstandardmakeup
\setuplayout[width=430pt,rightedge=110pt]
\setupinteraction[menu=on]
\setupinteractionbar[state=start]
\setupbackgrounds[page][background=color]
\setupbackgrounds[text][text][background={HashFrameA,NextPage}]}
\def\TitlePage#1
{\StartTitlePage#1\StopTitlePage}
\def\Topics#1{}
\def\Subjects{}
\definehead [Topic] [chapter]
\definehead [Nopic] [title]
\definehead [Subject] [section]
\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]
\startMPinclusions
def random_hash_frame (expr width, height, offset, linewidth ) =
def delta = ((uniformdeviate .5offset) + .25offset) enddef ;
x1 := offset ; y1 := offset ; x2 := width-offset ; y2 := height-offset ;
drawoptions(withpen pencircle scaled linewidth withcolor \MPcolor{BackgroundColor}) ;
fill z1--(x2,y1)--z2--(x1,y2)--cycle ;
drawoptions(withpen pencircle scaled linewidth withcolor \MPcolor{OrnamentColor}) ;
draw (x1-delta,y1)--(x2+delta,y1) ;
draw (x2,y1-delta)--(x2,y2+delta) ;
draw (x2+delta,y2)--(x1-delta,y2) ;
draw (x1,y2+delta)--(x1,y1-delta) ;
drawoptions();
setbounds currentpicture to unitsquare xscaled width yscaled height ;
enddef ;
\stopMPinclusions
\startuseMPgraphic{HashFrameA}
random_hash_frame(OverlayWidth,OverlayHeight,15pt,2pt) ;
\stopuseMPgraphic
\startuseMPgraphic{HashFrameB}
random_hash_frame(OverlayWidth,OverlayHeight, 5pt,2pt) ;
\stopuseMPgraphic
\startuseMPgraphic{TitleGraphic}
for i=1 upto 300 :
offset := uniformdeviate 10pt ;
width := 2*offset + 30pt + uniformdeviate 30pt ;
height := 2*offset + 10pt + uniformdeviate 10pt ;
addto currentpicture also
image(random_hash_frame(width,height,offset,1pt)) shifted
(uniformdeviate OverlayWidth, uniformdeviate OverlayHeight) ;
endfor ;
\stopuseMPgraphic
\doifnotmode{demo}{\endinput}
\starttext
\TitlePage{Title Page\\pre-fuzzy}
\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