s-present-random.mkiv /size: 5895 b    last modification: 2020-07-01 14:35
1
%D \module
2
%D [ file=s-present-random,
3
%D version=2008.08.05, % updated 2016.10.20
4
%D title=\CONTEXT\ Style File,
5
%D subtitle=Presentation Environment Random,
6
%D author=Hans Hagen,
7
%D date=\currentdate,
8
%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
9
%C
10
%C This module is part of the \CONTEXT\ macro||package and is
11
%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
12
%C details.
13 14
\startmodule
[
present
-
random
]
15 16
%D Unfortunately there are not that many viewers that support javascript
17
%D control over layers.
18 19
% \enablemode[numbers]
20
% \enablemode[paper]
21
% \usemodule[present-stepwise]
22 23
\registerctxluafile
{
s
-
present
-
random
}{}
24 25
\setupinteraction
26
[
state
=
start
,
27
click
=
off
]
28 29
\definepapersize
30
[
wide
]
31
[
width
=
9
0
0
pt
,
32
height
=
6
0
0
pt
]
33 34
\setuppapersize
35
[
wide
]
36
[
wide
]
37 38
\setuplayout
39
[
page
]
40 41
\setupsorting
42
[
logo
]
43
[
style
=]
44 45
\startnotmode
[
paper
]
46 47
\setupbackgrounds
48
[
page
]
49
[
background
=
color
,
50
backgroundcolor
=
black
]
51 52
\stopnotmode
53 54
\definelayer
55
[
page
]
56
[
width
=
\paperwidth
,
57
height
=
\paperheight
]
58 59
\definecolor
[
TopicColor
-
1
][
r
=
.
3
,
g
=
.
4
,
b
=
.
5
]
60
\definecolor
[
TopicColor
-
2
][
r
=
.
3
,
g
=
.
5
,
b
=
.
4
]
61
\definecolor
[
TopicColor
-
3
][
r
=
.
4
,
g
=
.
3
,
b
=
.
5
]
62
\definecolor
[
TopicColor
-
4
][
r
=
.
4
,
g
=
.
5
,
b
=
.
3
]
63
\definecolor
[
TopicColor
-
5
][
r
=
.
5
,
g
=
.
3
,
b
=
.
4
]
64
\definecolor
[
TopicColor
-
6
][
r
=
.
5
,
g
=
.
4
,
b
=
.
3
]
65
\definecolor
[
TopicColor
-
7
][
r
=
.
3
5
,
g
=
.
3
5
,
b
=
.
6
]
66
\definecolor
[
TopicColor
-
8
][
r
=
.
6
,
g
=
.
3
5
,
b
=
.
3
5
]
67
\definecolor
[
TopicColor
-
9
][
r
=
.
3
5
,
g
=
.
6
,
b
=
.
3
5
]
68 69
\definecolor
[
TopicColor
-
0
][
t
=
.
5
,
a
=
1
,
s
=
.
5
]
70
\definecolor
[
TopicColor
]
[
s
=
1
]
71 72
\setupcolors
73
[
textcolor
=
TopicColor
]
74 75
\starttexdefinition
unexpanded
StartTopics
76
\doifelsemode
{
paper
}
{
77
\disablemode
[
stepper
]
78
\enablemode
[
onepagestepper
]
79
}
{
80
\doifelsedefined
{
NextStep
}
{
81
\enablemode
[
stepper
]
82
\disablemode
[
onepagestepper
]
83
}
{
84
\disablemode
[
stepper
]
85
\disablemode
[
onepagestepper
]
86
}
87
}
88
\doifelsemode
{
onepagestepper
}
{
89
\startstandardmakeup
[
top
=
,
bottom
=
\vfill
]
90
}
{
91
\setuplayer
[
state
=
repeat
]
92
\resetlayer
[
page
]
93
}
94
\ctxlua{
moduledata
.
steps
.
reset_locations
(
)
}
95
\doifmode
{
interactivestepper
}
{
96
\StartLocalSteps
97
}
98
\stoptexdefinition
99 100
\starttexdefinition
unexpanded
StopTopics
101
\doifmode
{
interactivestepper
}
{
102
\StopLocalSteps
103
}
104
\doifelsemode
{
onepagestepper
}
{
105
\flushlayer
[
page
]
106
\stopstandardmakeup
107
}
{
108
\resetlayer
[
page
]
109
}
110
\stoptexdefinition
111 112
\starttexdefinition
unexpanded
StartTopic
113
\dosingleempty
\doStartTopic
114
\stoptexdefinition
115 116
\starttexdefinition
unexpanded
doStartTopic
[#
1
]
117
\doifmode
{
interactivestepper
}
{
118
\NextStep
119
}
120
\ctxlua{
moduledata
.
steps
.
next_location
(
"
#1
"
)
}
121
\doifmode
{
paper
}
{
122
\doifnothing
{
#
1
}
{
123
\ifcase
\ctxlua{
moduledata
.
steps
.
previous_n
(
)
}
\else
124
\setlayer
125
[
page
]
126
[
preset
=
\ctxlua{
moduledata
.
steps
.
previous_location
(
)
}
]
127
\bgroup
128
\doifmode
{
interactivestepper
}
{
129
\startviewerlayer
[
\StepLayer
]
130
}
131
\framed
132
[
offset
=
2
0
pt
,
133
strut
=
no
,
134
align
=
normal
,
135
frame
=
off
,
136
height
=
\dimexpr
\paperheight
/
3
\relax
,
137
width
=
\dimexpr
\paperwidth
/
3
\relax
,
138
background
=
color
,
139
backgroundcolor
=
TopicColor
-
0
]
140
{}
141
\doifmode
{
interactivestepper
}
{
142
\stopviewerlayer
143
}
144
\egroup
145
\fi
146
}
147
}
148
\setlayer
149
[
page
]
150
[
preset
=
\ctxlua{
moduledata
.
steps
.
current_location
(
)
}
]
151
\bgroup
152
\doifmode
{
interactivestepper
}
{
153
\startviewerlayer
[
\StepLayer
]
154
}
155
\framed
156
[
offset
=
2
0
pt
,
157
strut
=
no
,
158
align
=
\expdoifelse
{
#
1
}{}{
normal
}{
middle
,
lohi
}
,
159
align
=
\expdoifelse
{
#
1
}{}{
flushleft
,
verytolerant
}{
middle
,
lohi
}
,
160
frame
=
off
,
161
height
=
\dimexpr
\paperheight
/
3
\relax
,
162
width
=
\dimexpr
\paperwidth
/
3
\relax
,
163
background
=
color
,
164
backgroundcolor
=
TopicColor
-
\ctxlua{
moduledata
.
steps
.
current_n
(
)
}
]
165
\bgroup
166
\ignorespaces
167
\stoptexdefinition
168 169
\starttexdefinition
unexpanded
StopTopic
170
\removeunwantedspaces
171
\egroup
172
\doifmode
{
interactivestepper
}
{
173
\stopviewerlayer
174
}
175
\egroup
176
\doifmode
{
numbers
}
{
177
\setlayerframed
178
[
page
]
179
[
preset
=
\ctxlua{
moduledata
.
steps
.
current_location
(
)
}
]
180
[
height
=
\dimexpr
\paperheight
/
3
\relax
,
181
width
=
\dimexpr
\paperwidth
/
3
\relax
,
182
frame
=
off
,
183
foregroundstyle
=
\bfa
,
184
align
=
{
flushright
,
low
}
]
185
\bgroup
186
\doifmode
{
interactivestepper
}
{
187
\startviewerlayer
[
\StepLayer
]
188
}
189
\ctxlua{
moduledata
.
steps
.
step
(
)
}
\kern
\strutdepth
190
\doifmode
{
interactivestepper
}
{
191
\stopviewerlayer
192
}
193
\egroup
194
}
195
\doifnotmode
{
onepagestepper
}
{
196
\startstandardmakeup
[
top
=
,
bottom
=
\vfill
]
197
\flushlayer
[
page
]
198
\stopstandardmakeup
199
}
200
\stoptexdefinition
201 202
\definefont
[
TitleFont
][
SansBold
*
default
at
6
0
pt
]
203
\definefont
[
TempFont
]
[
SansBold
*
default
at
1
2
pt
]
204 205
\let
\StartText
\starttext
% for old times sake
206
\let
\StopText
\stoptext
% for old times sake
207 208
\stopmodule
209 210
\continueifinputfile
{
s
-
present
-
random
.
mkiv
}
211 212
\usemodule
[
present
-
common
]
213 214
\inputpresentationfile
{
examples
/
present
-
random
-
0
0
1
.
tex
}
215 216