//  !!!!
//  STUDENTS, DO NOT EDIT THIS FILE!
//  !!!!

#import "../projectInfo.typ": student, report

#let coverUnit = 398.38567pt/0.9 // derived from latex template
#let cu = coverUnit // shorthand
#let pageHeight = 841.89pt

#let white = rgb(255,255,255)
#let black-ish = rgb(6, 6, 12)
#let cyan = rgb(0, 185, 242)

#let imgHeight(image) = context{ // function to measure image height
  let measurement = measure(image)
  [#measurement.height]
}

#let titlepage( // Cover page function definition
    title: "Thesis Title",
    subtitle: "Optional Subtitle",
    studentName: "<NAME>",
    coverIMG: "graphics/COVER.jpg",
        body,
) = { //function maps to output

  set page(background: none)

  set page( // Set page margins for titlepage
      margin: (left: (21cm-cu*0.975)/2, right: (21cm-cu*0.975)/2, top: auto, bottom: auto)
      )
  
  set align(top+center)
  pagebreak()
  text(24.88pt, font: "New Computer Modern Sans", weight: 600)[#report.title]; linebreak()
  text(14.4pt, font:  "New Computer Modern Sans", weight: "semibold")[#report.subtitle]; linebreak(); v(1cm)
  smallcaps(text(size: 14.4pt )[#report.type]); linebreak(); v(7cm)
  text(14.4pt)[#student.name]; linebreak(); v(1cm)
  text(14.4pt)[#datetime.today().display("[month repr:long] [day padding:none], [year]")]; linebreak()
  align(bottom)[#text()[Faculty of Mechanical, Maritime and Materials Engineering (ME) · Delft University of
Technology]]

  pagebreak()
  set text(size: 12pt)
  set align(bottom+left)
  stack(
    dir: ltr,
    spacing: 5%,
    image("../graphics/template/EXAMPLELOGO.png", width: 25%),
    align(horizon)[
    #block(
      fill: none,
      inset: 4pt,
      radius: 0pt,
      clip: true,
      width: 70%,
      [The work in this thesis was supported by Aqueduct Swimming Supplies    Incorporated. Their cooperation is hereby gratefully acknowledged.]
    )]
    
  )
  v(1cm)
  stack(
  dir: ltr,
  image("../graphics/template/TU_LOGO.png"),
  align(horizon+right)[
  #image(
    "../graphics/template/DCSCnew.png",
    height: 42.27pt
  )]
  )
  [Copyright #sym.copyright]; linebreak()
  [All Rights Reserved. ]

  body
}