AFRAME.registerComponent('on-placed-handler', {
    init() {
        this.fox = document.querySelector('#fox')

        this.listeners = {
            onPlaced: this.onPlaced.bind(this),
        }

        this.el.addEventListener('placed', this.listeners.onPlaced)
    },
    remove() {
        this.el.removeEventListener('placed', this.listeners.onPlaced)
    },
    onPlaced() {
        this.fox.emit('start-animation')
        document.querySelector('#recorder').classList.remove('hidden')
    },
})