Added hover effect to buttons

This commit is contained in:
Jay 2020-05-08 22:08:34 +01:00
parent 55a1ca4454
commit 9f5ad0ee7f
1 changed files with 13 additions and 0 deletions
core/dashboard

View File

@ -113,16 +113,29 @@ controller.setup = function()
strokeRadius = 3
})
icon:on("mouseEnter", function()
icon.backgroundAlpha = 0.15
end)
icon:on("mouseExit", function()
-- container is visible if button is 'active'
if not container.visible then
icon.backgroundAlpha = 0
end
end)
icon:on("mouseLeftUp", function()
for _,v in pairs(pages) do
v[1].visible = false
v[2].iconAlpha = 0.75
v[2].backgroundAlpha = 0.0
v[2].dropShadowAlpha = 0.0
end
container.visible = true
icon.iconAlpha = 1.0
icon.backgroundAlpha = 0.2
icon.dropShadowAlpha = 0.15
end)
page.setup(container)