@needle-tools/engine 4.9.3-next.002c20b → 4.9.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -158,18 +158,8 @@ export class EngineLoadingView implements ILoadingViewHandler {
158
158
  private onDoneLoading() {
159
159
  if (this._loadingElement) {
160
160
  if (debug) console.log("Hiding loading element");
161
- // animate alpha to 0
162
- const element = this._loadingElement;
163
- element.animate([
164
- { opacity: 1 },
165
- { opacity: 0 }
166
- ], {
167
- duration: 200,
168
- easing: 'ease-in-out',
169
- }).addEventListener('finish', () => {
170
- element.style.display = "none";
171
- element.remove();
172
- });
161
+ this._loadingElement.style.display = "none";
162
+ this._loadingElement.remove();
173
163
  }
174
164
  if (this._progressLoop)
175
165
  clearInterval(this._progressLoop);
@@ -200,7 +190,6 @@ export class EngineLoadingView implements ILoadingViewHandler {
200
190
  loadingStyle = "light";
201
191
  }
202
192
 
203
-
204
193
  const hasLicense = hasProLicense();
205
194
  if (!existing) {
206
195
  this._loadingElement.style.position = "absolute";
@@ -208,7 +197,6 @@ export class EngineLoadingView implements ILoadingViewHandler {
208
197
  this._loadingElement.style.height = "100%";
209
198
  this._loadingElement.style.left = "0";
210
199
  this._loadingElement.style.top = "0";
211
- this._loadingElement.style.overflow = "hidden";
212
200
  const loadingBackgroundColor = this._element.getAttribute("loading-background");
213
201
  if (loadingBackgroundColor) {
214
202
  this._loadingElement.style.background = loadingBackgroundColor;
@@ -239,48 +227,24 @@ export class EngineLoadingView implements ILoadingViewHandler {
239
227
  }
240
228
 
241
229
  const content = document.createElement("div");
242
- content.style.cssText = `
243
- position: relative;
244
- display: flex;
245
- flex-direction: column;
246
- align-items: center;
247
- justify-content: center;
248
- width: 100%;
249
- height: 100%;
250
- pointer-events: none;
251
- `
252
230
  this._loadingElement.appendChild(content);
253
231
 
254
- const poster = this._element.getAttribute("poster");
255
- if (poster !== null && poster !== "0") {
256
- const backgroundImage = document.createElement("div");
257
- const backgroundBlur = poster?.length ? "0px" : "50px";
258
- backgroundImage.style.cssText = `
259
- position: absolute;
260
- left: 0;
261
- top: 0;
262
- bottom: 0;
263
- right: 0;
264
- z-index: -1;
265
- overflow: hidden;
266
-
267
- margin: -${backgroundBlur};
268
- background: url('${poster?.length ? poster : "/include/poster.webp"}') center center no-repeat;
269
- background-size: cover;
270
- filter: blur(${backgroundBlur});
271
- `;
272
- this._loadingElement.appendChild(backgroundImage);
273
- }
274
-
275
232
  const logo = document.createElement("img");
276
- const logoWidth = "80%";
277
- const logoHeight = "15%";
278
- const logoDelay = ".2s";
233
+ const logoSize = 120;
234
+ logo.style.width = `${logoSize}px`;
235
+ logo.style.height = `${logoSize}px`;
236
+ logo.style.paddingTop = "20px";
237
+ logo.style.paddingBottom = "10px";
238
+ logo.style.margin = "0px";
279
239
  logo.style.userSelect = "none";
280
240
  logo.style.objectFit = "contain";
241
+ logo.style.transition = "transform 1.5s ease-out, opacity .3s ease-in-out";
281
242
  logo.style.transform = "translateY(30px)";
282
- logo.style.opacity = "0.0000001";
283
- logo.style.transition = `transform 1s ease-out ${logoDelay}, opacity .3s ease-in-out ${logoDelay}`;
243
+ logo.style.opacity = "0.05";
244
+ setTimeout(() => {
245
+ logo.style.opacity = "1";
246
+ logo.style.transform = "translateY(0px)";
247
+ }, 1);
284
248
  logo.src = needleLogoOnlySVG;
285
249
  let isUsingCustomLogo = false;
286
250
  if (hasLicense && this._element) {
@@ -288,15 +252,8 @@ export class EngineLoadingView implements ILoadingViewHandler {
288
252
  if (customLogo) {
289
253
  isUsingCustomLogo = true;
290
254
  logo.src = customLogo;
291
- setTimeout(() => {
292
- logo.style.opacity = "1";
293
- logo.style.transform = "translateY(0px)";
294
- }, 1);
295
255
  }
296
256
  }
297
-
298
- logo.style.width = `${logoWidth}`;
299
- logo.style.height = `min(1000px, max(${logoHeight}, 50px))`;
300
257
  content.appendChild(logo);
301
258
 
302
259
  const details = document.createElement("div");
@@ -316,14 +273,18 @@ export class EngineLoadingView implements ILoadingViewHandler {
316
273
  const maxWidth = 100;
317
274
  loadingBarContainer.style.display = "flex";
318
275
  loadingBarContainer.style.width = maxWidth + "%";
319
- loadingBarContainer.style.height = "5px";
276
+ loadingBarContainer.style.height = "3px";
320
277
  loadingBarContainer.style.position = "absolute";
321
278
  loadingBarContainer.style.left = "0";
322
- loadingBarContainer.style.top = "0px";
279
+ loadingBarContainer.style.bottom = "0px";
323
280
  loadingBarContainer.style.opacity = "0";
324
- loadingBarContainer.style.transition = "opacity 1s ease-in-out";
325
- loadingBarContainer.style.backgroundColor = "rgba(240,240,240,.5)"
281
+ loadingBarContainer.style.transition = "opacity 1s ease-in-out 2s";
326
282
  setTimeout(() => { loadingBarContainer.style.opacity = "1"; }, 1);
283
+ if (loadingStyle === "light")
284
+ loadingBarContainer.style.backgroundColor = "rgba(0,0,0,.2)"
285
+ else
286
+ loadingBarContainer.style.backgroundColor = "rgba(255,255,255,.2)"
287
+ // loadingBarContainer.style.alignItems = "center";
327
288
 
328
289
  this._loadingElement.appendChild(loadingBarContainer);
329
290
 
@@ -333,9 +294,9 @@ export class EngineLoadingView implements ILoadingViewHandler {
333
294
  const getGradientPos = function (t: number): string {
334
295
  return Mathf.lerp(0, maxWidth, t) + "%";
335
296
  }
336
- // `linear-gradient(90deg, #204f49 ${getGradientPos(0)}, #0BA398 ${getGradientPos(.3)}, #66A22F ${getGradientPos(.6)}, #D7DB0A ${getGradientPos(1)})`;
297
+ this._loadingBar.style.background = "#66A22F";
298
+ // `linear-gradient(90deg, #204f49 ${getGradientPos(0)}, #0BA398 ${getGradientPos(.3)}, #66A22F ${getGradientPos(.6)}, #D7DB0A ${getGradientPos(1)})`;
337
299
  this._loadingBar.style.backgroundAttachment = "fixed";
338
- this._loadingBar.style.background = "#c4c4c4ab";
339
300
  this._loadingBar.style.width = "0%";
340
301
  this._loadingBar.style.height = "100%";
341
302
  if (hasLicense && this._element) {