summaryrefslogtreecommitdiff
path: root/tex/context/base/s-pre-16.tex
blob: 715936890bd41beb8ad50a4814b3fa2dd6f69287 (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
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
%D \module
%D   [      file=s-pre-16,
%D        version=1999.09.01, 
%D          title=\CONTEXT\ Style File,
%D       subtitle=Presentation Environment 16,
%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.

%D The first version of this style was made late summer 1999,
%D but its first usage was during a course I gave in BRNO.
%D It's a rather simple style with a dominating background. 

\setuppapersize
  [S6][S6]

\setupbodyfont
  [pos,14.4pt]

\setuplayout
  [topspace=100pt,
   backspace=120pt,
   header=0pt,
   footer=0pt,
   width=middle,
   height=middle]

\setupbackgrounds
  [text]
  [backgroundoffset=80pt,
   background=GoOn]

\setupbackgrounds
  [page]
  [background={FuzzyCircle,Again}]

\setupcolors
  [state=start]

\definecolor[gray] [s=.4]
\definecolor[white][s=.8] 

\definecolor[red]  [r=.8] \definecolor[cyan]   [g=.8,b=.8] 
\definecolor[green][g=.8] \definecolor[magenta][r=.8,b=.8] 
\definecolor[blue] [b=.8] \definecolor[yellow] [r=.8,g=.8] 

\definecolor[PageColor][gray]
\definecolor[TextColor][yellow]
\definecolor[LineColor][blue]

\setupinteraction
  [state=start,
   color=LineColor,
   contrastcolor=LineColor]

\setupinteractionscreen
  [option=max]

\setupitemize
  [each]
  [color=blue,
   symbol=FuzzyDot]

\startuseMPgraphic{FuzzyCircle}
  path p ; numeric w, h, l ; 
  w := OverlayWidth ; h := OverlayHeight ; 
  def dd = (1 randomized (1/5)) enddef ; 
  pickup pencircle xscaled 10pt yscaled 2pt rotated 30;
  for i:=1 upto 50 : 
    p := (-dd,-dd)..(dd,-dd)..(dd,dd)..(-dd,dd)..cycle ; 
    p := p rotatedaround (center p, uniformdeviate 360) ;   
    p := p xscaled (w/2) yscaled (h/2) ; 
    l := length(p)/2 ; 
    p := p cutbefore point   (uniformdeviate l) of p ;   
    p := p cutafter  point (l+uniformdeviate l) of p ;   
    draw p withcolor \MPcolor{LineColor} randomized (.4,1) ;
  endfor ; 
  picture s ; s := currentpicture xysized (w-15,h-15) ;
  currentpicture := nullpicture ;
  fill boundingbox s enlarged 60pt withcolor \MPcolor{PageColor} ; 
  addto currentpicture also s ; 
\stopuseMPgraphic

\startuseMPgraphic{FuzzyDot}
  path p ; numeric w ; 
  w := BodyFontSize/2 ; 
  def dd = (w randomized (w/2)) enddef ; 
  pickup pencircle xscaled (w/2) yscaled (w/3) rotated 30 ;
  for i=0 step 45 until 135 : 
    p := (-dd,0)--(dd,0) ;
    p := p rotatedaround (origin,i-w+uniformdeviate w) ;
    draw p withcolor \MPcolor{LineColor} randomized (.3,.8) ;
  endfor ; 
\stopuseMPgraphic

\defineoverlay [FuzzyCircle] [\useMPgraphic{FuzzyCircle}]
\defineoverlay [GoOn]        [{\setupinteraction[click=no]\overlaybutton{forward}}]
\defineoverlay [Again]       [\overlaybutton{firstpage}]

\definesymbol 
  [FuzzyDot] 
  [\lower\dp\strutbox\hbox{\useMPgraphic{FuzzyDot}}]

\def\Item%
  {\par\noindent\symbol[FuzzyDot]\hskip.5em\nobreak}

\setupitemize 
  [all]
  [packed]
  [symbol=FuzzyDot]

\def\NextIdea%
  {\blank[back,medium]
   \midaligned{\symbol[FuzzyDot]}
   \blank[medium]
   \blank[disable]}

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

\setuphead
  [Topic, Nopic]
  [alternative=middle,
   before=,
   number=no,
   style=\bfb]

\setuplist
  [Topic]
  [alternative=g,
   interaction=all]

%D Since we want a colored text, and since color directive 
%D can spoil the spacing, we use a foregroundcolor. 

\setupbackgrounds
  [text]
  [foregroundcolor=TextColor]

%D Unfortunately this does not work when on the page colors 
%D are set, so we play safe and say: 

\setupmakeup
  [standard]
  [color=TextColor]

\def\StartIdea%
  {\startstandardmakeup
   \setupwhitespace[medium]
   \setupblank[medium]
   \setupalign[broad,middle]}

\def\StopIdea%
  {\stopstandardmakeup}

\def\Topics#1%
  {\Nopic{#1}
   \startcolumns
     \setupinteraction[color=TextColor,contrastcolor=TextColor]
     \placelist[Topic]
   \stopcolumns
   \page}

%D Some fakes. 

\def\Subject  {\Topic}
\def\Subjects {}

%D A bonus (copied from \type {s-pre-02} but with a different 
%D vertical alignment. 

\def\StartTitlePage%
  {\startstandardmakeup
   \bfd\setupinterlinespace
   \setupalign[middle]
   \vfil
   \let\\=\vfil}

\def\StopTitlePage%
  {\vfil
   \stopstandardmakeup}

\def\TitlePage#1%
  {\StartTitlePage#1\StopTitlePage}

\doifnotmode{demo}{\endinput}

\starttext 

\Topics{...}

\StartIdea 
  \Topic{...}
  ... 
  \NextIdea 
  ...
\StopIdea

\stoptext