summaryrefslogtreecommitdiff
path: root/macros/context/contrib/context-simpleslides/tex/context/third/simpleslides/s-simpleslides-BottomSquares.tex
blob: 845fd2fb1cae54ca1ee34ffee4d47a9aa0c67a41 (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=simpleslides-s-BottomSquares,
%D        version=2022.07.13,
%D          title=\CONTEXT\ Style File,
%D       subtitle=Presentation Module --- BottomSquares style,
%D         author=Aditya Mahajan and Thomas A. Schmitz,
%D           date=\currentdate | update ,
%D      copyright={Aditya Mahajan and Thomas A. Schmitz}]
%C
%C Copyright 2007 Aditya Mahajan and Thomas A. Schmitz
%C This file may be distributed under the GNU General Public License v. 2.0.

%D This file provides the \quotation{BottomSquares} style for the presentation
%D module. It is loaded at runtime. This minimalistic design is inspired by a
%D presentation Taco gave at EuroTeX 2006.

\writestatus{simpleslides}{loading module BottomSquares}

\startmodule[simpleslides-s-BottomSquares]

\unprotect

%D The page layout:

\setuplayout [width=fit,
	      height=middle,
              margin=0cm,
              height=fit,
	      margindistance=0cm,
              header=0cm,
              footer=0cm,
              topspace=1cm,
	      bottomspace=2cm,
              backspace=1.5cm,
              location=singlesided]

\setuplayout [simpleslides:layout:horizontal][header=1.4cm]
\setuplayout [simpleslides:layout:vertical]  [header=0cm]
\setuplayout [simpleslides:layout:title]     [header=0cm]

%D We also specify the position of the slidetitle.

\setuplayer[simpleslides:layer:slidetitle]
            [x=15mm]

%D These macros are used for placing figures/pictures:

\define\NormalHeight        {\textheight}
\define\NormalWidth         {.5\textwidth}
\define\PictureFrameHeight  {\textheight}
\define\PictureFrameWidth   {.5\textwidth}

% %D We define a generic frame that is used by the slide title.
%
% \defineframed[simpleslides:framed]
%              [frame=off,offset=0pt,
%               top=\vss,bottom=\vss]


%D We define our color scheme:

\definecolor [simpleslides:backgroundcolor]    [s=.95]
\definecolor [simpleslides:contrastcolor]      [r=.7,g=.1,b=.3]
\definecolor [simpleslides:variantcolor]       [s=.3]
\definecolor [simpleslides:itemize:color]      [simpleslides:contrastcolor]

%D We let \METAPOST\ calculate the background:

%AM: Why not implement this as an interaction bar?

\startuseMPgraphic{simpleslides:MP:ornament}
StartPage ;

fill Page withcolor \MPcolor{simpleslides:backgroundcolor} ;

save diff ;numeric diff;
diff = .3cm ;

save w; numeric w;
w = xpart (lrcorner Field[Text][Text] - llcorner Field[Text][Text]) - diff ;

save factor; numeric factor;
if NOfPages <= 1 :
  factor = w ;
else :
  factor = w/(NOfPages - 1) ;
fi ;

save p; path p ;
p = unitsquare xyscaled (diff,diff)
               shifted (xpart llcorner Field[Text][Text],0.85cm) ;

for i = 1 upto NOfPages:
  if RealPageNumber = i:
    fill p xyscaled (0,2) shifted ( (i-1)*factor,-diff-0.85cm)
         withcolor \MPcolor{simpleslides:contrastcolor} ;
  else :
    fill p shifted ( (i-1)*factor, 0)
         withcolor \MPcolor{simpleslides:variantcolor} ;
  fi ;
endfor ;
StopPage ;
\stopuseMPgraphic

%D We define these backgrounds as overlays:

\defineoverlay
  [simpleslides:background:ornament]
  [\useMPgraphic{simpleslides:MP:ornament}]

\defineoverlay
  [simpleslides:background:title]
  [\useMPgraphic{simpleslides:MP:ornament}]

%D We want the title information to be colored

\setupTitle
  [color=simpleslides:contrastcolor]

%D The slide title is typeset in a layer

\setupSlideTitle
  [\c!color={simpleslides:contrastcolor},
   \c!alternative=layer,
   \c!align=\v!center,
   \c!width=\textwidth,
   \c!height=3cm,
   \c!after=]

%D attempt!

\startuniqueMPgraphic{Important}
save p, q ; path p[], q[] ;
p[1] = unitsquare xyscaled (\overlaywidth,\overlayheight) ;
z[1] = ulcorner p[1] ;
z[2] = llcorner p[1] ;
save a ; numeric a ;
a = arclength (z[1] -- z[2])/15 ;
z[3] = ulcorner p[1] shifted (a,0) ;
z[4] = urcorner p[1] shifted (-a,0) ;
z[5] = urcorner p[1] shifted (0,-a) ;
z[6] = lrcorner p[1] shifted (0,a) ;
z[7] = lrcorner p[1] shifted (-a,0) ;
z[8] = llcorner p[1] shifted (a,0) ;
z[9] = llcorner p[1] shifted (0,a) ;
z[10] = ulcorner p[1] shifted (0,-a) ;
z[11] = z[8] shifted (5mm,0) ;
z[12] = z[5] shifted (0,-5mm) ;
p[2] = z[3] --- z[4] .. z[5] --- z[6]  .. z[7] --- z[8] .. z[9] --- z[10] .. cycle ;
q[1] = z[11] --- z[7] .. z[6] --- z[12] ;
for i = 3 upto 22:
	pickup pencircle scaled (i*0.5mm) ;
	draw q[1] withcolor transparent ("normal", 0.01, black) ;
endfor
pickup pencircle scaled 2pt ;
fill p[2] withcolor \MPcolor{simpleslides:contrastcolor} ;
%draw z[8] withcolor red ;
\stopuniqueMPgraphic

\defineoverlay[VImportant][\useMPgraphic{Important}]

\define[1]\Important%
  {\blank[line]\midaligned{{\framed[height=5cm,width=0.9\textwidth,frame=off,background=VImportant,align=middle,offset=0pt,top=\vss,bottom=\vss,strut=no,foregroundcolor=simpleslides:backgroundcolor]{#1}}}}

%D The symbol for the first level of itemizations.

\definesymbol[1][\useMPgraphic{simpleslides:itemize:square}]
\setupitemize[1][color={simpleslides:itemize:color}]

\protect
\stopmodule

\endinput