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

\usemodule[pre-60,abr-02]

% style

\setuppapersize
  [S66][S66]

\setuplayout
  [height=middle,
   width=middle,
   header=0pt,
   footer=0pt,
   backspace=2cm,
   topspace=2cm]

\setupinteraction
  [state=start,
   click=no]

\definecolor[maincolor][r=.4]

\startreusableMPgraphic{page}
    StartPage ;
        fill Page enlarged 5mm withcolor \MPcolor{maincolor} ;
    StopPage ;
\stopreusableMPgraphic

\startreusableMPgraphic{next}
    fill ultriangle scaled .15PaperWidth withcolor white ;
\stopreusableMPgraphic

\startreusableMPgraphic{last}
    fill boundingbox(ultriangle scaled .15PaperWidth) withcolor white ;
\stopreusableMPgraphic

\startuniqueMPgraphic{bullit}
    fill ultriangle scaled 2ExHeight withcolor white ;
\stopuniqueMPgraphic

\definelayer
  [extra]
  [width=\paperwidth,
   height=\paperheight]

\defineoverlay
  [page]
  [\reuseMPgraphic{page}]

\setupbackgrounds
  [page]
  [background={page,extra}]

\setupcolors
  [state=start,
   textcolor=white]

\setuphead
  [chapter]
  [style=\bfc]

\definehead[Title][title]

\definesymbol[MyBullet][\uniqueMPgraphic{bullit}]

\setupitemgroup[itemize][each][symbol=MyBullet]

\usetypescript[cambria]
\setupbodyfont[cambria,14.4pt]

% interface

\def\StartItems
  {\begingroup
   \StartSteps
   \startitemize
   \def\StartItems{\startitemize\def\StopItems{\stopitemize}}}

\def\StopItems
  {\FlushStep
   \stopitemize
   \NextPageSymbol
   \StopSteps
   \endgroup}

\def\Item
  {\def\Item{\FlushStep\item}
   \item}

\def\NextPageSymbol
  {\setlayer
     [extra]
     [preset=rightbottom,offset=2mm]
     {\ifnum\realpageno=\lastpage
       \reuseMPgraphic{last}%
      \else\ifnum\realpageno>1
       \reuseMPgraphic{next}%
      \fi\fi
      \FlushStep}}

\def\TitlePage#1#2%
  {\startstandardmakeup[bottom=,top=]
   \scale[width=\textwidth]{\framed[align=flushleft,foregroundstyle=\bf,frame=off]{#1}}
   \vfilll
   \hfill\scale[width=.5\textwidth]{\framed[align=flushright,foregroundstyle=\bf,frame=off]{#2}}
   \stopstandardmakeup}

\doifnotmode{demo}{\endinput}

\starttext

\TitlePage{I'm running\\out of examples}{Hans Hagen\\Someplace, 2031}

\Title{Alpha}

\StartItems
\Item one
\Item two
\Item three
\StopItems

\Title{Beta}

\StartItems
\Item four
\Item five
\Item six
\StopItems

\Title{Gamma}

\StartItems
\Item seven
\Item eight
\Item nine
\StopItems

\stoptext
