I've been working on incorporating a three.js object into my Shopify website for some time now.
The main objective is to embed this 3D object onto the homepage.
Below is the HTML/Liquid code I added to the homepage as a custom liquid section:
<canvas id="bg"></canvas>
In a separate .js file
import * as THREE from 'https://cdn.jsdelivr.net/npm/<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="f88c908a9d9db8c8d6c9c9cfd6c9">[email protected]</a>/build/three.module.js';
import { GLTFLoader } from 'https://cdn.skypack.dev/<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="71051903141431415f4043485f41">[email protected]</a>/examples/jsm/loaders/GLTFLoader.js';
// Rest of the JS code...
The issue I'm facing:
Despite all efforts, the 3D object only shows up as an empty box, as seen here.
It seems like there might be an importing problem based on the Google sources, but no errors are displayed in the Google console.
Your insights and solutions to this dilemma would be greatly appreciated!