lavkach3
1function testAnim(x) {2document.getElementById('animationSandbox').classList.remove();3document.getElementById('animationSandbox').classList.add('animate__animated', 'animate__' + x);4document.getElementById('animationSandbox').addEventListener('webkitAnimationEnd', removeClasses);5document.getElementById('animationSandbox').addEventListener('mozAnimationEnd', removeClasses);6document.getElementById('animationSandbox').addEventListener('MSAnimationEnd', removeClasses);7document.getElementById('animationSandbox').addEventListener('oanimationend', removeClasses);8document.getElementById('animationSandbox').addEventListener('animationend', removeClasses);9}
10
11function removeClasses() {12document.getElementById('animationSandbox').classList.remove();13}
14
15document.addEventListener('DOMContentLoaded', function() {16document.querySelector('.js--triggerAnimation').addEventListener('click', function(e) {17e.preventDefault();18var anim = document.querySelector('.js--animations').value;19testAnim(anim);20});21
22document.querySelector('.js--animations').addEventListener('change', function() {23var anim = this.value;24testAnim(anim);25});26});