\ProvidesPackage{presento}
\mode<presentation>

% removing navigation symbols
\setbeamertemplate{navigation symbols}{}

% packages
\usepackage{xcolor}
\usepackage{fontspec}
\usepackage{setspace}
\usepackage{tikz}
\usepackage{enumitem}

% colors
\definecolor{colororange}{HTML}{E65100} % orange
\definecolor{colordgray}{HTML}{795548} % dark gray for note
\definecolor{colorhgray}{HTML}{212121} % heavy dark gray for normal text
\definecolor{colorgreen}{HTML}{009688} % green
\definecolor{colorlgray}{HTML}{FAFAFA} % background light gray
\definecolor{colorblue}{HTML}{0277BB} % blue

% font sizes
\newcommand{\fontsizeone}{2.292em}
\newcommand{\fontsizetwo}{1.217em}
\newcommand{\fontsizethree}{0.875em}
% line spaces
\newcommand{\linespaceone}{2}

% font families
% DEdd: removed path, set Lato to 'Lato-Light', set Montserrat to Bold
%       also set AlegreyaSansSC font for lato and inconsolate
\newfontfamily{\montserratfont}[BoldFont=Montserrat-Bold]{Montserrat-Bold}
\newfontfamily{\notosansfont}[BoldFont=NotoSans-Bold,ItalicFont=NotoSans-Italic,BoldItalicFont=NotoSans-BoldItalic,SmallCapsFont=AlegreyaSansSC-Regular]{NotoSans-Regular}
\newfontfamily{\latolightfont}[SmallCapsFont=AlegreyaSansSC-Regular]{Lato-Light}
\newfontfamily{\inconsolatafont}[SmallCapsFont=AlegreyaSansSC-Regular]{Inconsolata}

% beamer template changes
\setbeamertemplate{frametitle}{
 \vspace{0.40em}
 \noindent
 \hspace{-1.22em}
 \tikz[overlay,remember picture,baseline=0.3em]{\fill[fill=colorblue]  (-0.3,0.05) rectangle (0,0.9); }\latolightfont\color{colorblue}~~\insertframetitle%
}

\setmainfont[Ligatures=TeX,BoldFont=NotoSans-Bold,ItalicFont=NotoSans-Italic,BoldItalicFont=NotoSans-BoldItalic,SmallCapsFont=AlegreyaSansSC-Regular]{NotoSans-Regular}
\setsansfont[Ligatures=TeX,BoldFont=NotoSans-Bold,ItalicFont=NotoSans-Italic,BoldItalicFont=NotoSans-BoldItalic,SmallCapsFont=AlegreyaSansSC-Regular]{NotoSans-Regular}
\setmonofont[Ligatures=TeX,SmallCapsFont=AlegreyaSansSC-Regular]{Inconsolata}

% frame counter
\newcounter{totalfr}
\setbeamertemplate{footline}{
  \ifnum\inserttotalframenumber=1
    \setcounter{totalfr}{2}
  \else
     \setcounter{totalfr}{\inserttotalframenumber}
  \fi
  \hfill{
    \tikz{
      \filldraw[fill=colorblue!40, draw=colorblue!50]  (0,0) -- (0.2,0) arc (0:{\value{framenumber}*(360/(\value{totalfr}-1))}:0.2) -- (0,0);
      \node at (0,0) {\normalsize \color{colororange}\tiny{\insertframenumber}};
    }
  }
  \hspace{2em}
  \vspace*{1em}
}

% custom commands
\newcommand{\hugetext}[1]{
  {
  \begin{spacing}{\linespaceone}
   \fontsize{\fontsizeone}{\fontsizeone}{\montserratfont #1}
  \end{spacing}
  }
}

\newcommand{\largetext}[1]{
 {\fontsize{\fontsizetwo}{\fontsizeone}\selectfont{#1}}
}

\newcommand{\setnote}[1]{
 {\fontsize{\fontsizethree}{\fontsizeone}\selectfont\color{colordgray}{#1}}
}

\newcommand{\rtarrow}{$\color{colorblue}{\rightarrow}$}

\newcommand{\itemR}{
 \item[\rtarrow]
}

\newcommand{\framecard}[2][colorgreen]{
  {\setbeamercolor{background canvas}{bg=#1}
    \begin{frame}[plain]
    \vfill
    \begin{center}
     {#2}
    \end{center}
    \vfill
    \end{frame}
  }
}
\newcommand{\framepic}[3][1]{
  {
    \usebackgroundtemplate{%
    \tikz[overlay,remember picture] \node[opacity=#1, at=(current page.center)] {
      \includegraphics[width=\paperwidth]{#2}};
    }
    \begin{frame}
    #3
    \end{frame}
  }
}

\newenvironment{baseitemize}
  {\itemize[leftmargin=*]}
  {\enditemize}

\newenvironment{fullpageitemize}
  {\itemize[nolistsep,itemsep=\fill,leftmargin=*]}
  {\vfill\enditemize}
