Manipulate[Module[{canHeight=1.2,canWidth=0.6,waterLevel,cg,tiltAngle,theta,R,canShape,waterShape,cgPos,supportPos,gravityVec,normalVec,wave,wavePoly,waterYL,waterYR,baseY},

(*水面の高さ*)
waterLevel=waterRatio*canHeight;

(*合成重心の高さ（固定座標系）*)
cg=(canMass*canHeight*0.5+waterMass*waterLevel*0.5)/(canMass+waterMass);

(*静止できるときの傾き角度*)
tiltAngle=ArcTan[(canWidth/2)/cg];

(*水の割合に応じた回転角度*)
theta=If[0<=t<=0.1,0.785,If[0.35<=waterRatio<=0.4,tiltAngle,If[waterRatio>0.4,Min[Pi/2-0.01,tiltAngle+0.6*t],If[waterRatio<0.35,Max[-(Pi/2),tiltAngle-(0.4*t)],tiltAngle]]]];

(*回転中心を右下に設定*)
R=RotationTransform[-theta,{canWidth/2,0}];

(*缶の外形*)
canShape=GeometricTransformation[{EdgeForm[Black],FaceForm[LightGray],Rectangle[{-canWidth/2,0},{canWidth/2,canHeight}]},R];

(*水面の傾き（x軸と水平）に応じたy座標*)
waterYL=waterLevel-Tan[theta]*canWidth/2;
waterYR=waterLevel+Tan[theta]*canWidth/2;
waterYL=Max[0,Min[waterYL,canHeight]];
waterYR=Max[0,Min[waterYR,canHeight]];

(*波打つ水面関数*)
wave[n_,amp_,len_,phase_]:=Table[{x,waterYL+(waterYR-waterYL)*(x+canWidth/2)/canWidth+amp*Sin[2 Pi n x/len+phase]},{x,-canWidth/2,canWidth/2,0.005}];

(*水*)
wavePoly=Join[{{-canWidth/2,0}},wave[2,0.015,canWidth,2 Pi t],{{canWidth/2,0}}];
waterShape=GeometricTransformation[{Blue,EdgeForm[],Opacity[0.2],Polygon[wavePoly]},R];

(*重心と支持点の描画*)
cgPos=R[{0,cg}];
supportPos=R[{canWidth/2,0}];
gravityVec={0,-0.2};
normalVec={0,0.2};

Graphics[{GrayLevel[0.3],Rectangle[{-2,-2},{2,0}],LightGray,canShape,waterShape,Red,PointSize[Large],Point[cgPos],Black,PointSize[Medium],Point[supportPos],Dashed,Line[{supportPos,cgPos}],Red,Arrow[{cgPos,cgPos+gravityVec}],Text["mg",cgPos+gravityVec*1.2,{0,-1}],Green,Arrow[{supportPos,supportPos+normalVec}],Text["N",supportPos+normalVec*1.2,{0,1}]},PlotRange->{{-0.5,1.5},{-0.2,1.5}},Axes->False,ImageSize->Large,Background->LightYellow]],
(*インターフェース*)
{{waterRatio,0.5,"水の割合"},0,1},{{t,0,"Time"},0,2.5,Animator,AnimationRunning->False,AnimationRate->3,AnimationRepetitions->1.001},
(*初期化*)Initialization:>(canMass=1;waterMass=4;)]

frames=Table[With[{tVal=t},Module[{canHeight=1.2,canWidth=0.6,waterLevel,cg,tiltAngle,theta,R,canShape,waterShape,cgPos,supportPos,gravityVec,normalVec,wave,wavePoly,waterYL,waterYR,baseY,canMass=1,waterMass=4,waterRatio=0.7},waterLevel=waterRatio*canHeight;
cg=(canMass*canHeight*0.5+waterMass*waterLevel*0.5)/(canMass+waterMass);
tiltAngle=ArcTan[(canWidth/2)/cg];
theta=If[0<=tVal<=0.1,0.785,If[0.35<=waterRatio<=0.4,tiltAngle,If[waterRatio>0.4,Min[Pi/2-0.01,tiltAngle+0.6*tVal],If[waterRatio<0.35,Max[-(Pi/2),tiltAngle-(0.4*tVal)],tiltAngle]]]];
R=RotationTransform[-theta,{canWidth/2,0}];
canShape=GeometricTransformation[{EdgeForm[Black],FaceForm[LightGray],Rectangle[{-canWidth/2,0},{canWidth/2,canHeight}]},R];
waterYL=waterLevel-Tan[theta]*canWidth/2;
waterYR=waterLevel+Tan[theta]*canWidth/2;
waterYL=Max[0,Min[waterYL,canHeight]];
waterYR=Max[0,Min[waterYR,canHeight]];
wave[n_,amp_,len_,phase_]:=Table[{x,waterYL+(waterYR-waterYL)*(x+canWidth/2)/canWidth+amp*Sin[2 Pi n x/len+phase]},{x,-canWidth/2,canWidth/2,0.005}];
wavePoly=Join[{{-canWidth/2,0}},wave[2,0.015,canWidth,2 Pi tVal],{{canWidth/2,0}}];
waterShape=GeometricTransformation[{Blue,EdgeForm[],Opacity[0.2],Polygon[wavePoly]},R];
cgPos=R[{0,cg}];
supportPos=R[{canWidth/2,0}];
gravityVec={0,-0.2};
normalVec={0,0.2};
Graphics[{GrayLevel[0.3],Rectangle[{-2,-2},{2,0}],LightGray,canShape,waterShape,Red,PointSize[Large],Point[cgPos],Black,PointSize[Medium],Point[supportPos],Dashed,Line[{supportPos,cgPos}],Red,Arrow[{cgPos,cgPos+gravityVec}],Text["mg",cgPos+gravityVec*1.2,{0,-1}],Green,Arrow[{supportPos,supportPos+normalVec}],Text["N",supportPos+normalVec*1.2,{0,1}]},PlotRange->{{-0.5,1.5},{-0.2,1.5}},Axes->False,ImageSize->Large,Background->LightYellow]]],{t,0,2.5,0.05}];

Export["右倒れ.gif",frames,"DisplayDurations"->0.05]

frames=Table[With[{tVal=t},Module[{canHeight=1.2,canWidth=0.6,waterLevel,cg,tiltAngle,theta,R,canShape,waterShape,cgPos,supportPos,gravityVec,normalVec,wave,wavePoly,waterYL,waterYR,baseY,canMass=1,waterMass=4,waterRatio=0.1},waterLevel=waterRatio*canHeight;
cg=(canMass*canHeight*0.5+waterMass*waterLevel*0.5)/(canMass+waterMass);
tiltAngle=ArcTan[(canWidth/2)/cg];
theta=If[0<=tVal<=0.1,0.785,If[0.35<=waterRatio<=0.4,tiltAngle,If[waterRatio>0.4,Min[Pi/2-0.01,tiltAngle+0.6*tVal],If[waterRatio<0.35,Max[-(Pi/2),tiltAngle-(0.4*tVal)],tiltAngle]]]];
R=RotationTransform[-theta,{canWidth/2,0}];
canShape=GeometricTransformation[{EdgeForm[Black],FaceForm[LightGray],Rectangle[{-canWidth/2,0},{canWidth/2,canHeight}]},R];
waterYL=waterLevel-Tan[theta]*canWidth/2;
waterYR=waterLevel+Tan[theta]*canWidth/2;
waterYL=Max[0,Min[waterYL,canHeight]];
waterYR=Max[0,Min[waterYR,canHeight]];
wave[n_,amp_,len_,phase_]:=Table[{x,waterYL+(waterYR-waterYL)*(x+canWidth/2)/canWidth+amp*Sin[2 Pi n x/len+phase]},{x,-canWidth/2,canWidth/2,0.005}];
wavePoly=Join[{{-canWidth/2,0}},wave[2,0.015,canWidth,2 Pi tVal],{{canWidth/2,0}}];
waterShape=GeometricTransformation[{Blue,EdgeForm[],Opacity[0.2],Polygon[wavePoly]},R];
cgPos=R[{0,cg}];
supportPos=R[{canWidth/2,0}];
gravityVec={0,-0.2};
normalVec={0,0.2};
Graphics[{GrayLevel[0.3],Rectangle[{-2,-2},{2,0}],LightGray,canShape,waterShape,Red,PointSize[Large],Point[cgPos],Black,PointSize[Medium],Point[supportPos],Dashed,Line[{supportPos,cgPos}],Red,Arrow[{cgPos,cgPos+gravityVec}],Text["mg",cgPos+gravityVec*1.2,{0,-1}],Green,Arrow[{supportPos,supportPos+normalVec}],Text["N",supportPos+normalVec*1.2,{0,1}]},PlotRange->{{-0.5,1.5},{-0.2,1.5}},Axes->False,ImageSize->Large,Background->LightYellow]]],{t,0,2.5,0.05}];

Export["左倒れ.gif",frames,"DisplayDurations"->0.05]

frames=Table[With[{tVal=t},Module[{canHeight=1.2,canWidth=0.6,waterLevel,cg,tiltAngle,theta,R,canShape,waterShape,cgPos,supportPos,gravityVec,normalVec,wave,wavePoly,waterYL,waterYR,baseY,canMass=1,waterMass=4,waterRatio=0.375},waterLevel=waterRatio*canHeight;
cg=(canMass*canHeight*0.5+waterMass*waterLevel*0.5)/(canMass+waterMass);
tiltAngle=ArcTan[(canWidth/2)/cg];
theta=If[0<=tVal<=0.1,0.785,If[0.35<=waterRatio<=0.4,tiltAngle,If[waterRatio>0.4,Min[Pi/2-0.01,tiltAngle+0.6*tVal],If[waterRatio<0.35,Max[-(Pi/2),tiltAngle-(0.4*tVal)],tiltAngle]]]];
R=RotationTransform[-theta,{canWidth/2,0}];
canShape=GeometricTransformation[{EdgeForm[Black],FaceForm[LightGray],Rectangle[{-canWidth/2,0},{canWidth/2,canHeight}]},R];
waterYL=waterLevel-Tan[theta]*canWidth/2;
waterYR=waterLevel+Tan[theta]*canWidth/2;
waterYL=Max[0,Min[waterYL,canHeight]];
waterYR=Max[0,Min[waterYR,canHeight]];
wave[n_,amp_,len_,phase_]:=Table[{x,waterYL+(waterYR-waterYL)*(x+canWidth/2)/canWidth+amp*Sin[2 Pi n x/len+phase]},{x,-canWidth/2,canWidth/2,0.005}];
wavePoly=Join[{{-canWidth/2,0}},wave[2,0.015,canWidth,2 Pi tVal],{{canWidth/2,0}}];
waterShape=GeometricTransformation[{Blue,EdgeForm[],Opacity[0.2],Polygon[wavePoly]},R];
cgPos=R[{0,cg}];
supportPos=R[{canWidth/2,0}];
gravityVec={0,-0.2};
normalVec={0,0.2};
Graphics[{GrayLevel[0.3],Rectangle[{-2,-2},{2,0}],LightGray,canShape,waterShape,Red,PointSize[Large],Point[cgPos],Black,PointSize[Medium],Point[supportPos],Dashed,Line[{supportPos,cgPos}],Red,Arrow[{cgPos,cgPos+gravityVec}],Text["mg",cgPos+gravityVec*1.2,{0,-1}],Green,Arrow[{supportPos,supportPos+normalVec}],Text["N",supportPos+normalVec*1.2,{0,1}]},PlotRange->{{-0.5,1.5},{-0.2,1.5}},Axes->False,ImageSize->Large,Background->LightYellow]]],{t,0,2.5,0.05}];

Export["静止.gif",frames,"DisplayDurations"->0.05]