
%% The page shift of page #6 needs to be adjusted if the value is changed, no
%% clue why.
%% A4-flyer pagesize needs to be adjusted as well
\definemeasure
	[shortfold]
	[3mm]

\definepapersize
	[A4-flyer]
	[width=303mm,
	 height=216mm]

\definepapersize
	[flyer-page]
	[width=100mm,
	 height=210mm]

\definepapersize
  [flyer-page-small]
	[width=\dimexpr100mm-\measure{shortfold}\relax,
	 height=210mm]

\setuppapersize
	[flyer-page]
	[A4-flyer]

\setuparranging
	[TRYPTICHON]

%% The page shift of page #6 needs to be adjusted if shortfold is adjusted, no
%% clue why.
\definepageshift
	[flyer]
	[horizontal]
	[\zeropoint,
	 \measure{shortfold},
	 \measure{shortfold},
	 3\measured{shortfold},
	 \measure{shortfold},
	 \zeropoint]

\definepageshift
	[flyer]
	[vertical]
	[\measure{shortfold}]

\setuppageshift
	[paper]
	[flyer]

\definemeasure
	[small]
	[3mm]

\definemeasure
	[big]
	[\measure{small}*2]

\definelayout
	[first]
	[page]
	[page=flyer-page,
	 topspace=2\measured{big},
	 backspace=2\measured{small},
	 width=\dimexpr\paperwidth-4\measured{small}\relax,
	 height=\dimexpr\paperheight-4\measured{big}\relax]

\definelayout
	[second]
	[first]
	[topspace=4\measured{big},
	 backspace=2\measured{big},
	 width=\dimexpr\paperwidth-3\measured{big}\relax,
	 height=\dimexpr\paperheight-4\measured{big}-2\measured{big}\relax]

\definelayout
	[thirdandfourth]
	[second]
	[backspace=\measure{big},
	 width=\dimexpr\paperwidth-2\measured{big}\relax]

\definelayout
	[fifthandsixth]
	[first]
	[backspace=\measure{big},
	 width=\dimexpr\paperwidth-2\measured{big}\relax]

\definelayout [1] [first]
\definelayout [2] [second]
\definelayout [3] [thirdandfourth]
\definelayout [4] [thirdandfourth]
\definelayout [5] [fifthandsixth]
\definelayout [6] [fifthandsixth]


\setuphead[title][header=none,footer=none]

\definecolor [hs-logoblau] [c=1.0,m=0.46,y=0.0,k=0.42]
\definecolor [hs-dunkelblau] [c=0.65,m=0.36,y=0.0,k=0.26]
\definecolor [hs-mittelblau] [c=0.72,m=0.33,y=0.0,k=0.28]
\definecolor [hs-hellblau] [c=0.30,m=0.14,y=0.0,k=0.14]
\definecolor [hs-orange] [c=0.0,m=0.67,y=1.0,k=0.13]

\definefontfamily
    [mainface]
    [rm]
    [Tex Gyre Heros]



\setupmakeup [doublesided=no]
\setupinterlinespace[line=3ex]

\setuphead [title] [textcolor=hs-dunkelblau,textstyle=\bfc, align=right]
\setupbodyfont	[mainface,10pt]
\setuptolerance [verytolerant]
\mainlanguage [de]
\setbreakpoints[compound]

\definelayer[Hintergrund]
[x=0, y=0, width=\paperwidth, height=\paperwidth]

\setlayer[Hintergrund]
[x=1.2cm, y=1cm]
{\externalfigure[../bilder/logo.pdf][width=7cm]}

\definelayer[topic1]
[x=-3mm, y=-3mm, width=\paperwidth, height=\paperheight]

\setlayer[topic1]
[x=-3mm, y=-3mm]
{\externalfigure[../bilder/topic1.png][width=102mm]}

\definelayer[topic2]
[x=0, y=-3mm, width=\paperwidth, height=\paperheight]

\setlayer[topic2]
[x=0cm, y=-3mm]
{\externalfigure[../bilder/topic2.png][width=99mm,height=58mm]}

\definelayer[topic3]
[x=0, y=0, width=\paperwidth, height=\paperwidth]

\setlayer[topic3]
[x=0cm, y=-3mm]
{\externalfigure[../bilder/topic3.png][width=102mm]}

\definelayer[blau]
[x=0, y=-3mm, width=\paperwidth, height=\paperheight]

\setlayer[blau]
[x=0mm,y=-3mm]
{\framed[frame=off,background=color, backgroundcolor=hs-dunkelblau,width=102mm, height=303mm]{}}

\showframe


\starttext
\setupbackgrounds[page][background=blau]

\startstandardmakeup

\externalfigure [../bilder/example.png] [width=\textwidth]
\blank[5*big]

\externalfigure [../bilder/logo.svg] [width=\textwidth]


\stopstandardmakeup

\starttitle[title={PAGE 2},marking{}]
\setupbackgrounds[page][background=topic1]



   \input lorem
\stoptitle 

\starttitle[title={PAGE 3},marking{ }]
\setupbackgrounds[page][background=topic2]

\input lorem
\stoptitle 



\starttitle[title={PAGE 4},marking{}]
\setuppapersize [flyer-page-small] [A4-flyer]

\setupbackgrounds[page][background=topic3]


  \input lorem

\framed[framecolor=hs-orange, background=color, backgroundcolor=hs-orange, foregroundcolor=white, offset=3ex, framecorner=round, backgroundcorner=round, location=hanging]{\tfb Call to action!}

\stoptitle

\starttitle[title={PAGE 5},marking{ }]

\input lorem 
\stoptitle 
\page
\setuppapersize [flyer-page] [A4-flyer]
\setlayer[blau]
[x=0mm,y=-3mm]
{\framed[frame=off,background=color, backgroundcolor=hs-dunkelblau,width=102mm, height=303mm]{}}
\starttextcolor[white]
   
\setupbackgrounds[page][background=blau]

\externalfigure [../bilder/example.jpg] [width=\textwidth]

\input lorem

\blank[4*big]
lorem\\
ipsum\\
dolor\\
Mail: info@example.com

\stoptitle 
\stoptextcolor
\stoptext
