Important:
It’s not meant as a long term solution.
There is a caveat to using embedded code from third party services:
- There is no guarantee that the resource will remain unchanged or persist at the URL you are using.
- Performance issues can occur, leading to slow page load times, broken features.
- Make sure you have permission to use.
I am unexperienced at this and I wrote this tutorial for other people like me for them to get used with how code works in playfull way and get cool inspiring results without having to go through a whole lot of time-consuming digging for info and potentially getting stuck.
https://threejs.org/ has cool visuals. Take a look at their featured projects!
-
Now go to:
three.js examples
Look for on a example you would like to embed.
I choose this one: three.js examples -
Click on the view source button on the bottom right of the screen
-
You get redirected to the githubpage. Now copy all of the code and paste it into a document
-
If you would paste this code into an embed box on your webflow site, nothing would happen because the references to the javascript files and images are pointing to local files of the github map. So we have to make all those files accessible on the www
-
Search the links to javascript files and images in the code.
Javascript can be found by searching (ctrl+f on windows) for: <script src=
You’ll see they are probably pointing at locations like …/build/three.js or js/WebGL.js -
We now have to replace those links with www-links.
The locations now like …/build/three.js or js/WebGL.js are resembling the maps and the files in the github.
So if I want to make a github file accessible, for example …/build/three.js
We go to the map build and click on three.js -
You will see one of the options below. Click on RAW view
-
a new tab opens.
In the case of three.js this is for example
https://raw.githubusercontent.com/mrdoob/three.js/master/build/three.js -
Copy the url
open https://combinatronics.com/
paste the url
You’ll get a new link
Congratulations you now have a link that can be accessed on the www! -
Copy the new url-link
Paste it in the place where the old one used to be.
So
<script src="../build/three.js"></script>
Turns into:
<script src="https://combinatronics.com/mrdoob/three.js/master/build/three.js"></script>
-
Do this for all your links to js files. There may be some more.
-
I mentioned images earlier. The same problem occurs.
For example I tried to embed this one: three.js examples
But the globe didn’t show up because it couldn’t find the image.
This was the problem:
loader.load( 'textures/land_ocean_ice_cloud_2048.jpg', function ( texture ) {
You see it is pointing at a jpg-file which I don’t have.
So i looked for the image url and replaced the code with a url that can be accessed. It now turned into:
loader.load( "https://threejs.org/examples/textures/land_ocean_ice_cloud_2048.jpg" , function ( texture ) {
-
Now go to webflow and select the html-embed component in the menu.
Copy paste the code.
Publish.
Smile.
Enjoy!
That’s all folks!
Many thanks to https://discourse.webflow.com/u/sagdfnj_sagdfnj
for explaining the github conversion on How to embed files hosted on Github - #5 by samliew