import WebGL from 'three/addons/capabilities/WebGL.js';
if ( WebGL.isWebGL2Available() ) {
// Initiate function or other initializations here
animate();
} else {
const warning = WebGL.getWebGL2ErrorMessage();
document.getElementById( 'container' ).appendChild( warning );
}