Manipulate[
Column[
{
Row[{Dynamic@Plot[ψ[x,t][fn],{x,0,xmax},PlotRange->{0,1.58},ImageSize->is,ColorFunction->Function[{x,y},If[flashfunc[t],RGBColor[1,0,0],GrayLevel[grayfn[x,x0,1]]]],ColorFunctionScaling->False,PlotStyle->Thickness[If[flashfunc[t],0.02,0.008]],PlotRangeClipping->False,
Background->If[flashfunc[t],RGBColor[1,1,0.8],GrayLevel[0.985]],PlotLabel->Style[Framed[Row[{"Moving waves"}],RoundingRadius->3,FrameMargins->{{30,30},{1,1}},FrameStyle->Directive[Thin,GrayLevel[0.66]]],GrayLevel[0.2],Italic,Bold,14,FontFamily->"Helvetica"],Epilog->{
{Blue,PointSize[ps],Point[{x0,ψ[x0,t][fn]}]},
{ControlActive[GrayLevel[0.75],GrayLevel[0.15]],Arrowheads[{-.05,.05}],AnnotatedArrow[{Mod[λ(-m[fn]+1+(t/T)),λ],1.1},{Mod[λ(-m[fn]+1+(t/T)),λ]+λ,1.1},"λ"]},
{Dashed,Line[{{x0,ψ[x0,t][fn]},{xmax,ψ[x0,t][fn]}}]},
{{Polygon[{{x0-δop,0},{x0,0},{x0,1.55},{x0-δop,1.55}},VertexColors->{RGBColor[1,0.2353,0.7059,0],RGBColor[1,0.2353,0.7059,rop],RGBColor[1,0.2353,0.7059,rop],RGBColor[1,0.2353,0.7059,0]}]},{Polygon[{{x0,0},{x0+δop,0},{x0+δop,1.55},{x0,1.55}},VertexColors->{RGBColor[1,0.2353,0.7059,rop],RGBColor[1,0.2353,0.7059,0],RGBColor[1,0.2353,0.7059,0],RGBColor[1,0.2353,0.7059,rop]}]}},
{RGBColor[1,0.2353,0.7059,0.10],Thickness[0.025],Arrowheads[0.10],Arrow[{{x0+0.67,1.510},{xmax,1.510}}]},
{Text[Style[Row[{"t=",PaddedForm[t,{6-If[t>1,Floor[Log[10,t]],0],1}]}],RGBColor[0,0,0.8],Italic,Bold,14],{xmax-2.8,1.4}]},
{Text[Style[Row[{"(Subscript[x, 0])=",PaddedForm[x0,{4,1}]}],RGBColor[0,0,0.8],Italic,Bold,14],{x0-1,1.4}]},
{Dashed,Arrow[{{x0,1.3},{x0,0.1}}]},
{If[flashfunc[t],RGBColor[0.95,0.95,0,0.85],RGBColor[0.8,0.8,1,0.35]],Disk[{20,1.25},If[flashfunc[t],2,0.7]{1,1 (1.5/xmax)GoldenRatio}]
}}],Spacer[20],
Dynamic@Plot[Piecewise[{{ψ[x0,tt][fn],tt<t},{0,tt>t}}],{tt,0,tmax},PlotRange->{0,1.58},PerformanceGoal->"Quality",ImageSize->is,Background->RGBColor[1,0.2353,0.7059,0.08],PlotPoints->40,PlotStyle->{Thickness[0.0075]},
ColorFunction->Function[x,RGBColor[0.5,0,0,(1.-((Abs[t-x])/tmax))]],ColorFunctionScaling->False,PlotLabel->Style[Framed[Row[{"Time view at (Subscript[x, 0])=",Style[PaddedForm[x0,{4,1}],Bold,18, RGBColor[0.5,0.1,0.5]]}],RoundingRadius->3,FrameMargins->{{30,30},{1,1}}],GrayLevel[0.2],Italic,Bold,14,FontFamily->"Helvetica"],Epilog->{
{Red, PointSize[ps],Point[{t,ψ[x0,t][fn]}]},
If[t>T(Mod[+m[fn]+(x0/λ),1]+1),AnnotatedArrow[{T(Mod[+m[fn]+(x0/λ),1]),1.1},{T(Mod[+m[fn]+(x0/λ),1]+1),1.1},"T"]
,Point[{-1,0}]],
{Dashed,Line[{{0,ψ[x0,t][fn]},{t,ψ[x0,t][fn]}}]},
{Text[Style[Row[{"t=",PaddedForm[t,{5-If[t>1,Floor[Log[10,t]],0],1}]}],RGBColor[0.95,0.1,0.1],Italic,Bold,14],{t,1.4}]},
{Thick,Line[{{t-5,1.4},{0,1.4}},VertexColors->{Red,Blue}]},
{Dashed,Arrow[{{t,1.3},{t,0.1}}]}
}]}],
Row[{
Dynamic@Plot[ψ[x,tflash[t]][fn],{x,0,xmax},PlotRange->{0,1.58},ImageSize->is,PlotStyle->If[flashfunc[t],{Red,Thick},GrayLevel[1-(((1-(1/flash)Mod[t,flash]))^1)]],Background->If[flashfunc[t],RGBColor[1,1,0.8],GrayLevel[0.985]],PlotLabel->Style[Framed[Row[{"Space view at t=",PaddedForm[tflash[t],{5,1}]}],RoundingRadius->3,FrameMargins->{{30,30},{1,1}}],GrayLevel[0.2],Italic,Bold,14,FontFamily->"Helvetica"],
Epilog->{
{GrayLevel[1-(((1-(1/flash)Mod[t,flash]))^1)],AnnotatedArrow[{Mod[λ(-m[fn]+1+((tflash[t])/T)),λ],1.1},{Mod[λ(-m[fn]+1+((tflash[t])/T)),λ]+λ,1.1},"λ"]},
Text[Style[Row[{"t=",PaddedForm[tflash[t],{6-If[tflash[t]>1,Floor[Log[10,tflash[t]]],0],1}]}],Italic,Bold,14],{xmax-2.8,1.4}]
}
],Spacer[20],
If[show3dgraph,
Graphics3D[{{(*Opacity[0.35],*)gr3d},{gr3dp},
{Opacity[0.75],AbsolutePointSize[8.5],Dynamic@Point[{x0,t,ψ[x0,t][fn]}]},
{Arrowheads[{-Small,Small}],Arrow[{{λ(1-m[fn]),0,1.15},{λ(1-m[fn])+λ,0,1.15}}]},
{Arrowheads[{-Small,Small}],Arrow[{{xmax,T(Mod[+m[fn]+(xmax/λ),1]),1.15},{xmax,T(Mod[+m[fn]+(xmax/λ),1]+1),1.15}}]},
Text[Style["λ",20,Bold,RGBColor[0.0,0.0,0.0]],{λ(1-m[fn])+(1/2)λ,0,1.3}],
Text[Style["T",20,Bold,RGBColor[0.0,0.0,0.0]],{xmax,T(Mod[+m[fn]+(xmax/λ),1]+(1/2)),1.3}]
},
PlotRange->{{0,xmax},{0,tmax},{-0.2,1.5}},ImageSize->is,BoxRatios->{2,2,1},Axes->True,Method->{"RotationControl"->"Globe"},ViewPoint->{4,-2,4},
AxesLabel->{Style["x",Italic,Bold,14],Style["t",Italic,Bold,14],None},AxesEdge->{{-1,-1},{1,-1},None},PlotLabel->Style[Framed[Row[{"3D view of",Style[" ψ",FontSlant->Plain,14,FontFamily->"Helvetica"],"(x,t)"}],RoundingRadius->3,FrameMargins->{{30,30},{1,1}}],GrayLevel[0.2],Italic,Bold,14,FontFamily->"Helvetica"]]
]
}]
},Spacings->3],
(*Beginning of controls section*)
Column[{
Style["Controls",14,Bold],
Column[{
Row[{
Control[{{fn,1,"function type "},
{
1->"Asymmetric wave ",
2->"Harmonic wave"
},ControlType->PopupMenu}],
Control[{{anrate,anirate,"animation rate"},{0.5,1,2,3,4,5}}],Control[{{show3dgraph,(*True,*)False,"Show 3D graph (it's slow)"},{False,True}}]},"   "],
Row[{Column[{
Row[{
Control[{{T,15,"wave period (T)"}
,Table[k,{k,{9,12,15,20,25,35,60}}],ControlType->RadioButtonBar,Appearance->"Labeled"}]
}],
Row[{
Control[{{λ,12,"wave length (λ)"},Table[k,{k,{4,6,10,12,15,20,30}}],ControlType->RadioButtonBar,Appearance->"Labeled"}]
}]
}],
Column[{Row[{Style["   ->   wave speed = ",Italic, GrayLevel[0.5],12],Panel[Dynamic[Style[PaddedForm[N[(λ/T)],{6,2}],Italic, GrayLevel[0.5]]],Appearance->Frameless]}]}],
Spacer[180],
Column[{
Style["Wave parameters",12,Bold],Style[Row[{"λ=",Dynamic@λ}],12],Style[Row[{"T=",Dynamic@T}],12],Style[Row[{"v=",Dynamic[PaddedForm[N[(λ/T)],{6,2}]]}],12]
},Frame->{{{True,True},{False,False}}},FrameStyle->Directive[GrayLevel[0.8]],ItemSize->{12,1},Alignment->{Center,Center},Spacings->0.7]
}],
Row[{
Control[{{x0,12,"            (Subscript[x, 0])           "},0,xmax,0.1,Appearance->"Labeled"}]
}],
Row[{Control[{{t,0.,"time animation"},0.,tmax,ControlType->Animator, AnimationRunning->False,AnimationRate->anrate,AnimationRepetitions->2,AppearanceElements->{"PlayPauseButton","FasterSlowerButtons","ResetButton"}}],Spacer[40],
Row[{Control[{{t,0.,"time control"},0.,tmax,0.1,AnimationRate->anrate}],Row[{Style["time = ",12],Panel[Dynamic[PaddedForm[t,{6,1}]],Appearance->Frameless]}]},"   "]
},Alignment->{Center},Frame->All]
},{Left,Center},Frame->False,Dividers->{{None},{2->Gray,3->Gray,4->Gray}},Spacings->2,ItemSize->{84,1.5}]
},{Center,Center},Spacings->2,ItemSize->{84,0.5},Dividers->{{1->Gray,2->Gray},{1->Gray,2->Directive[Thick,Gray],3->Gray}}],
(*Initialization*)
Initialization:>(tsta=0;
ψ[xx_,ts_][1]:=((Sin[((Mod[(-(((Sqrt[π]) xx)/λ)+((Sqrt[π])/T) ts),(Sqrt[π])])^2)])^2);m[1]=((Sqrt[2])/2.);
ψ[xx_,ts_][2]:=-(1/2)(Cos[-((2π xx)/λ)+((2π)/T) ts])+(1/2);m[2]=(1/2.);
gr3d=Dynamic[First@Plot3D[ψ[xx,tsta][fn],{xx,0.,xmax},{tsta,0.,tmax},PlotRange->{-0.2,1.5},Mesh->None,PlotStyle->{Directive[RGBColor[1,1,1,0.35]]},BoundaryStyle->Directive[RGBColor[0.3,0.3,0.4,0.75],Thick],BoxRatios->{2,2,1}, PerformanceGoal->(*"Speed"*)"Quality"(*,MaxRecursion->3,PlotPoints->{15,25}*),MaxRecursion->4,PlotPoints->{15,25}],TrackedSymbols->{λ,T,fn}];
gr3dp=Dynamic[First@ParametricPlot3D[{x0,tsta,ψ[x0,tsta][fn]},{tsta,0.,tmax},PlotRange->{{0.,xmax},{0.,tmax},{-0.2,1.5}},Mesh->None,PlotStyle->Directive[Red],PerformanceGoal->"Speed"](*,TrackedSymbols->{λ,T,x0,fn}*)];AnnotatedArrow[p_,q_,label_]:={Arrowheads[{{-.03,0},{.1,0.5,Graphics[Inset[Style[label,Medium],{0,0.5}]]},{.03,1}}],Arrow[{p,q}]};
flash=7.;flashdur=0.7;anirate=2;anirate3D=1;
xmax=24.;tmax=60.;
is=1{400,300};(* plot imagesize*)
ps=0.03;(* pointsize*)
δop=0.75; (*semilength of x0 rectangle*)
rop=0.2;(*rectangle max opacity*)
flashfunc[tt_]:=If[tt≥flash&&flash<flash+Mod[tt,flash]<flash+flashdur,True,False];
tflash[tt_]:=flash*Floor[(tt/flash)];
grayfn = Compile[{{x, _Real},{x0, _Real},{w, _Real}},Piecewise[{{-(w/x0)(x-x0),x<x0},{(w/(xmax-x0))(x-x0),x≥x0}}]]
)]