Conditional statement is not working, I'm getting an error that "Missing number treated as zero"
\documentclass[border=10pt,tikz]{standalone}
\usepackage{xcolor}
\definecolor{lava}{rgb}{0.81, 0.06, 0.13}
\definecolor{myblue}{rgb}{0.0, 0.30, 0.60}
\usepackage {ifthen}
\usepackage {tikz}
\usetikzlibrary{calc}
\definecolor{metallicBlue}{RGB}{44,88,128}
\tikzstyle arrowstyle=[scale=1]
\usetikzlibrary{arrows,shapes,positioning}
\usetikzlibrary{angles, arrows.meta,quotes}
\usepackage{pgfplots,tikz}
\usetikzlibrary{angles, arrows.meta,quotes}
\usepackage{pgfplots,tikz}
\usetikzlibrary{decorations.markings}
\begin{document}
\def\t{1}
\foreach \angle in {0,0.5,...,11}
{
\begin{tikzpicture}[dot/.style = {circle, fill, minimum size=4pt,inner sep=0pt},arr/.style = {thick,cap=round, -{Straight Barb[angle=45:4pt 3]}}]
\pgfmathtruncatemacro{\ang}{\angle+1};
\pgfmathtruncatemacro{\angg}{\angle+2};
\ifnum\value{\angle} <12{
\fill[metallicBlue] (0,0) rectangle (10.5,\t);
\fill[myblue!20!white] (0,\t) rectangle (10.5,4.25);
\draw plot[samples at={0,.5,...,\angle}] (\x,{2.625+1.6*sin(deg(\x*pi))});
\draw[dashed] plot[samples at={0,1,...,\ang}] (\x,{2.625+1.6*sin(deg(\x*pi/2))});
\draw[lava] (0,2.625)--(\angg,2.625);
\fill[metallicBlue] (0,4.25) rectangle (10.5,4.25+\t);
\node(d)[]at(11.5,0){};
\node[] at(5.5,0.5){$n_2$};
\node[] at(5.5,2.5){$n_1$};}
else
{ \node (n3) [dot, color=myblue] at(\angle,{2.625+1.6*sin(deg(\angle*pi))}){};
\node (n3) [dot, color=myblue] at(\angle,{2.625+1.6*sin(deg(\angle*pi/2))}){};
\node (n3) [dot, color=myblue] at(\angg,2.625){};}
\fi
\end{tikzpicture}}
\end{document}