-
Notifications
You must be signed in to change notification settings - Fork 4
/
index.html
237 lines (187 loc) · 9.52 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
<!DOCTYPE html>
<html lang="en-us">
<link rel="shortcut icon" type="image/x-icon" href="favicon.ico">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no">
<title>instaVerse</title>
<link rel="stylesheet" href="style.css">
</head>
<body>
<!-- Canvas de fondo (Three.js) -->
<canvas id="bg-canvas"></canvas>
<!-- Tu código existente aquí... -->
<!-- Código Three.js -->
<script src="https://threejs.org/build/three.js"></script>
<script>
//variable booleana para indicar si la barra de carga ha terminado
var loadingComplete = false;
// Crear la escena y la cámara
var scene = new THREE.Scene();
var camera = new THREE.PerspectiveCamera(75, window.innerWidth / window.innerHeight, 0.1, 1000);
camera.position.z = 1;
// Crear el renderizador
var renderer = new THREE.WebGLRenderer({ canvas: document.getElementById('bg-canvas'), antialias: true });
renderer.setSize(window.innerWidth, window.innerHeight);
// Event listener para cambio de tamaño de ventana
window.addEventListener('resize', function () {
var width = window.innerWidth;
var height = window.innerHeight;
renderer.setSize(width, height);
camera.aspect = width / height;
camera.updateProjectionMatrix();
});
// Cargar la textura
var textureLoader = new THREE.TextureLoader();
var texture = textureLoader.load('https://blockade-platform-production.s3.amazonaws.com/images/imagine/stunning_beautiful_k_vr_equirectangular_panoramic_photo_space__2c9bf70e20d6d19b__4840294_2c9bf7.jpg');
// Crear la geometría de la esfera
var geometry = new THREE.SphereGeometry(5, 32, 32);
// Crear el material con la textura mapeada y el tinte azul oscuro
var material = new THREE.MeshBasicMaterial({
map: texture,
side: THREE.BackSide
});
// Configurar el tinte utilizando HSL
var hue = 0.65; // Matiz (0.0 - 1.0, donde 0.0 y 1.0 son rojo, 0.33 es verde, 0.66 es azul)
var saturation = 0.25; // Saturación (0.0 - 1.0)
var lightness = 0.1; // Luminosidad (0.0 - 1.0)
material.color.setHSL(hue, saturation, lightness);
// Crear el objeto de malla de esfera y agregarlo a la escena
var mesh = new THREE.Mesh(geometry, material);
mesh.scale.set(-1, 1, 1); // Invierte la escala en el eje X
mesh.rotation.y = (3 / 4) * 2 * Math.PI; // 3/4 de vuelta en el eje Y
scene.add(mesh);
// Función de animación
var previousTime = performance.now();
var rotationSpeed = 0.000035; // Velocidad de rotación (radianes por milisegundo)
function animate() {
if (!loadingComplete) {
var currentTime = performance.now();
var deltaTime = currentTime - previousTime;
previousTime = currentTime;
mesh.rotation.y += rotationSpeed * deltaTime; // Ajustar la rotación
renderer.render(scene, camera);
requestAnimationFrame(animate);
}
}
animate();
</script>
</body>
<body>
<canvas id="unity-canvas"></canvas>
<div id="container" class="container">
<div class="instaVerse-logo" id="instaVerse-logo"><img src="instaVerse-logo-01b.png"></div>
<div id="unity-loading-bar" class="unity-loading-bar">
<div id="unity-progress-bar" class="unity-progress-bar">
</div>
</div>
<div id="cache-error-panel" class="cache-error-panel"><img src="CacheErrorPanelDesign.png"></div>
<div id="pc-version" class="pc-version"><img src="PcVersion.png"></div>
</div>
<div className="Description">
<small>
Create a playable 3D world with just one click using AI
</small>
</div>
<div id="footer__container" class="footer__container">
<div id="ilumine-AI-tittle-logo" class="ilumine-AI-tittle-logo"><img src="logoNameFont.png"></div>
<div id="footer__copyright" className="footer__copyright"><img src="CopyRight.png">
</div>
<div id="bottom-image" class="bottom-image"><img src="PoweredByBlockadeLabs.png"></div>
</div>
<script src="Build/2023-06-22.loader.js"></script>
<script>
const maxPixelRatioMobile = 2.0;
const maxPixelRatioDesktop = 1.5;
var isMobile = /iPhone|iPad|iPod|Android/i.test(navigator.userAgent);
var maxDevicePixelRatio = isMobile ? maxPixelRatioMobile : maxPixelRatioDesktop;
var pixelRatio = Math.min(window.devicePixelRatio, maxDevicePixelRatio);
var buildUrl = "Build";
var loaderUrl = buildUrl + "/2023-06-22.loader.js";
var config = {
dataUrl: buildUrl + "/2023-06-22.data",
frameworkUrl: buildUrl + "/2023-06-22.framework.js",
codeUrl: buildUrl + "/2023-06-22.wasm",
streamingAssetsUrl: "StreamingAssets",
companyName: "Nagare Games",
productName: "instaVerse",
productVersion: "0.1",
devicePixelRatio: pixelRatio
};
var canvas = document.querySelector("#unity-canvas");
var loadingBar = document.querySelector("#unity-loading-bar");
var progressBar = document.querySelector("#unity-progress-bar");
var container = document.querySelector("#container");
var footer__container = document.querySelector("#footer__container");
var footer__copyright = document.querySelector("#footer__copyright");
// var UnityLogo = document.querySelector("#unity-logo");
var ilumine_AI_tittle_logo = document.querySelector("#ilumine-AI-tittle-logo");
var UnityLogo = document.querySelector("#instaVerse-logo");
var cacheErrorPanel = document.querySelector("#cache-error-panel")
var pcVersion = document.querySelector("#pc-version")
var bottomImage = document.querySelector("#bottom-image");
canvas.style.display = "none";
var unityGame; // This can be used to access the application with .SendMessage() commands
var script = document.createElement("script");
script.src = loaderUrl;
script.onload = function () {
createUnityInstance(canvas, config, function (progress) {
progressBar.style.width = (100 * progress) + "%"; /* cambia esto */
}).then(function (unityInstance) {
renderer.dispose();
loadingComplete = true;
unityGame = unityInstance;
window.unityInstance = unityInstance;
loadingBar.style.display = "none";
UnityLogo.style.display = "none";
cacheErrorPanel.style.display = "none";
pcVersion.style.display = "none";
bottomImage.style.display = "none";
container.style.display = "none";
footer__container.style.display = "none";
ilumine_AI_tittle_logo.style.display = "none";
footer__copyright.style.display = "none";
// Muestra el canvas de Unity
console.log("show");
canvas.style.display = "block";
}).catch(function (message) {
alert(message);
});
};
document.body.appendChild(script);
</script>
<script src="https://www.gstatic.com/firebasejs/9.8.2/firebase-app-compat.js"></script>
<script src="https://www.gstatic.com/firebasejs/9.8.2/firebase-firestore-compat.js"></script>
<script src="https://www.gstatic.com/firebasejs/9.8.2/firebase-auth-compat.js"></script>
<script src="https://www.gstatic.com/firebasejs/9.8.2/firebase-analytics-compat.js"></script>
<script src="https://www.gstatic.com/firebasejs/9.8.2/firebase-storage-compat.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/crypto-js/4.1.1/crypto-js.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jszip/3.5.0/jszip.min.js"></script>
<script type="module">
// // Import the functions you need from the SDKs you need
// import { initializeApp } from 'https://www.gstatic.com/firebasejs/9.17.1/firebase-app.js'
// // Add Firebase products that you want to use
// import { getAuth } from 'https://www.gstatic.com/firebasejs/9.17.1/firebase-auth.js'
// import { getFirestore } from 'https://www.gstatic.com/firebasejs/9.17.1/firebase-firestore.js'
// import { getStorage } from 'https://www.gstatic.com/firebasejs/9.17.1/firebase-storage.js'
// Your web app's Firebase configuration
const firebaseApp = firebase.initializeApp({
apiKey: "AIzaSyAGAbz5eDxUlpWS5lfcy0Tq9VIyA7kbOss",
authDomain: "ai-explorer2023.firebaseapp.com",
databaseURL: "https://ai-explorer2023-default-rtdb.firebaseio.com",
projectId: "ai-explorer2023",
storageBucket: "ai-explorer2023.appspot.com",
messagingSenderId: "126855111356",
appId: "1:126855111356:web:07b69b09aa75922dc366b9"
});
// Initialize Firebase
const db = firebaseApp.firestore();
const auth = firebaseApp.auth();
const storage = firebaseApp.storage();
// const app = initializeApp(firebaseConfig);
// const db = getFirestore(app);
// const auth = getAuth(app);
// const storage = getStorage(app);
</script>
</body>
</html>