\NeedsTeXFormat{LaTeX2e}
\ProvidesClass{joris-cv}[2015/11/27 Joris CV class]
\LoadClass[10pt]{article}

\RequirePackage[hmargin=3cm,tmargin=2cm,bmargin=3.5cm,footskip=2cm]{geometry}

\RequirePackage[utf8]{inputenc}
\RequirePackage[T1]{fontenc}
\RequirePackage{fp,etoolbox,marvosym,bookman,titlesec,hyperref,tabularx,graphicx,fancyhdr,changepage,lastpage,ulem}
\RequirePackage[dvipsnames]{xcolor}
\RequirePackage[inline]{enumitem}
\RequirePackage{xifthen}

\setlength{\parindent}{0pt}
\color[HTML]{303030} % Default foreground color
\definecolor{link}{HTML}{505070}
\hypersetup{colorlinks,breaklinks,urlcolor=link,linkcolor=link}
\setlength{\tabcolsep}{0pt}

\pagestyle{fancy}
\lhead{}
\chead{}
\rhead{}
\renewcommand{\headrulewidth}{0pt}
\cfoot{\thepage\ / \pageref{LastPage}}

\newcommand{\header}[5] {
  \begin{minipage}[t]{0.65\textwidth}
    \centering
    {\Huge #1} \\
    \vspace{0.6em}
    {\Large #2} \\
  \end{minipage}
  \begin{minipage}[t]{0.35\textwidth}
    \begin{flushright}
      \vspace{-1.3em}
      \personal{#3}{#4}{#5}
    \end{flushright}
  \end{minipage}
  \vspace{1em}
}

\newcommand{\personal}[3] {
  \begin{tabular}{p{15pt}l}
    \iconLink{externalLink.png}{#1}{#1}
    \iconLink{git.png}{#2#3}{#3}
  \end{tabular}
}

\newcommand{\iconLink}[3] {
  \includegraphics[width=8px]{#1} & \href{#2}{\sf\small#3} \vspace{0.3em} \\
}

\titleformat{\section}
  {\LARGE\scshape\raggedright\color{brown}} % format
  {} % label
  {0em} % sep
  {} % before code
  [\titlerule\vspace{1em}] % after

\titleformat
  {\subsection} % command
  {\large\raggedright\bf} % format
  {} % label
  {0em} % sep
  {} % before code
  [\vspace{0.5em}] % after

\newcommand{\position}[6] {
  {\large\bf #1} \hspace{0.2em} {\color{gray}#2} \vspace{0.5em}

  {\color{OliveGreen}#3} \vspace{0.5em}

  \ifthenelse{\isempty{#4}}{}{#4 \vspace{1em}}

  \ifthenelse{\isempty{#5}}{}{#5 \vspace{1em}}

  \ifthenelse{\isempty{#6}}{}{#6 \vspace{1em}}

  \vspace{0.8em}
}

\newenvironment{bullets} {
  \vspace{-0.5em}
  \begin{enumerate}[label=\color{brown}$\bullet$,leftmargin=0.5cm]\itemsep2pt
} {
  \end{enumerate}
  \vspace{-0.5em}
}

\newenvironment{technos} {
  \begin{enumerate*}[label={}]
} {
  \end{enumerate*}
}

\newcommand{\techno}[1] {
  \hspace{-0.2cm}
  {\color{gray}\uline{\textcolor{black}{#1}}}
  \hspace{0.1cm}
}
