\mode<presentation>

% Frame title
\defbeamertemplate*{frametitle}{texsx}[1][]
{
\vskip1cm%
    \begin{beamercolorbox}[wd=\paperwidth,ht=1cm]{frametitle} 
    \begin{tikzpicture}
        \definecolor{th-gray}{HTML}{38434b};
        \useasboundingbox[fill=th-gray](0,0) rectangle(.7*\the\paperwidth,1.2);
        \ifx\insertframesubtitle\@empty%
            {\node[anchor=west, white,font=\large] at (1,0.61){\insertframetitle};}
            \else%
                {\node[anchor= west, white,font=\large] at (1,0.81){\insertframetitle};%
                \node[anchor= west, white,font=\small] at (1,0.41){\insertframesubtitle};}%
            \fi
        \end{tikzpicture}
    \end{beamercolorbox}
}

\mode<all>
