local W={}function W.Appear(W)W.Visible=true end function W.Fade(W,q,s)W.Visible=true if W:IsA("\084\101\120\116\076\097\098\101\108")then W.TextTransparency=1-q*(1-s.TextTransparency)elseif W:IsA("\073\109\097\103\101\076\097\098\101\108")then W.ImageTransparency=1-q*(1-s.ImageTransparency)end end function W.Wiggle(W,q,s)W.Visible=true local h=(s.InitialSize.Y.Offset*(1-q))*s.AnimateStyleAmplitude W.Position=s.InitialPosition+UDim2.new(0,0,0,(math.sin(((q*math.pi)*2)*s.AnimateStyleNumPeriods)*h)/2)end function W.Swing(W,q,s)W.Visible=true local h=(90*(1-q))*s.AnimateStyleAmplitude W.Rotation=math.sin(((q*math.pi)*2)*s.AnimateStyleNumPeriods)*h end function W.Spin(W,q,s)W.Visible=true W.Position=s.InitialPosition+UDim2.new(0,s.InitialSize.X.Offset/2,0,s.InitialSize.Y.Offset/2)W.AnchorPoint=Vector2.new(.5,.5)W.Rotation=(q*s.AnimateStyleNumPeriods)*360 end function W.Rainbow(W,q,s)W.Visible=true local h=Color3.fromHSV((q*s.AnimateStyleNumPeriods)%1,1,1)if W:IsA("\084\101\120\116\076\097\098\101\108")then local x=getColorFromString(s.TextColor3)W.TextColor3=Color3.new(h.r+q*(x.r-h.r),h.g+q*(x.g-h.g),h.b+q*(x.b-h.b))else local x=getColorFromString(s.ImageColor3)W.ImageColor3=Color3.new(h.r+q*(x.r-h.r),h.g+q*(x.g-h.g),h.b+q*(x.b-h.b))end end
-- These are functions responsible for animating how text enters. The functions are passed:
-- characters: A list of the characters to be animated.
-- animateAlpha: A value of 0 - 1 that represents the lifetime of the animation
-- properties: A dictionary of all the properties at that character, including InitialSize and InitialPosition

local animationStyles = {}

function animationStyles.Appear(character)
	character.Visible = true
end

function animationStyles.Fade(character, animateAlpha, properties)
	character.Visible = true
	if character:IsA("TextLabel") then
		character.TextTransparency = 1 - (animateAlpha * (1 - properties.TextTransparency))
	elseif character:IsA("ImageLabel") then
		character.ImageTransparency = 1 - (animateAlpha * (1 - properties.ImageTransparency))
	end
end

function animationStyles.Wiggle(character, animateAlpha, properties)
	character.Visible = true
	local amplitude = properties.InitialSize.Y.Offset * (1 - animateAlpha) * properties.AnimateStyleAmplitude
	character.Position = properties.InitialPosition
		+ UDim2.new(0, 0, 0, math.sin(animateAlpha * math.pi * 2 * properties.AnimateStyleNumPeriods) * amplitude / 2)
end

function animationStyles.Swing(character, animateAlpha, properties)
	character.Visible = true
	local amplitude = 90 * (1 - animateAlpha) * properties.AnimateStyleAmplitude
	character.Rotation = math.sin(animateAlpha * math.pi * 2 * properties.AnimateStyleNumPeriods) * amplitude
end

function animationStyles.Spin(character, animateAlpha, properties)
	character.Visible = true
	character.Position = properties.InitialPosition
		+ UDim2.new(0, properties.InitialSize.X.Offset / 2, 0, properties.InitialSize.Y.Offset / 2)
	character.AnchorPoint = Vector2.new(0.5, 0.5)
	character.Rotation = animateAlpha * properties.AnimateStyleNumPeriods * 360
end

function animationStyles.Rainbow(character, animateAlpha, properties)
	character.Visible = true
	local rainbowColor = Color3.fromHSV(animateAlpha * properties.AnimateStyleNumPeriods % 1, 1, 1)
	if character:IsA("TextLabel") then
		local initialColor = getColorFromString(properties.TextColor3)
		character.TextColor3 = Color3.new(
			rainbowColor.r + animateAlpha * (initialColor.r - rainbowColor.r),
			rainbowColor.g + animateAlpha * (initialColor.g - rainbowColor.g),
			rainbowColor.b + animateAlpha * (initialColor.b - rainbowColor.b)
		)
	else
		local initialColor = getColorFromString(properties.ImageColor3)
		character.ImageColor3 = Color3.new(
			rainbowColor.r + animateAlpha * (initialColor.r - rainbowColor.r),
			rainbowColor.g + animateAlpha * (initialColor.g - rainbowColor.g),
			rainbowColor.b + animateAlpha * (initialColor.b - rainbowColor.b)
		)
	end
end
