JSFiddle - React, Tailwind, and code Playground
HTML
<link rel="stylesheet" type="text/css" href="https://ui-unicorn.co.uk/hostinger-exp/css/base.css" />
<body class="loading demo-1">
<div class="loading-screen" data-section-theme="light">
<div class="loading-animation">
<div class="loading-bar"></div>
</div>
</div>
<div class="hotspot__positioner--01 hotspot1">
<div class="hotspot__container">
<div class="hotspot hotspot--01"></div>
<div class="hotspot hotspot--02"></div>
<div class="hotspot hotspot--03"></div>
</div>
</div>
<div class="hotspot__positioner--02 hotspot2">
<div class="hotspot__container">
<div class="hotspot hotspot--01"></div>
<div class="hotspot hotspot--02"></div>
<div class="hotspot hotspot--03"></div>
</div>
</div>
<div class="hotspot__positioner--03 hotspot3">
<div class="hotspot__container">
<div class="hotspot hotspot--01"></div>
<div class="hotspot hotspot--02"></div>
<div class="hotspot hotspot--03"></div>
</div>
</div>
<script src="https://ui-unicorn.co.uk/game-lesson-1/js/SmoothScroll.js" defer></script>
<script src="https://ui-unicorn.co.uk/game-lesson-1/js/jquery-3.4.1.min.js"></script>
</body>
JavaScript
import * as THREE from "https://ui-unicorn.co.uk/js/three.module.js";
import TWEEN from "https://ui-unicorn.co.uk/js/tween.esm.js";
import {
RGBELoader
} from "https://ui-unicorn.co.uk/js/RGBELoader.js";
import {
OrbitControls
} from "https://ui-unicorn.co.uk/js/OrbitControls.js";
import {
GLTFLoader
} from "https://ui-unicorn.co.uk/js/GLTFLoader.js";
import {
RoughnessMipmapper
} from "https://ui-unicorn.co.uk/js/RoughnessMipmapper.js";
var container, controls;
var camera, scene, renderergl, mixer, mixer2, clock, clock2, labelRenderer;
var raycaster, mouse, tween;
var model, model2;
var cube, cube2, cube3, cube4, cube5, character, score, gltfPlayer;
var action;
init();
animate();
function init() {
container = document.createElement("div");
container.className = "experience-div";
$("body").prepend(container);
camera = new THREE.PerspectiveCamera(45, window.innerWidth / window.innerHeight, 1, 10000);
scene = new THREE.Scene();
clock = new THREE.Clock();
clock2 = new THREE.Clock();
raycaster = new THREE.Raycaster();
mouse = new THREE.Vector2();
score = 0;
new RGBELoader().setDataType(THREE.UnsignedByteType).load('https://ui-unicorn.co.uk/images/royal_esplanade_1k.hdr', function(texture) {
var envMap = pmremGenerator.fromEquirectangular(texture).texture;
scene.environment = envMap;
texture.dispose();
pmremGenerator.dispose();
var roughnessMipmapper = new RoughnessMipmapper(renderergl);
var loader = new GLTFLoader();
loader.load("https://ui-unicorn.co.uk/game-lesson-1/untitled.glb", function(gltf) {
model = gltf.scene;
gltf.scene.traverse(function(child) {
if (child.isMesh) {
roughnessMipmapper.generateMipmaps(child.material);
scene.background = new THREE.Color(0xf5dad8);
$(".loading-screen").fadeOut(2500);
...