%D \module
%D   [      file=s-pre-61,
%D        version=2004.03.15,
%D          title=\CONTEXT\ Style File,
%D       subtitle=Presentation Environment 61,
%D         author=Hans Hagen,
%D           date=\currentdate,
%D      copyright={PRAGMA / Hans Hagen \& Ton Otten}]
%C
%C This module is part of the \CONTEXT\ macro||package and is
%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
%C details.

%D Optima

\usemodule[pre-60]

\doifmodeelse {mkiv} {
    \usetypescriptfile[type-hgz]
    \definetypeface[mainface][ss][sans][optima-nova][default]
} {
    \usetypescriptfile[type-ghz]
    \definetypeface[mainface][ss][sans][optima-nova][default][encoding=\defaultencoding]
}

\setupbodyfont[mainface,ss,18pt]
\setupinterlinespace[line=3.25ex]

\setuppapersize
  [S6][S6]

% \setuppapersize
%   [SW][SW]

\setuplayout
  [topspace=10pt,
   header=30pt,
   headerdistance=20pt,
   height=middle,
   footerdistance=20pt,
   footer=0pt,
   bottomdistance=20pt,
   bottom=20pt,
   bottomspace=50pt,
   backspace=30pt,
   width=middle]

\setupinteraction
  [state=start,
   click=off,
   menu=on,
   style=,
   color=interactioncolor,
   contrastcolor=interactioncolor]

\setupinteractionscreen
  [option=max]

\setupinteractionmenu
  [bottom]
  [color=maincolor,
   contrastcolor=maincolor,
   style=\tfa, % acceptable
   left=\hfill,
   middle=,
   right=,
   height=\bottomheight,
   width=2\bottomheight,
   offset=overlay,
   frame=off]

\startinteractionmenu[bottom]
  \but [firstpage]               \symbol[firstpage]      \\
  \but [previouspage]            \symbol[previouspage]   \\
  \but [InvokeStepper] \StartBusy\symbol[PauseRendering]\StopBusy \\
  \but [nextpage]                \symbol[nextpage]       \\
  \but [lastpage]                \symbol[lastpage]       \\
  \but [CloseDocument]           \symbol[CloseDocument]  \\
\stopinteractionmenu

% maybe in colo-sjk : \setupcolor[sjk]

\definecolor [dark]   [s=.4]
\definecolor [bright] [s=.9]

\definecolor [red]    [r=.4,g=.2,b=.2]
\definecolor [green]  [r=.2,g=.4,b=.2]
\definecolor [blue]   [r=.2,g=.2,b=.4]

\definecolor [cyan]   [r=.2,g=.4,b=.4]
\definecolor [magenta][r=.4,g=.2,b=.4]
\definecolor [yellow] [r=.4,g=.4,b=.2]

\definecolor [pagecolor] [dark]
\definecolor [maincolor] [bright]
\definecolor [textcolor] [red]

\definecolor [interactioncolor] [r=.8,g=.8,b=.6]

\setupcolors
  [state=start,
   textcolor=maincolor]

\setupbackgrounds
  [page]
  [background=page,
   backgroundcolor=textcolor]

\setupbackgrounds
  [text]% [text]
  [background={comments,text,invoke}]

\definelayer
  [text]
  [width=\textwidth,
   height=\textheight]

\defineoverlay
  [comments]
  [{\setlayer[text][preset=middle]{\placecomments}}]

\defineoverlay[page][\uniqueMPgraphic{page-\ifcase\realpageno\or one\else plus\fi}]

\startuniqueMPgraphic{page-one}
  StartPage ;
    fill Page
      enlarged 4pt
      withcolor \MPcolor{pagecolor} ;
    fill Field[Text][Text]
      enlarged 10pt
%       topenlarged   (HeaderHeight+HeaderDistance)
      leftenlarged  (BackSpace+4pt)
      rightenlarged (CutSpace +4pt)
      withcolor OverlayColor ;
  StopPage ;
\stopuniqueMPgraphic

\startuniqueMPgraphic{page-plus}
  StartPage ;
    fill Page
      enlarged 4pt
      withcolor \MPcolor{pagecolor} ;
    fill Field[Text][Text]
      enlarged 10pt
      leftenlarged  (BackSpace+4pt)
      rightenlarged (CutSpace+4pt)
      withcolor OverlayColor ;
  StopPage ;
\stopuniqueMPgraphic

% this needs to be sorted out !

\appendtoks
    \NormalizeFontHeight \HeadFont        {\setstrut\strut\quad} {1.0\headerheight} {SansBold}
    \NormalizeFontHeight \TitleFont       {\setstrut\strut\quad} {2.0\headerheight} {SansBold}
    \NormalizeFontHeight \SubTitleFont    {\setstrut\strut\quad} {1.5\headerheight} {SansBold}
    \NormalizeFontHeight \SubSubTitleFont {\setstrut\strut\quad} {1.0\headerheight} {SansBold}
\to \everystarttext
\appendtoks
    \NormalizeFontHeight \HeadFont        {\setstrut\strut\quad} {1.0\headerheight} {SansBold}
    \NormalizeFontHeight \TitleFont       {\setstrut\strut\quad} {2.0\headerheight} {SansBold}
    \NormalizeFontHeight \SubTitleFont    {\setstrut\strut\quad} {1.5\headerheight} {SansBold}
    \NormalizeFontHeight \SubSubTitleFont {\setstrut\strut\quad} {1.0\headerheight} {SansBold}
\to \everystoptext

\setuphead
  [chapter]
  [placehead=empty,
   after={\blank[medium]},
   color=maincolor,
   placenumber=no,
   style=\HeadFont]

\setupheadertexts
  [\doiftextelse{\currentheadnumber}{\placeheadtext[Topic]}{\placeheadtext[Nopic]}]
  []

\setuppagenumbering
  [location=]

\definesymbol
  [emdash]
  [\emdash]

\setupitemize
  [each]
  [loose,serried,joinedup,broad]
  [symbol=emdash]

\setupalign
  [broad,right]

\def\doTitlePage#1#2#3%
  {\startstandardmakeup[headerstate=high]
     \def\\{\def\\{\endgraf\quad\quad}\endgraf\quad\ignorespaces#2}%
     #1\setstrut\setupinterlinespace\vfil#3\vfil\vfil
   \stopstandardmakeup}

\def\TitlePage   {\doTitlePage\TitleFont\relax}
\def\SubTitlePage{\doTitlePage\TitleFont\SubTitleFont}

\definehead[Topic][chapter]
\definehead[Nopic][title]

\def\Topics#1%
  {\Nopic[topics]{#1}
   \startcolumns
     \placelist[Topic]
   \stopcolumns}

\setuplist
  [Topic]
  [alternative=f,
   color=maincolor,
   contrastcolor=maincolor,
   criterium=all]

\defineoverlay[topics][\overlaybutton{topics}]

\setupbackgrounds
  [bottom] [text]
  [background=topics]

% \doifnotmode{demo}{\endinput}

\starttext

\TitlePage{Stepwise\\Refinement}

\Topics{Topics}

\Topic{Female Artists}

\StartSteps

\startitemize
\item Tori Amos \FlushStep
\item Kate Bush \FlushStep
\item Heather Nova \FlushStep
\item Alanis Morissette \FlushStep
\item Suzanne Vega \FlushStep
\stopitemize

\StopSteps

\Topic{Male Composers}

\StartSteps

\startitemize
\item John Adams \FlushStep
\item Steve Reich \FlushStep
\item Louis Andriessen \FlushStep
\item Olivier Messiaen \FlushStep
\stopitemize

\StopSteps

\Topic{And Some More}

\StartSteps

\startitemize
\item Mark Hollis   \FlushStep
\item Roger Waters  \FlushStep
\item David Gilmore \FlushStep
\item Peter Gabriel \FlushStep
\item Randy Newman  \FlushStep
\stopitemize

\StopSteps

\stoptext
