| box.addEventListener('mouseenter', function () { box.setAttribute('rotation', '0 45 0');}); box.addEventListener('mouseleave', function () { box.setAttribute('rotation', '0 0 0'); box.setAttribute('scale', {x:1,y:1,z:1}); }); box.addEventListener('click', function () { box.setAttribute('scale', {x: 0.5, y: 0.5, z: 0.5});}); cyl.addEventListener('mouseenter', function () { cyl.setAttribute('color', 'lime');}); cyl.addEventListener('mouseleave', function () { cyl.setAttribute('color', 'yellow'); cyl.setAttribute('radius', 0.5); }); cyl.addEventListener('click', function () { cyl.setAttribute('radius', 0.2);}); |