$\textsf{NEW PRODUCT}$

\text{Slide to animate}

example = 0
ints = Shuffle(Sequence[2, 6])
int = Element(ints, Mod[example, Length[ints]] + 1)
dens = Shuffle(Sequence[2, 10])
den = Element(dens, Mod[example, Length[dens]] + 1)
nums = Shuffle(KeepIf[(kk / den * int) ≤ 4, kk, Sequence[den - 1]])
num: nums(1)
result: (int * num / den)
resultFloor: floor(result)
resultFracPart: result - resultFloor
resultSimplified: "" + (LaTeX[If[Denominator[result] ≟ 1, Text[Numerator[result]], (((("\frac{" * Numerator[result]) * "}{") * Denominator[result]) * "}")]]) + ""
resultUnsimplified: (((("\frac{" * (num * int)) * "}{") * den) * "}")
canbesimplified: resultSimplified ≠ resultUnsimplified
maxSLD: (num * int) + 1 + (2 * (resultFracPart ≠ 0 ∧ canbesimplified))
anim = 1 (slider from 1 to maxSLD, step 0.01)
If4R: {(9, 3.5), (12, 3.5), (9, 0), (12, 0)}
If3R: {(9, 3.5), (12, 3.5), (10.5, 0)}
If2R: {(9, 1.75), (12, 1.75)}
If1R: {(10.5, 1.75)}
If6: {(0, 0), (3, 0), (6, 0), (0, 3.5), (3, 3.5), (6, 3.5)}
If5: {(1.5, 0), (4.5, 0), (0, 3.5), (3, 3.5), (6, 3.5)}
If4: {(1.5, 0), (4.5, 0), (1.5, 3.5), (4.5, 3.5)}
If3: {(0, 1.75), (3, 1.75), (6, 1.75)}
If2: {(1.5, 1.75), (4.5, 1.75)}
wid: 2
AppSize = Corner(5)
CornersLeft = Element({If2, If3, If4, If5, If6}, int - 1)
n: ceil((int * num / den))
CornersRight = Element({If1R, If2R, If3R, If4R}, n)
widthOfGraphicsView: Max[Zip[x(PP), PP, CornersRight]] + wid - Min[Zip[x(PP), PP, CornersLeft]]
border: (14.581818181818194 - widthOfGraphicsView) / 2
MoveGuideLine = (12.7635, -1.4752)
hGuideline: y = y(MoveGuideLine)
vGuideline: x = x(MoveGuideLine)
region1 = Polygon({(0, 0), (8, 0), (8, 6), (0, 6)})
f: y = y(Corner[4]) - (y(Corner[4] - Corner[1]) / 500 * 24)
eq1: x = x(Corner[4]) + (x(Corner[2] - Corner[1]) / 800 * 16)
eq2: x = x(Corner[2]) - (x(Corner[2] - Corner[1]) / 800 * 16)
region2 = Polygon({(9, 0), (14, 0), (14, 6), (9, 6)})
Cor1: (Min[Zip[x(PP), PP, CornersLeft]] - border, -2.68)
Cor3: (Max[Zip[x(PP), PP, CornersRight]] + wid + border, 6.44727)
CornerFracMod1: (0, 3.5)
CornerFracMod2: CornerFracMod1 + (wid, 0)
hei: 2.5
CornerFracMod3: CornerFracMod1 + (wid, hei)
CornerFracMod4: CornerFracMod1 + (0, hei)
fracMod, sidebottom, sideright, sidetop, sideleft = Polygon(CornerFracMod1, CornerFracMod2, CornerFracMod3, CornerFracMod4)
modelDivisions = Sequence(Segment[Translate[CornerFracMod1, Vector[(kk * (0, hei / den))]], Translate[CornerFracMod2, Vector[(kk * (0, hei / den))]]], kk, 1, den - 1)
fracPart = Polygon({CornerFracMod1, CornerFracMod2, Translate[CornerFracMod2, (0, hei / den)], Translate[CornerFracMod1, (0, hei / den)]})
m1 = Zip(Translate[{sidebottom, sideleft, sideright, sidetop}, Vector[CornerFracMod1, PP]], PP, CornersLeft)
m2 = Zip(Translate[modelDivisions, Vector[CornerFracMod1, PP]], PP, CornersLeft)
CornersTilesLeft = Flatten(Zip[Sequence[Translate[PP, (0, (ii * hei / den))], ii, 0, num - 1], PP, CornersLeft])
m3 = Zip(Translate[{sidebottom, sideleft, sideright, sidetop}, Vector[CornerFracMod1, PP]], PP, CornersRight)
m4 = Zip(Translate[modelDivisions, Vector[CornerFracMod1, PP]], PP, CornersRight)
text1: "\bold{" + (LaTeX[int]) + "\times\frac{" + (LaTeX[num]) + "}{" + (LaTeX[den]) + "}}"
TilesLeft = Zip(Translate[fracPart, PP - (0, 3.5)], PP, CornersTilesLeft)
CornersTilesRight = Flatten(Zip[Sequence[Translate[PP, (0, (ii * hei / den))], ii, 0, den - 1], PP, CornersRight])
TilesMoving = Sequence(Translate[Element[TilesLeft, ii], Vector[(Min[Max[anim - ii, 0], 1] * Vector[CornersTilesLeft(ii), CornersTilesRight(ii)])]], ii, 1, Length[CornersTilesLeft])
TilesMovingBlack: TilesMoving
text3: "\bold{\frac{" + (LaTeX[num]) + "}{" + (LaTeX[den]) + "}\times" + (LaTeX[int]) + "}"
strSize: 400
text4 = Text(centerText[(strSize * " px"), Element[{text1, text3}, Mod[example, 2] + 1]], (0, 0), true, true, 1, -1)
text6: "\bold{" + (LaTeX[resultUnsimplified]) + "" + (LaTeX[If[anim ≟ maxSLD, If[canbesimplified ∧ anim ≥ (num * int) + 1, ("=" * resultSimplified), ""]]]) + "" + (LaTeX[If[maxSLD ≟ anim, If[result ≤ 1 ∨ resultFracPart ≟ 0, "", (("=" * resultFloor) * FractionText[resultFracPart])]]]) + "}"
text7 = Text(centerText["240 px", text6], (9, 0), true, true, 1, -1)
xequal: (Max[Zip[x(PP), PP, CornersLeft]] + wid + Min[Zip[x(PP), PP, CornersRight]]) / 2
text5 = Text("=", (xequal, -0.7), true, true, 0, 0)
text2 = Text("=", (xequal, 3), true, true, 0, 0)
tabOrder: {anim, btnNew}
denominatorResult = Denominator(result)
m5 = Zip(Sequence[Translate[Polygon[{PP, PP + (wid, 0), PP + (wid, hei / denominatorResult), PP + (0, hei / denominatorResult)}], (0, (ii * hei / denominatorResult))], ii, 0, denominatorResult - 1], PP, CornersRight)
c1: TilesMoving(floor(anim))
c2: TilesMovingBlack(floor(anim))
colorm4: If[canbesimplified ∧ resultFracPart ≠ 0, Max[37, 255 + ((37 - 255) / 2 * (maxSLD - anim))], 37] / 255
speed: 1

Tool: centerText
centerText(sizeStr,textStr)
Input: sizeStr, textString
Output: centeredLatex

this is dynamic centered text

centeredLatex: (((("\begin{tabular}\hspace{" * sizeStr) * "}\\") * textString) * "\end{tabular}")