function move_over(node, evt)
    ui.set_cursor('base:ui/cursor/interact')
    node:set_property_bool('animate', true)
    node:set_property_float('$direction', 1.0)
end

function move_out(node, evt)
    ui.set_cursor('base:ui/cursor/normal')
    node:set_property_bool('animate', true)
    node:set_property_float('$direction', -1.0)
end

function update(node, evt)
    local dir = node:get_property_float('$direction')
    local time = node:get_property_float('$time') + evt.delta * dir

    local d = 15
    time = math.min(math.max(time, 0), d)

    node:set_property_float('$time', time)

    local tween = require 'util.tween';
    node:set_property_float('ani_offset', tween.ease_in_out_quad(time, 0, 1, d))

    if dir < 0.0 and time <= 0.0 then
        node:set_property_bool('animate', false)
        -- Optimization to disable shadows
        node:set_property_bool('shadows_active', false)
    elseif dir > 0.0 and time >= d then
        node:set_property_bool('animate', false)
    else
        node:set_property_bool('shadows_active', true)
    end
end