local q={}local O=require(script.Parent.Parent.Mapping.index)local e=game:GetService("\084\119\101\101\110\083\101\114\118\105\099\101")local N={}local g=table.freeze({__index=N})local function o(q,N,o,t,L,A)local r=setmetatable({UIelement=q,track={};animationData={};db=false},g)local j=O[o]local F=q[j]local function l()r.track[j]=e:Create(q,TweenInfo.new(.2),{[j]=Color3.fromRGB(tonumber(t),tonumber(L),tonumber(A))})r.track[j]:Play()end local function a()r.track[j.."\101\110\100"]=e:Create(q,TweenInfo.new(.2),{[j]=F})r.track[j.."\101\110\100"]:Play()end q.MouseEnter:Connect(function()l()end)q.MouseLeave:Connect(function()r.track[j]:Pause()a()end)return r end return{transitionColor=o}
local animations = {}

local mapping = require(script.Parent.Parent.Mapping.index)

local tweenService = game:GetService("TweenService")

local __animation_track = {}

local METATABLE = table.freeze({__index = __animation_track})

local function transitionColor(guiElement, pseudoClass, category, v1, v2,v3)
    local self = setmetatable({
        UIelement = guiElement,
        track = {},
        animationData = {},
        db = false
    }, METATABLE)

        local propertyName = mapping[category]
        local oldProp = guiElement[propertyName]

        local function onHover()
            self.track[propertyName] = tweenService:Create(guiElement, TweenInfo.new(.2), {
                [propertyName] = Color3.fromRGB(tonumber(v1), tonumber(v2), tonumber(v3))
                })
                self.track[propertyName]:Play()
            end

            local function afterHover()
                -- Create and play the tween animation
                self.track[propertyName .. "end"] = tweenService:Create(guiElement, TweenInfo.new(.2), {
                    [propertyName] = oldProp
                    })
                    self.track[propertyName .. "end"]:Play()
                end

            guiElement.MouseEnter:Connect(function()
                onHover()
            end)

            guiElement.MouseLeave:Connect(function()
                self.track[propertyName]:Pause()
                afterHover()
            end)
    return self
end

return {
    transitionColor = transitionColor
}
