Looking for help with analyzing my HTML, CSS, and JavaScript (THREE.js) code to achieve the desired output mentioned in the title.
//**MY HTML CODE**
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<link rel="icon" href="%PUBLIC_URL%/favicon.ico" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="theme-color" content="#000000" />
<link rel="stylesheet" href="/src/index.css" />
<script type="importmap">
{
"imports": {
"three": "https://unpkg.com/<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="42362a3027270234726c7377726c73">[email protected]</a>/build/three.module.js",
"three/addons/": "https://unpkg.com/<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="4e3a263c2b2b0e387e607f7b7e607f">[email protected]</a>/examples/jsm/"
}
}
</script>
<meta
name="description"
content="Web site created using create-react-app"
/>
<link rel="manifest" href="%PUBLIC_URL%/manifest.json" />
<title>EXAMPLE</title>
</head>
<body>
<div id="root"></div>
<div class="globe-render" id="globe-render">
<script type="module" src="./globe.js"></script>
</div>
</body>
</html>
**//CSS BLOCK:**
@tailwind base;
@tailwind components;
@tailwind utilities;
body {
background-color: #000f14;
margin: 0;
position: relative;
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen",
"Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue",
sans-serif;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
code {
font-family: source-code-pro, Menlo, Monaco, Consolas, "Courier New",
monospace;
}
#globe-render {
position: absolute;
top: -20%;
left: 20%;
background-color: rgb(255, 255, 255);
}
#myCanvas {
position: absolute;
background-color: green;
}
//JAVASCRIPT CODE
import * as THREE from "three";
import { OrbitControls } from "three/addons/controls/OrbitControls.js";
import { EffectComposer } from "three/addons/postprocessing/EffectComposer.js";
import { RenderPass } from "three/addons/postprocessing/RenderPass.js";
import { UnrealBloomPass } from "three/addons/postprocessing/UnrealBloomPass.js";
//Rest of the JS code ...
I have setClearColor in js and tried setting transparent in the css block for canvas, but still unable to convert the canvas background from black to transparent. Any help is appreciated!