summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/context/base/s-pre-18.tex
blob: 876eec5f1f815f35155a6ea03c20bf2046473a96 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
%D \module
%D   [      file=s-pre-18,
%D        version=1999.08.20,
%D          title=\CONTEXT\ Style File,
%D       subtitle=Presentation Environment 18,
%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.

% todo: met pos en dan iedere titel

\setuppapersize
  [S6][S6]

\setupbodyfont
  [loc,ppl]

\setupcolors
  [state=start]

\definecolor [shade-1] [s=.7]
\definecolor [shade-2] [s=.1]

\definecolor [shade-3] [s=.8]
\definecolor [shade-4] [b=.8]

\definecolor [shade-5] [g=.6]

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

\setupbackgrounds
  [state=repeat]

\setupbackgrounds [page] [background=page]

\defineoverlay [page] [\useMPgraphic{page}]
\defineoverlay [text] [\useMPgraphic{text}]

\startuseMPgraphic{page}
  StartPage ;
    path p ; numeric s ; pair cp ; cp := center Page ;
    s := define_circular_shade(cp,cp,0,TextWidth,
      \MPcolor{shade-1},\MPcolor{shade-2}) ;
    fill Page withshade s ;
    p := fullcircle xyscaled (TextWidth+1cm, TextHeight+1cm) shifted cp ;
    s := define_circular_shade(cp,cp,0,TextWidth,\MPcolor{shade-3},
      \MPcolor{shade-4}) ;
    fill p withshade s ;
  StopPage
\stopuseMPgraphic

\startuseMPgraphic{text}
  StartPage ;
    path p ; numeric s, t ; pair cp ; cp := center Page ;
    s := define_circular_shade(cp,cp,0,TextWidth,
      \MPcolor{shade-1},\MPcolor{shade-2}) ;
    fill Page withshade s ;
    p := llcorner Field[Text][Bottom] --
         lrcorner Field[Text][Bottom] --
         urcorner Field[Text][Text]   --
         ulcorner Field[Text][Text]   -- cycle ;
    p := p enlarged .5cm randomized .5cm ;
    t := define_circular_shade(cp,cp,0,TextWidth,\MPcolor{shade-3},
      \MPcolor{shade-4}) ;
    fill p withshade t ;

    def bottom_menu_button (expr nn, rr, pp, xx, yy, ww, hh, dd) =
      if (pp>0) and (rr>0) :
        if     nn = 1 :
          p := (0,0)--(ww,hh/2)--(0,hh)--cycle ;
        elseif nn = 2 :
          p := (0,hh/2)--(ww,hh)--(ww,0)--cycle ;
        else :
          p := origin--cycle ;
        fi ;
        fill p randomized 2.5mm shifted (xx,yy) withshade s ;
      fi ;
    enddef ;

    \MPmenubuttons{bottom}

    if length \MPstring{topic} > 0 :
      graphictext
        \MPstring{topic}
        scaled 3
        shifted ulcorner Field[Text][Text]
        shifted (0,-1.5cm)
        withshade s ;
    fi ;

  StopPage ;
\stopuseMPgraphic

\setupinteractionmenu
  [bottom]
  [state=start,
   frame=off,
   left=\hfill,
   middle=\hskip.5cm,
   width=2\bottomheight,
   position=yes]

\startinteractionmenu[bottom]
  \but [previouspage] \\
  \but [nextpage]     \\
\stopinteractionmenu

\setupinteraction
  [state=start,
   click=no,
   color=shade-5,
   contrastcolor=shade-5,
   menu=on]

\setupwhitespace
  [big]

\def\Topic#1%
  {\page
   \setMPtext{topic}{#1}
   \vbox to 2cm{}}

\setMPtext{topic}{}

\def\StartTitlePage%
  {\startstandardmakeup[bottomstate=none]
   \setupalign[middle]
   \vfill}

\def\StopTitlePage%
  {\stopstandardmakeup
   \setuplayout[bottom=1.5cm]
   \setupbackgrounds[page][background=text]}

\def\TitleString#1#2%
  {\indent
   \startMPcode
     graphictext
       "#2"
       scaled #1
       withdrawcolor .4white
       withfillcolor .7white
       withpen pencircle scaled 2pt ;
   \stopMPcode
   \vfill}

\doifnotmode{demo}{\endinput}

\starttext

\StartTitlePage
  \TitleString{8}{Welcome}
  \TitleString{4}{to my favourite}
  \TitleString{8}{Quotes}
\StopTitlePage

\Topic {Douglas R. Hofstadter} \input douglas \page
\Topic {Donald  E. Knuth}      \input knuth   \page
\Topic {Edward  R. Tufte}      \input tufte   \page
\Topic {Hermann    Zapf}       \input zapf    \page

\stoptext