Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

184
Vistas
el botón no tiene función con 8thwall

Tengo una aplicación web creada con 8thwall e implementé un nuevo botón para la animación. Agregué la misma lógica para este botón que para los otros (los anteriores funcionan bien), pero por alguna razón este botón no tiene funcionalidad.

El botón que no funciona es shareButtonComponent. ¿Puede alguien por favor guiarme?

 const replayButtonComponent = () => ({ init() { const model = document.getElementById('model') const replayButton = document.getElementById('replaybutton') const shopButton = document.getElementById('shopbutton') const entity = document.querySelector('[sound]') model.addEventListener('animation-finished', () => { model.setAttribute('animation-mixer', { clip: 'rabitidle', loop: 'once', timeScale: 0, }) replayButton.classList.remove('inactive') shopButton.classList.remove('inactive') }) replayButton.style.display = 'block' const replayAnimation = () => { replayButton.classList.add('inactive') shopButton.classList.add('inactive') model.setAttribute('animation-mixer', { clip: 'rabitanim', loop: 'once', timeScale: 1, }) entity.components.sound.playSound() } replayButton.onclick = replayAnimation }, }) export {replayButtonComponent} const shareButtonComponent = () => ({ init() { const shareToggle = document.getElementById('sharebutton') shareToggle.style.display = 'block' const holder = document.getElementById('hyperlink-holder') shareToggle.addEventListener('click', () => { holder.classList.toggle('holder-active') }) }, }) export {shareButtonComponent} const shopButtonComponent = () => ({ init() { const shopButton = document.getElementById('shopbutton') shopButton.style.display = 'block' const shop = () => { window.open( 'https://www.amazon.com/Goodnight-Bubbala-Sheryl-Haft/dp/0525554777/ref=sr_1_1?crid=1EDVMUS03H9C5&keywords=Sheryl+haft&qid=1640032526&sprefix=sheryl+haft%2Caps%2C120&sr=8-1' ) } shopButton.onclick = shop }, }) export {shopButtonComponent} const animationComponent = () => ({ init() { const entity = document.querySelector('[sound]') const model = document.getElementById('model') this.el.sceneEl.addEventListener('realityready', () => { model.setAttribute('animation-mixer', { clip: 'rabitanim', loop: 'once', }) entity.components.sound.playSound() model.setAttribute('scale', {x: 1, y: 1, z: 1}) }) }, }) export {animationComponent}
about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

Proporcione más información sobre cómo está importando el componente exportado. El componente debe importarse en app.js primero así https://www.8thwall.com/8thwall/animation-mixer-aframe/code/app.js#L8 y luego registrarse con un nombre como aframe-component. Luego, el componente nombrado debe llamarse a la escena para que el componente funcione así https://www.8thwall.com/8thwall/animation-mixer-aframe/code/body.html#L9

about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda