A demo for embedding Three.js code as HTML code in Google Sites.
Tools: HTML, JavaScript, Three.js.
Oct 17, 2023
Three.js (threejs.org) is a popular JavaScript library for creating 3D graphics and visualizations in web browsers.
Normally, you would need to use Node.js or another environment to run Three.js code. However, I have found it very helpful for illustrating and demonstrating text in a blog-like webpage, inspired by this Three.js example: WebGL Multiple Elements Text.
So, I want to find a way to incorporate it into Google Sites and manage it as a 'block,' similar to a text box or image.
Here is a minimal working example to show you how to do it.
Copy the above code.
Find the CDN link with the latest Three.js version here: https://cdnjs.com/libraries/three.js.
Insert > Embed > Embed Code, click [Insert].
Finish.
Happy blogging! 🌼
Best,
Laurel Han
Created: Oct 17, 2023
Last modified: Oct 17, 2023